:root {
  --brand: #142b49; --brand-dark: #0f2038; --brand-deep: #0b1829; --brand-light: #1f4570; --brand-accent: #10a89a; --brand-soft: #e8eef6; --brand-soft2: #d5e0ee;
  --side1: #0f2038; --side2: #0a1626; --guest1: #12294a; --guest2: #0a1626;
}
/* EMS by Nuvobrix: base styles (no build step needed) */
:root {
  --green: var(--brand-dark); --green-dark: var(--brand-deep); --ink: #17212b; --muted: #5b6b7a; --line: #e1e8ee;
  --bg: #f3f6f9; --card: #fff; --side: var(--side1); --side-ink: #cfe3da;
  --red: #b3382c; --amber: #9a6a00; --amber-bg: #fff4e0; --ok-bg: #e7f6ef; --err-bg: #fdecea; --info-bg: #e8f1fb;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 "Segoe UI", system-ui, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--green); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-light), var(--brand-deep)); color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: .5px; }
.brand__text { line-height: 1.1; }
.brand__text strong { display: block; font-size: 1.05rem; }
.brand__text span { font-size: .78rem; opacity: .75; }

/* Buttons and forms */
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #c7d2dc; }
.btn--primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn--danger { background: #fff; border-color: #e5b4ae; color: var(--red); }
.btn--sm { padding: 5px 11px; font-size: .88rem; }
.btn--block { display: block; width: 100%; text-align: center; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd8e0; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-light); border-color: var(--green); }
.field-error { color: var(--red); font-size: .88rem; margin-top: 4px; }
.help { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
form.inline { display: inline; }

/* Cards, tables, badges, alerts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 4px 14px rgba(20, 40, 60, .04); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .9rem; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef3f7; color: var(--muted); }
.badge--ok { background: var(--ok-bg); color: var(--green-dark); }
.badge--warn { background: var(--amber-bg); color: var(--amber); }
.badge--bad { background: var(--err-bg); color: var(--red); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border-left: 5px solid; }
.alert--success { background: var(--ok-bg); border-color: var(--green); }
.alert--error { background: var(--err-bg); border-color: var(--red); }
.alert--warning { background: var(--amber-bg); border-color: #f0b860; }
.alert--info { background: var(--info-bg); border-color: #5b9bd5; }
.secret { font: 700 1.15rem/1.4 Consolas, monospace; background: #fff; border: 1px dashed #7a8ea0; padding: 6px 12px; border-radius: 8px; display: inline-block; user-select: all; }

/* Guest layout (login) */
.guest { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(135deg, var(--brand-dark), var(--side1)); }
.guest__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.guest__card { width: 100%; max-width: 430px; background: #fff; border-radius: 18px; padding: 34px 32px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.guest__card .brand { justify-content: center; margin-bottom: 14px; }
.guest__card h1 { text-align: center; }
.guest .footer { color: rgba(255, 255, 255, .85); }

/* App layout */
.app { display: flex; min-height: 100vh; }
.side { width: 250px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; margin: 4px 6px 18px; }
.side nav a { display: block; color: var(--side-ink); text-decoration: none; padding: 10px 14px; border-radius: 10px; margin: 2px 0; font-weight: 600; }
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a.is-active { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset 3px 0 0 var(--brand-accent); }
.side__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin: 16px 8px 4px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 24px; }
.topbar h1 { margin: 0; flex: 1; }
.menu-toggle { display: none; }
.page { padding: 24px; flex: 1; max-width: 1100px; width: 100%; }
.support-banner { background: #5a2d82; color: #fff; padding: 10px 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.support-banner--write { background: #a23b1d; }
.support-banner form { margin-left: auto; }

/* Footer */
.footer { text-align: center; color: var(--muted); font-size: .88rem; padding: 18px 12px; }

/* Phone */
@media screen and (max-width: 800px) {
  .app { display: block; }
  .side { position: fixed; left: -270px; top: 0; z-index: 30; width: 250px; transition: left .2s; }
  .side.is-open { left: 0; }
  .menu-toggle { display: inline-block; }
  .grid2 { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

/* Phase 2 */
.brand__logo { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; padding: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; background: #e9eff4; padding: 5px; border-radius: 12px; margin-bottom: 18px; }
.tabs a { padding: 8px 16px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; }
.tabs a.is-active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 4px rgba(20, 40, 60, .12); }
details > summary { cursor: pointer; list-style: none; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }
fieldset legend { padding: 0 6px; }

/* Phase 3 */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Phase 4: attendance */
.datebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.datebar input[type=date] { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: #eef3f7; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .9rem; }
.chip--ok { background: var(--ok-bg); border-color: #b9dfcd; }
.chip--bad { background: var(--err-bg); border-color: #efc2bd; }
.attgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.attcard { background: #fff; border: 1px solid var(--line); border-left: 5px solid #cfd8e0; border-radius: var(--radius); padding: 14px 16px; }
.attcard.is-present, .attcard.is-late { border-left-color: var(--green); }
.attcard.is-absent { border-left-color: var(--red); }
.attcard.is-half_day, .attcard.is-leave { border-left-color: #e0a030; }
.attcard.is-off { background: #f4f6f8; border-left-color: #9aa8b5; }
.attcard__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.seggroup { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { position: relative; margin: 0; font-weight: 600; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span { display: block; padding: 7px 12px; border: 1px solid #cfd8e0; border-radius: 9px; background: #fff; font-size: .92rem; }
.seg input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand-light); }
.seg input:disabled + span { opacity: .55; cursor: not-allowed; }
.more { margin-top: 10px; }
.more summary { cursor: pointer; color: var(--green-dark); font-weight: 600; }
.savebar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 12px 16px; margin: 16px -24px -24px; text-align: right; z-index: 5; }
@media screen and (max-width: 800px) { .savebar { margin: 16px -16px -16px; } .attgrid { grid-template-columns: 1fr; } }

/* Phase 6: salary slip + printing */
.slip { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin: 0 0 22px; max-width: 820px; }
.slip__head { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid var(--green); padding-bottom: 12px; }
.slip__logo { width: 62px; height: 62px; object-fit: contain; }
.slip__title { margin-left: auto; text-align: right; }
.slip__net { display: flex; justify-content: space-between; align-items: center; background: var(--ok-bg); border-radius: 10px; padding: 12px 16px; margin: 14px 0; font-size: 1.1rem; }
.slip__net b { font-size: 1.5rem; }
.slip__mark { position: absolute; top: 38%; left: 30%; transform: rotate(-24deg); font-size: 5rem; font-weight: 800; color: rgba(179, 56, 44, .13); pointer-events: none; letter-spacing: .1em; }
@media print {
  body { background: #fff; }
  .side, .topbar, .footer, .no-print, .support-banner, .alert { display: none !important; }
  .content, .page { display: block; padding: 0; margin: 0; max-width: none; }
  .app { display: block; }
  .slip { border: 0; padding: 0; margin: 0; max-width: none; page-break-after: always; box-shadow: none; }
}

/* Smooth navigation (app-nav.js) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: linear-gradient(90deg, var(--brand-light), var(--brand-accent)); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; pointer-events: none; }
.nav-progress.is-running { opacity: 1; transition: transform .9s cubic-bezier(.1, .8, .2, 1), opacity .2s; }
.content .page { transition: opacity .15s ease; outline: none; }
.content.is-loading .page { opacity: .55; pointer-events: none; }
.content.is-entering .page { animation: pageIn .22s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.btn, .side nav a, .tabs a, input, select, textarea { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.nav-error { margin-bottom: 14px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-progress.is-running, .content .page { transition: none; }
  .content.is-entering .page { animation: none; }
}

/* ===== Modern refresh ===== */
:root {
  --green: var(--brand); --green-dark: var(--brand-dark); --green-soft: var(--brand-soft);
  --ink: #101828; --muted: #667085; --line: #e4e9f0;
  --bg: #f5f7fb; --card: #fff;
  --side: var(--side2); --side-ink: #b9d3c8;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -8px rgba(16, 24, 40, .08);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
body { font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Sidebar */
.side { width: 264px; background: linear-gradient(180deg, var(--side1) 0%, var(--side2) 100%); padding: 20px 14px 16px; border-right: 1px solid rgba(255, 255, 255, .04); }
.side .brand { padding: 8px 8px 16px; margin: 0 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side nav a { padding: 10px 14px; border-radius: 10px; font-weight: 550; font-size: .95rem; position: relative; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.is-active { background: linear-gradient(90deg, color-mix(in srgb, var(--brand-accent) 20%, transparent), color-mix(in srgb, var(--brand-accent) 6%, transparent)); color: #fff; box-shadow: none; }
.side nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-accent); }
.side__label { margin: 18px 12px 6px; letter-spacing: .1em; opacity: .5; }

/* Top bar and page */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); padding: 16px 28px; }
.page { padding: 28px; max-width: 1180px; }

/* Cards */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); padding: 22px 24px; }
.card > h2:first-child { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
/* table cards keep the same inner padding as every other card, so the heading, the buttons and the table never touch the edge */
.card.table-wrap { padding: 18px 20px; }

/* Stat tiles */
.cards { gap: 16px; }
.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 20px 18px 22px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--brand-light), var(--brand-accent)); }
.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 14px 30px -10px rgba(16, 24, 40, .14); }
.stat b { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.stat span { display: block; margin-top: 2px; font-size: .86rem; font-weight: 500; }

/* Forms */
label { font-weight: 600; font-size: .88rem; color: #344054; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=month], input[type=time], input[type=number], select, textarea {
  padding: 11px 14px; border: 1px solid #d0d5dd; border-radius: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover, textarea:hover { border-color: #b8c0cc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--green); width: 17px; height: 17px; }
.help { color: var(--muted); font-size: .83rem; }
.field-error { font-weight: 500; }
.actions { margin-top: 22px; }

/* Buttons */
.btn { padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: .94rem; border-color: #d0d5dd; box-shadow: var(--shadow-sm); }
.btn:hover { background: #f9fafb; border-color: #b8c0cc; }
.btn--primary { background: linear-gradient(180deg, var(--brand-light), var(--brand)); border-color: var(--brand-dark); box-shadow: 0 1px 2px rgba(10, 107, 77, .35), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn--primary:hover { background: linear-gradient(180deg, var(--brand-dark), var(--brand-dark)); border-color: var(--brand-dark); }
.btn--danger { color: var(--red); border-color: #f1c3be; }
.btn--danger:hover { background: #fef3f2; }
.btn--sm { padding: 6px 12px; font-size: .86rem; border-radius: 9px; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Tables */
.table th { background: #f9fafb; font-size: .74rem; font-weight: 700; letter-spacing: .06em; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 13px 14px; border-bottom: 1px solid #eef1f5; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }

/* Badges, chips, alerts */
.badge { padding: 3px 11px; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.alert { border: 1px solid; border-left-width: 4px; border-radius: 12px; padding: 13px 18px; box-shadow: var(--shadow-sm); }
.alert--success { background: #ecfdf3; border-color: #a6e9c5; border-left-color: #12b76a; color: #05603a; }
.alert--error { background: #fef3f2; border-color: #fecdca; border-left-color: #f04438; color: #912018; }
.alert--warning { background: #fffaeb; border-color: #fedf89; border-left-color: #f79009; color: #93370d; }
.alert--info { background: #eff8ff; border-color: #b2ddff; border-left-color: #2e90fa; color: #175cd3; }
.alert a { color: inherit; font-weight: 600; }

/* Tabs and segmented controls */
.tabs { background: #eaeef4; padding: 5px; border-radius: 12px; }
.tabs a { padding: 8px 18px; font-weight: 600; font-size: .92rem; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { box-shadow: var(--shadow-sm), 0 0 0 1px rgba(16, 24, 40, .04); }
.seg span { border-radius: 10px; }
.attcard { border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.attcard:hover { box-shadow: var(--shadow); }
.savebar { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 -8px 24px -12px rgba(16, 24, 40, .12); }
.kv { padding: 10px 0; }
.chip { border-radius: 999px; font-weight: 500; }

/* Sign-in screen */
.guest { background: radial-gradient(1000px 500px at 15% -10%, var(--brand-light) 0%, transparent 60%), radial-gradient(900px 500px at 100% 110%, var(--guest1) 0%, transparent 60%), var(--guest2); }
.guest__card { border-radius: 20px; padding: 36px 34px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5); }

/* Phone */
@media screen and (max-width: 800px) {
  .side { width: 270px; left: -290px; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .topbar { padding: 12px 16px; }
  .page { padding: 16px; }
  .card { padding: 18px; }
}
@media print { .card, .stat { box-shadow: none; } }

/* Dashboard */
.hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; color: #fff; border-radius: 18px; padding: 24px 28px; margin-bottom: 22px; background: radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--brand-accent) 35%, transparent), transparent 70%), linear-gradient(135deg, var(--brand), var(--brand-deep)); box-shadow: 0 14px 30px -14px rgba(10, 77, 58, .6); }
.hero h2 { color: #fff; font-size: 1.35rem; margin: 0 0 4px; }
.hero p { margin: 2px 0; opacity: .92; }
.hero .hero__meta { font-size: .85rem; opacity: .75; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero__actions .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; box-shadow: none; }
.hero__actions .btn:hover { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .5); }
.section-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 6px 2px 10px; font-weight: 700; }
.stat--good::before { background: linear-gradient(180deg, #12b76a, var(--brand-accent)); }
.stat--bad::before { background: linear-gradient(180deg, #f04438, #f97066); }
.stat--warn::before { background: linear-gradient(180deg, #f79009, #fdb022); }
.feed__row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.feed__row:last-child { border-bottom: 0; }
.feed__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-top: 7px; box-shadow: 0 0 0 4px var(--green-soft); }
@media screen and (max-width: 800px) { .hero { padding: 20px; } }

.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* Page links (pagination) */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 6px 6px; }
.pager__info { margin: 0; }
.pager__list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pager__item { display: inline-block; min-width: 38px; padding: 7px 12px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-sm); }
a.pager__item:hover { border-color: #b8c0cc; background: #f9fafb; }
.pager__item.is-current { background: var(--green); border-color: var(--green); color: #fff; }
.pager__item.is-disabled { color: #98a2b3; background: #f9fafb; box-shadow: none; }
.pager svg { width: 1em; height: 1em; }

/* Advance ledger */
.ledger tbody tr[data-ledger] { cursor: pointer; }
.ledger tfoot th { background: #f9fafb; border-top: 2px solid var(--line); }
.ledger td .btn { white-space: nowrap; }
.modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 70px -20px rgba(16, 24, 40, .5); color: var(--ink); }
.modal::backdrop { background: rgba(16, 24, 40, .5); backdrop-filter: blur(2px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal__body { padding: 8px 20px 20px; overflow-y: auto; max-height: calc(100vh - 140px); }
.modal__body h3 { margin: 12px 0 8px; font-size: 1.05rem; }
.modal__body h4 { margin: 16px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.ledger td:nth-child(n+4):nth-child(-n+6), .ledger tfoot th { white-space: nowrap; }

/* Monthly attendance grid */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .gcell { width: 24px; height: 22px; line-height: 22px; border-radius: 6px; font-style: normal; }
.grid-wrap { padding: 0; overflow-x: auto; }
.mgrid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .82rem; }
.mgrid th, .mgrid td { border-bottom: 1px solid #eef1f5; padding: 0; text-align: center; }
.mgrid thead th { background: #f9fafb; font-weight: 700; color: var(--muted); padding: 6px 0; min-width: 31px; position: sticky; top: 0; z-index: 2; }
.mgrid__day small { display: block; font-weight: 500; font-size: .66rem; opacity: .75; }
.mgrid__day.is-future { opacity: .5; }
.mgrid .mgrid__name { position: sticky; left: 0; z-index: 3; background: #fff; text-align: left; padding: 6px 12px; min-width: 190px; max-width: 220px; border-right: 1px solid var(--line); white-space: nowrap; }
.mgrid thead .mgrid__name { background: #f9fafb; z-index: 4; }
.mgrid__name small { display: block; color: var(--muted); font-weight: 400; }
.mgrid__name a { text-decoration: none; font-weight: 600; }
.mgrid .mgrid__sum { min-width: 34px; padding: 6px 4px; background: #fcfcfd; border-left: 1px solid var(--line); }
.mgrid tbody tr:hover th.mgrid__name, .mgrid tbody tr:hover td { background-color: #f8fafc; }
.gcell { font-weight: 700; font-size: .78rem; height: 32px; min-width: 31px; user-select: none; display: table-cell; }
.mgrid .gcell { border-left: 1px solid #f3f5f8; }
.gcell.is-click { cursor: pointer; }
.gcell.is-click:hover, .gcell.is-click:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.gcell--present { background: #dcf5e8; color: #08613f; }
.gcell--late { background: #e6f4cf; color: #4b6a0a; }
.gcell--absent { background: #fde0dd; color: #a8261b; }
.gcell--half_day { background: #fdecc8; color: #8a5a00; }
.gcell--leave { background: #dbeafe; color: #1d4ed8; }
.gcell--weekly_off { background: #eceff3; color: #98a2b3; }
.gcell--holiday { background: #ede4fb; color: #6b3fc2; }
.gcell--unmarked { background: #fff; color: #cbd2dc; }
.gcell--future, .gcell--out { background: #fafbfc; color: #d5dae2; }
.legend .gcell { display: inline-block; text-align: center; }

/* Allowances: two panels */
.allow { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.allow-list { padding: 14px; position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.allow-list input[type=search] { margin-bottom: 10px; }
.allow-list__items { position: relative; overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; min-height: 120px; }
.allow-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.allow-item:hover { background: #f4f6f9; }
.allow-item.is-active { background: var(--green-soft); border-color: #b9dfcd; }
.allow-item__who strong { display: block; font-size: .93rem; }
.allow-item__who small { display: block; color: var(--muted); font-size: .76rem; }
.allow-item__amount { font-weight: 700; font-size: .84rem; white-space: nowrap; color: var(--green-dark); }
.allow-item__amount.is-empty { color: #b8c0cc; font-weight: 500; }
.allow-list__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.allow-list__foot strong { color: var(--ink); }
.allow-panel { margin-bottom: 0; transition: opacity .12s ease; }
.allow-panel.is-loading { opacity: .55; pointer-events: none; }
.allow-panel__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.allow-panel__head h2 { margin: 0 0 2px; padding: 0; border: 0; font-size: 1.25rem; }
.allow-total { text-align: right; }
.allow-total span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.allow-total strong { font-size: 1.5rem; letter-spacing: -.02em; color: var(--green-dark); }
.allow-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.allow-fields:disabled input { background: #f6f8fa; color: var(--muted); }
.allow-fields h3 { margin: 18px 0 2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.allow-fields h3:first-child { margin-top: 0; }
.allow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.allow-auto { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 14px; border-radius: 10px; background: #f2f7f4; border: 1px dashed #b9dfcd; }
.allow-auto output { font-weight: 700; font-size: 1.05rem; color: var(--green-dark); }
.allow-auto small { color: var(--muted); font-size: .74rem; }
.allow-rows { margin-top: 4px; }
.allow-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 0 16px; }
.allow-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.allow-total--big { text-align: left; }
.allow-salary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 12px; background: #f2f7f4; border: 1px solid #cfe6da; }
.allow-salary span { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.allow-salary strong { font-size: 1.1rem; letter-spacing: -.01em; }
.allow-salary i { font-style: normal; font-weight: 700; color: var(--muted); font-size: 1.2rem; }
.allow-salary__total { margin-left: auto; text-align: right; }
.allow-salary__total strong { font-size: 1.5rem; color: var(--green-dark); }
@media screen and (max-width: 600px) { .allow-salary__total { margin-left: 0; text-align: left; flex-basis: 100%; } }
@media screen and (max-width: 900px) {
  .allow { grid-template-columns: 1fr; }
  .allow-list { position: static; max-height: 320px; }
  .allow-row { grid-template-columns: 1fr; }
}

/* Salary slip: compact and premium, one A4 page */
.slip { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px 12px; margin: 0 0 18px; max-width: 820px; font-size: .86rem; line-height: 1.35; box-shadow: var(--shadow); break-inside: avoid; page-break-inside: avoid; }
.slip__head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--green); }
.slip__logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.slip__company h2 { margin: 0; padding: 0; border: 0; font-size: 1.12rem; letter-spacing: -.01em; }
.slip__company div { color: var(--muted); font-size: .76rem; }
.slip__title { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.slip__title strong { font-size: .95rem; letter-spacing: .14em; color: var(--green-dark); }
.slip__title span { font-size: .8rem; color: var(--muted); }
.slip__status { font-style: normal; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; margin-top: 3px; background: #fef0c7; color: #93370d; }
.slip__status.is-paid { background: #d1fadf; color: #05603a; }
.slip__facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 14px; margin-top: 10px; padding: 8px 10px; background: #f8fafb; border: 1px solid #eef1f5; border-radius: 8px; }
.slip__facts--attendance { grid-template-columns: repeat(7, 1fr); margin-top: 6px; background: #fff; }
.slip__facts div { min-width: 0; }
.slip__facts span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.slip__facts b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.slip__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; align-items: start; }
.slip__tbl { width: 100%; border-collapse: collapse; }
.slip__tbl th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--green-dark); padding: 4px 8px; }
.slip__tbl th:last-child, .slip__tbl td:last-child { text-align: right; white-space: nowrap; }
.slip__tbl td { padding: 3px 8px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.slip__tbl tfoot td { font-weight: 700; background: #f2f7f4; border-top: 1.5px solid var(--green); border-bottom: 0; }
.slip__net { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 0; padding: 9px 14px; border-radius: 8px; background: linear-gradient(90deg, var(--brand-dark), var(--brand)); color: #fff; font-size: .85rem; letter-spacing: .12em; }
.slip__net b { font-size: 1.3rem; letter-spacing: -.01em; }
.slip__facts--payment { background: #fff; margin-top: 8px; }
.slip__tbl--parts { margin-top: 8px; }
.slip__tbl--parts td { overflow-wrap: anywhere; }
.slip__foot { margin: 8px 0 0; text-align: center; color: #98a2b3; font-size: .68rem; }
.slip__mark { position: absolute; top: 40%; left: 28%; transform: rotate(-24deg); font-size: 4.2rem; font-weight: 800; color: rgba(179, 56, 44, .12); pointer-events: none; letter-spacing: .1em; }
@media (max-width: 640px) {
  .slip__facts, .slip__facts--attendance { grid-template-columns: repeat(2, 1fr); }
  .slip__cols { grid-template-columns: 1fr; }
}
@page { size: A4; margin: 10mm; }
@media print {
  html, body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip { border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; max-width: none; font-size: 10.5px; line-height: 1.3; page-break-after: auto; }
  .slip + .slip { page-break-before: always; break-before: page; }   /* one slip per page, and no blank page after the last one */
  .slip__facts { margin-top: 7px; padding: 5px 8px; }
  .slip__facts--attendance { margin-top: 4px; }
  .slip__cols { margin-top: 8px; gap: 10px; }
  .slip__tbl td { padding: 2px 7px; }
  .slip__net { margin-top: 8px; padding: 7px 12px; }
  .slip__mark { font-size: 5rem; }
}

/* Public salary slip page (opened from a WhatsApp link) */
.slip-page { background: #f5f7fb; margin: 0; }
.slip-page__main { max-width: 860px; margin: 0 auto; padding: 18px 14px 30px; }
@media print { .slip-page { background: #fff; } .slip-page__main { padding: 0; max-width: none; } }

.btn--wa { background: #e7f8ee; border-color: #a6e9c5; color: #05603a; }
.btn--wa:hover { background: #d1f3e0; border-color: #7ad9a4; }

/* A draft slip says so in words, not only with the watermark */
.slip__draftnote { margin: 0 0 8px; padding: 5px 10px; border-radius: 6px; background: #fff4e0; border: 1px solid #f5c26b; color: #8a4b00; font-size: .78rem; line-height: 1.35; }
.slip__draftnote span { display: block; font-size: .72rem; opacity: .85; }
@media print { .slip__draftnote { margin-bottom: 5px; padding: 3px 8px; font-size: 10px; } }

[hidden] { display: none !important; }

/* Employee self-service: check-in / check-out, plan, and the manager's daily view */
.me-big { min-height: 56px; padding: 14px 22px; font-size: 1.05rem; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
.me-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.me-times span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.me-times b { font-size: 1.25rem; }
.me-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.me-actions .me-big { flex: 1 1 220px; }
.punch__step { padding: 16px 0; border-top: 1px solid var(--line); }
.punch__step h3 { margin: 0 0 6px; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.punch__n { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: inline-grid; place-items: center; font-size: .9rem; }
.punch__msg { margin: 4px 0 10px; color: var(--muted); }
.punch__camera video, .punch__preview { width: 100%; max-width: 520px; border-radius: 14px; background: #101828; display: block; }
.punch__preview { height: auto; }
.punch__check { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 1.05rem; padding: 10px 0; }
.punch__check input { width: 24px; height: 24px; }
.punch .actions .me-big, .me-actions .me-big { text-decoration: none; }
.day__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 10px; align-items: center; }
.day__flags { display: flex; flex-wrap: wrap; gap: 6px; }
.day__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.day__col { border-left: 3px solid #eef1f5; padding-left: 12px; min-width: 0; overflow-wrap: anywhere; }
.day__col h4 { margin: 0 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.thumb { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: #fff; cursor: pointer; overflow: hidden; margin-top: 6px; }
.thumb img { display: block; width: 120px; height: auto; }
.modal--photo { width: min(720px, calc(100vw - 24px)); }
@media screen and (max-width: 800px) { .day__cols { grid-template-columns: 1fr; } .me-times { grid-template-columns: 1fr; } }

/* ---- notification bell and live status ---- */
.live-status { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.live-status.is-bad { color: #b3261e; font-weight: 600; }
.bell { position: relative; }
.bell__btn { position: relative; padding: 6px 12px; }
.bell__count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.bell__count[hidden], .bell__panel[hidden] { display: none; }
.bell__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(380px, 92vw); max-height: 72vh; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(20, 40, 60, .18); }
.bell__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell__list { overflow-y: auto; }
.bell__item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.bell__item:hover { background: #f3f6f9; }
.bell__item strong { display: block; font-weight: 600; }
.bell__item span { display: block; color: var(--muted); font-size: .88rem; }
.bell__item em { display: block; color: var(--muted); font-size: .76rem; font-style: normal; margin-top: 2px; }
.bell__item.is-unread { background: var(--brand-soft); border-left: 4px solid var(--green); }
.bell__item.is-unread strong { font-weight: 700; }
.bell__foot { padding: 10px 14px; text-align: center; }
.place { margin: 4px 0 2px; font-weight: 600; line-height: 1.35; }

/* ---- compact check-in / check-out page ---- */
.punch--compact { max-width: 560px; padding: 10px 16px 16px; }
.punch__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.punch__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.punch__body .punch__msg { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.punch__dot { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; background: #cfd8e0; }
.punch__dot.is-ok { background: #12a150; }
.punch__dot.is-warn { background: #e8a317; }
.punch__dot.is-bad { background: #d92d20; }
.punch__dot.is-wait { background: #98a2b3; animation: punchPulse 1s ease-in-out infinite; }
@keyframes punchPulse { 50% { opacity: .35; } }
.punch__thumb { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.punch__thumb[hidden] { display: none; }
.punch__send { display: flex; gap: 10px; margin-top: 14px; }
.punch__send .me-big { flex: 1 1 auto; }
.punch--compact .punch__error { margin: 12px 0 0; }
/* ---- show / hide password ---- */
.pw { position: relative; display: block; }
.pw__input { padding-right: 46px; }
.pw__eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.pw__eye:hover, .pw__eye:focus-visible { color: var(--ink); background: #eef3f7; outline: none; }
.receipt-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.receipt-field__btn { cursor: pointer; }

/* ---- phone notifications card ---- */
.push-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.push-card[hidden] { display: none; }
.push-card__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 240px; }

/* ---- compact live filters ---- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 12px 16px; }
.filters__field { display: flex; flex-direction: column; flex: 0 1 190px; min-width: 150px; }
.filters__field--grow { flex: 1 1 220px; }
.filters label, .filters__field label { font-size: .74rem; font-weight: 600; color: var(--muted); margin: 0 0 3px; }
.filters input[type="search"], .filters input[type="text"], .filters input[type="date"], .filters select { padding: 7px 10px; font-size: .92rem; border-radius: 9px; min-height: 36px; }
.filters__check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .88rem; color: var(--ink); padding-bottom: 6px; white-space: nowrap; }
.filters__check input { width: 16px; height: 16px; }
.filters__clear { margin-bottom: 1px; }
.filters--daily .filters__bar { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters--daily .filters__date { margin-left: 4px; }
.filters--daily .filters__chips { flex: 1 0 100%; margin-top: 2px; }
.filters.live-ready .filters__submit { display: none; }
.filters.is-loading { opacity: .92; }
[data-live-results].is-loading { opacity: .55; transition: opacity .15s; pointer-events: none; }
/* ---- report page: filters on the left, downloads on the right ---- */
.report-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; padding: 12px 16px; }
.report-top .filters--bare { flex: 1 1 420px; padding: 0; border: 0; box-shadow: none; background: transparent; margin: 0; }
.report-top__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; padding-bottom: 1px; }
.report-top__actions form { margin: 0; display: inline; }
.report-top__result { flex: 1 0 100%; border-top: 1px solid var(--line); padding-top: 10px; }
.report-top__line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 8px; }
.report-top__preview { display: block; max-width: 340px; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }

/* Distributor stock / market booking entry (sales team): one compact line per product */
.fe-tools { display: flex; gap: 12px; align-items: center; margin: 4px 0 8px; }
.fe-tools input[type=search] { flex: 1; font-size: 1rem; padding: 10px 12px; }
.fe-tools__count { white-space: nowrap; color: var(--muted); font-size: .9rem; }
.fe-head, .fe-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px 92px; gap: 8px; align-items: center; }
.fe-head { padding: 6px 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 2px solid var(--line); }
.fe-head span:first-child { text-align: left; }
.fe-list { border: 1px solid var(--line); border-radius: 10px; }
.fe-row { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.fe-row:last-child { border-bottom: 0; }
.fe-row[hidden] { display: none; }
.fe-row.is-on { background: var(--brand-soft); }
.fe-row.is-invalid { background: #fdeceb; }
.fe-row__name { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.fe-row__name strong { overflow-wrap: anywhere; }
.fe-row__sum { font-size: .85rem; color: var(--brand-dark); }
.fe-row__on { display: flex; justify-content: center; margin: 0; padding: 8px 0; cursor: pointer; }
.fe-row__on input { width: 26px; height: 26px; margin: 0; }
.fe-row input[type=text] { width: 100%; font-size: 1.05rem; padding: 9px 8px; text-align: right; margin: 0; }
.fe-row input[type=text]:disabled { background: #f3f5f7; opacity: .55; }
.fe-row__error { grid-column: 1 / -1; margin: 0; }
.fe-total__geo { flex: 1 1 100%; font-size: .8rem; color: #FFE9B8; text-decoration: underline; }
.fe-total__geo[hidden] { display: none; }
.fe-total { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin: 14px 0 6px; border-radius: 12px; background: var(--brand-dark); color: #fff; font-size: 1.05rem; z-index: 3; }
@media (max-width: 520px) { .fe-head, .fe-row { grid-template-columns: minmax(0, 1fr) 76px 76px; gap: 6px; } .fe-row input[type=text] { padding: 9px 6px; } }
.fe-list .fe-row.fe--rate, .fe-head.fe--rate { grid-template-columns: minmax(0, 1fr) 84px 84px 104px; }
@media (max-width: 520px) { .fe-list .fe-row.fe--rate, .fe-head.fe--rate { grid-template-columns: minmax(0, 1fr) 62px 62px 82px; } }
.fe-geo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.fe-geo__dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa7b2; flex: none; }
.fe-geo__dot.is-ok { background: #1f9d6b; } .fe-geo__dot.is-warn { background: #d99a1d; } .fe-geo__dot.is-bad { background: #c0392b; } .fe-geo__dot.is-wait { background: #3b82c4; }
.fe-geo__msg { flex: 1 1 200px; font-size: .92rem; }

/* ===== Android-style phone interface (phones only, up to 800px wide; the desktop layout is untouched) ===== */
:root { --bn-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); }
.bottomnav { display: none; }

@media screen and (max-width: 800px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { background: #f2f5f9; font-size: 16px; }
  .content { min-height: 100vh; min-height: 100dvh; }
  .content:has(.bottomnav) { padding-bottom: calc(var(--bn-h) + var(--safe-b)); --bn: calc(var(--bn-h) + var(--safe-b)); }
  .content:has(.bottomnav) .menu-toggle { display: none; }
  .content:has(.bottomnav--emp) .menu-toggle { display: inline-block; }      /* staff on the phone: the burger (all pages) sits in the top bar, the daily tabs stay below */
  .content:has(.bottomnav) .footer { display: none; }

  /* App bar */
  .topbar { position: sticky; top: 0; z-index: 20; min-height: 56px; padding: calc(8px + var(--safe-t)) 12px 8px 16px; gap: 8px; color: #fff; border: 0; background: linear-gradient(180deg, var(--brand), var(--brand-dark)); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 2px 8px rgba(10, 61, 45, .35); }
  .topbar h1 { color: #fff; font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar .btn { min-height: 40px; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .32); color: #fff; box-shadow: none; padding: 8px 14px; }
  .topbar .btn--primary { background: #fff; border-color: #fff; color: var(--brand-dark); }
  .topbar .btn:hover { background: rgba(255, 255, 255, .26); }
  .topbar .live-status { display: none; }
  .topbar .bell__btn { min-width: 44px; min-height: 40px; padding: 6px 10px; }
  .topbar .bell__btn span[aria-hidden] { font-size: 1.15rem; }
  .bell__panel { position: fixed; left: 8px; right: 8px; top: calc(60px + var(--safe-t)); width: auto; max-height: 75vh; color: var(--ink); border-radius: 18px; }
  .support-banner { padding: 8px 14px; font-size: .88rem; }

  /* Page and cards */
  .page { padding: 14px 12px 20px; }
  .card { border-radius: 18px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
  .card.table-wrap { padding: 14px; }
  .card > h2:first-child { font-size: 1.02rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .stat { padding: 14px 14px 14px 16px; border-radius: 16px; }
  .stat b { font-size: 1.3rem; overflow-wrap: anywhere; }
  .stat:hover { transform: none; box-shadow: var(--shadow); }
  .hero { border-radius: 20px; padding: 18px; margin-bottom: 14px; }
  .hero h2 { font-size: 1.25rem; }
  .section-title { margin: 14px 4px 8px; }
  .kv { padding: 11px 0; }

  /* Bottom navigation */
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; height: calc(var(--bn-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(16, 24, 40, .08); }
  .bottomnav__item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; padding: 6px 2px 4px; color: #667085; text-decoration: none; font: inherit; cursor: pointer; }
  .bottomnav__icon { display: grid; place-items: center; width: 58px; height: 30px; border-radius: 15px; transition: background-color .18s; }
  .bottomnav__icon svg { width: 24px; height: 24px; fill: currentColor; }
  .bottomnav__label { font-size: .72rem; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bottomnav__item.is-active { color: var(--brand-dark); }
  .bottomnav__item.is-active .bottomnav__icon { background: var(--brand-soft2); }
  .bottomnav__item:active .bottomnav__icon { background: #e6f2ec; }

  /* Side menu as a drawer with a dimmed background */
  .side { width: min(320px, 86vw); left: calc(-1 * min(340px, 90vw)); z-index: 40; height: 100vh; height: 100dvh; padding-top: calc(18px + var(--safe-t)); padding-bottom: calc(16px + var(--safe-b)); transition: left .22s ease; }
  .side.is-open + .content::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(16, 24, 40, .5); }
  .side nav a { min-height: 48px; display: flex; align-items: center; padding: 10px 16px; font-size: 1rem; }
  .side nav a:active { background: rgba(255, 255, 255, .14); }

  /* Forms: big, easy targets (16px text also stops phones from zooming in) */
  label { font-size: .92rem; margin: 16px 0 6px; }
  input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=month], input[type=time], input[type=number], input[type=tel], select, textarea { min-height: 48px; padding: 12px 14px; font-size: 16px; border-radius: 12px; }
  input[type=date], input[type=month], input[type=time] { -webkit-appearance: none; appearance: none; box-sizing: border-box; min-width: 0; max-width: 100%; text-align: left; }      /* iPhone Safari draws a date box wider than its card unless told otherwise */
  textarea { min-height: 96px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .grid2 { gap: 0; }
  .actions { gap: 10px; margin-top: 18px; }
  .actions .btn, .actions button { flex: 1 1 140px; }
  .btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; text-align: center; border-radius: 12px; padding: 10px 18px; }
  .btn--sm { min-height: 40px; padding: 8px 14px; }
  .btn:active { filter: brightness(.94); transform: none; }
  .me-big { min-height: 58px; border-radius: 16px; }
  .filters { gap: 10px; }
  .filters__field { flex: 1 1 140px; min-width: 0; }
  .filters .btn { flex: 1 1 100px; }
  .datebar { gap: 8px; }
  .datebar input[type=date], .datebar input[type=month] { flex: 1 1 150px; width: auto; }
  .savebar { bottom: var(--bn, 0px); margin: 16px -12px -20px; padding: 12px; text-align: center; }
  .savebar .btn { width: 100%; }
  .fe-total { bottom: calc(var(--bn, 0px) + 8px); border-radius: 14px; }

  /* Tabs: one swipeable row, like Android tabs */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 0 0 auto; white-space: nowrap; min-height: 42px; display: inline-flex; align-items: center; padding: 8px 16px; scroll-snap-align: start; }
  .chips { gap: 6px; }

  /* Tables turn into one card per row (labels are added by ems.js); wide grids and reports keep sideways scrolling */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table.table[data-stack] { display: block; width: 100%; }
  table.table[data-stack] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  table.table[data-stack] tbody, table.table[data-stack] tfoot { display: block; }
  table.table[data-stack] tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; margin: 0 0 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
  table.table[data-stack] tbody tr:hover { background: #fff; }
  table.table[data-stack] td, table.table[data-stack] th { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; width: auto; padding: 9px 0; border: 0; border-bottom: 1px dashed #e8ecf1; background: none; text-align: right !important; border-radius: 0; }
  table.table[data-stack] td:last-child, table.table[data-stack] th:last-child { border-bottom: 0; }
  table.table[data-stack] td::before { content: attr(data-label); flex: 0 0 38%; max-width: 42%; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 3px; }
  table.table[data-stack] td[data-label=""]::before, table.table[data-stack] td:not([data-label])::before { display: none; }
  table.table[data-stack] td[data-label=""] { justify-content: flex-end; }
  table.table[data-stack] td:empty { display: none; }
  table.table[data-stack] td[colspan] { display: block; text-align: left !important; }
  table.table[data-stack] td.muted[colspan] { padding: 14px 0; }
  table.table[data-stack] .btn { min-height: 40px; }

  /* Pagination */
  .pager { justify-content: center; }
  .pager__item { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 6px 12px; }

  /* Dialogs slide up from the bottom like a sheet */
  .modal { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; max-height: 92dvh; }
  .modal__body { max-height: calc(92dvh - 70px); padding-bottom: calc(20px + var(--safe-b)); }

  /* Sign-in and other full-screen cards */
  .guest__main { padding: 16px 12px; }
  .guest__card { padding: 26px 20px; border-radius: 22px; }
  .alert { border-radius: 14px; padding: 12px 14px; }
  .footer { padding: 14px 10px; }
}

@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .bottomnav__icon { width: 50px; }
  .topbar h1 { font-size: 1.08rem; }
}

/* Installed app (standalone window) */
@media (display-mode: standalone) and (max-width: 800px) {
  body { overscroll-behavior-y: contain; user-select: none; -webkit-user-select: none; }
  input, textarea, .secret, td, .kv b { user-select: text; -webkit-user-select: text; }
}

/* Phone navigation icons: drawn with CSS masks (no inline pictures in the pages) */
.bottomnav__icon::before { content: ""; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--bn-icon) center / contain no-repeat; mask: var(--bn-icon) center / contain no-repeat; }
.bn-attendance { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.53 11.06 15.47 10l-4.88 4.88-2.12-2.12-1.06 1.06L10.59 17l5.94-5.94zM19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11z'/%3E%3C/svg%3E"); }
.bn-calendar { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z'/%3E%3C/svg%3E"); }
.bn-chart { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 9.2h3V19H5V9.2zM10.6 5h2.8v14h-2.8V5zm5.6 8H19v6h-2.8v-6z'/%3E%3C/svg%3E"); }
.bn-home { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E"); }
.bn-menu { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z'/%3E%3C/svg%3E"); }
.bn-people { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E"); }
.bn-request { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3E%3C/svg%3E"); }
.bn-slip { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z'/%3E%3C/svg%3E"); }
.bn-store { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4v2h16V4zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6h1zm-9 4H6v-4h6v4z'/%3E%3C/svg%3E"); }
.bn-bank { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 22h19v-3H2v3zm14-12v7h3v-7h-3zm-4.5-9L2 6v2h19V6l-9.5-5z'/%3E%3C/svg%3E"); }
.bn-wallet { --bn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 14V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-9-1c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm13-6v11c0 1.1-.9 2-2 2H4v-2h17V7h2z'/%3E%3C/svg%3E"); }
@media screen and (max-width: 800px) { .td-v { min-width: 0; overflow-wrap: anywhere; } table.table[data-stack] td[data-label=""] .td-v { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; } }
@media screen and (max-width: 800px) { a.chip, .chip { min-height: 38px; display: inline-flex; align-items: center; padding: 6px 14px; } .dept-filter { margin: 0 0 10px; align-items: center; } .dept-filter a.chip { text-decoration: none; } }
@media screen and (max-width: 800px) { .me-times { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .me-times > div { background: #f5f8fa; border-radius: 12px; padding: 10px 8px; text-align: center; } .me-times span { display: block; font-size: .72rem; } .me-times b { font-size: 1.02rem; overflow-wrap: anywhere; } }
@media screen and (max-width: 800px) { .card.table-wrap:has(table[data-stack]) { background: transparent; border: 0; box-shadow: none; padding: 0; } .card.table-wrap:has(table[data-stack]) > h2:first-child { border: 0; padding: 4px 4px 0; } .card.table-wrap:has(table[data-stack]) > .help { padding: 0 4px; } }
@media screen and (max-width: 800px) { .fe-row input[type=text] { min-height: 44px; padding: 8px 6px; font-size: 16px; } .fe-tools input[type=search] { min-height: 46px; } }
@media (max-width: 560px) { .fe-list .fe-row.fe--rate, .fe-head.fe--rate { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) !important; gap: 6px; } .fe-list .fe-row, .fe-head { gap: 6px; } }
@media screen and (max-width: 800px) { body.is-typing .bottomnav { display: none; } body.is-typing .content:has(.bottomnav) { padding-bottom: 0; --bn: 0px; } }
.visit-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.visit-card .chips { margin-top: 10px; }
.chip { gap: 4px; }

/* Desktop only: the page uses the whole width next to the side menu (phones keep their own layout above) */
@media (min-width: 801px) { .page { max-width: none; width: 100%; } }

/* Company colour picker (settings) */
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch.is-on { box-shadow: 0 0 0 3px #101828; }
.brand-preview { margin: 14px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); max-width: 420px; }
.brand-preview__bar { background: var(--pv); color: #fff; padding: 12px 16px; font-weight: 700; }
.brand-preview__body { padding: 12px 16px; display: flex; gap: 10px; align-items: center; }
.brand-preview__btn { background: var(--pv); color: #fff; border-radius: 10px; padding: 8px 18px; font-weight: 600; }
.brand-preview__tab { border: 2px solid var(--pv); color: var(--pv); border-radius: 10px; padding: 6px 14px; font-weight: 600; }
.product-logo { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; padding: 8px; background: #fff; }

.nuvobrix-link{color:inherit;text-decoration:underline;text-underline-offset:2px}
.nuvobrix-link:hover{color:var(--brand)}

/* sign-in screens: the product logo at its full size, in its own shape */
.brand__logo--full{display:block;max-width:64%;max-height:62px;width:auto;height:auto;margin:0 auto}
.product-logo--wide{width:auto;max-width:240px;height:auto;max-height:120px}

/* sign-in screens: split layout with a brand panel (wide screens), the card alone on phones */
.guest__panel { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.guest__hero { display: none; }
.guest__card { transition: box-shadow .2s ease; }
.guest__card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.guest__card .btn--primary { background: linear-gradient(135deg, var(--brand-light), var(--brand-dark)); box-shadow: 0 8px 18px -8px var(--brand-dark); transition: transform .15s ease, box-shadow .15s ease; }
.guest__card .btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -8px var(--brand-dark); }
@media (min-width: 960px) {
  .guest { background: #f3f6f9; }
  .guest__main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 0; align-items: stretch; }
  .guest__hero { display: flex; position: relative; overflow: hidden; align-items: center; padding: 64px 7%; color: #fff;
    background: radial-gradient(700px 420px at 10% 0%, var(--brand-light) 0%, transparent 62%), radial-gradient(600px 500px at 100% 100%, var(--guest1) 0%, transparent 65%), var(--guest2); }
  .guest__hero::before, .guest__hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
  .guest__hero::before { width: 420px; height: 420px; right: -140px; top: -120px; background: color-mix(in srgb, var(--brand-accent) 16%, transparent); filter: blur(10px); }
  .guest__hero::after { width: 300px; height: 300px; left: -90px; bottom: -110px; border: 2px solid rgba(255, 255, 255, .12); }
  .guest__hero-inner { position: relative; z-index: 1; max-width: 520px; }
  .guest__pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; letter-spacing: .02em; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); }
  .guest__hero h2 { margin: 18px 0 12px; font-size: 2.35rem; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
  .guest__hero p { margin: 0 0 26px; font-size: 1.05rem; line-height: 1.55; color: rgba(255, 255, 255, .8); }
  .guest__feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .guest__feats li { padding: 14px 16px 14px 18px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-left: 4px solid var(--brand-accent); backdrop-filter: blur(4px); }
  .guest__feats b { display: block; font-size: 1rem; }
  .guest__feats span { display: block; margin-top: 2px; font-size: .9rem; color: rgba(255, 255, 255, .72); }
  .guest__panel { align-items: center; padding: 40px 32px; }
  .guest__card { max-width: 440px; padding: 40px 38px; border: 1px solid #e6ebf0; box-shadow: 0 30px 60px -30px rgba(15, 40, 35, .35); }
  .guest { position: relative; }
  .guest .footer { position: absolute; right: 0; bottom: 0; width: 46.5%; color: var(--muted); }
}
@media screen and (max-width: 959px) { .guest__panel { padding: 0; } }@media screen and (max-width: 959px) { .brand__logo--full { max-width: 58%; max-height: 50px; } }

/* "Book a demo" for companies: in the brand panel on wide screens, a small line under the card on phones */
.guest__demo-m { display: block; margin: 16px 0 0; text-align: center; font-size: .92rem; color: rgba(255, 255, 255, .85); }
.guest__demo-m a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.guest__demo { display: none; }
@media (min-width: 960px) {
  .guest__panel { flex-direction: column; align-items: center; justify-content: center; }
  .guest__panel .guest__card { width: 100%; }
  .guest__demo-m { display: none; }
  .guest__demo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .25); }
  .guest__demo b { display: block; font-size: 1.02rem; }
  .guest__demo span { display: block; margin-top: 2px; font-size: .88rem; color: rgba(255, 255, 255, .75); }
  .guest__demo a { padding: 10px 20px; border-radius: 999px; font-weight: 700; color: var(--guest2); background: #fff; text-decoration: none; white-space: nowrap; transition: transform .15s ease; }
  .guest__demo a:hover { transform: translateY(-1px); }
}@media screen and (max-width: 959px) { .guest__panel .guest__card { width: 100%; } }

/* plan banner for company users: trial ending, payment overdue, read-only */
.sub-banner{padding:10px 16px;font-size:.92rem;font-weight:600;background:var(--amber-bg);color:var(--amber);border-bottom:1px solid color-mix(in srgb,var(--amber) 25%,transparent)}
.sub-banner--expired{background:var(--err-bg);color:var(--red)}

/* rate versions (MRP): the same product in the market at several MRPs, one row each in the stock / booking / order forms */
.fe-mrp { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: .86rem; font-weight: 800; letter-spacing: .01em; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid var(--brand-soft2); vertical-align: 1px; white-space: nowrap; }
.gp-box { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.gp-fields { display: none; margin-top: 10px; }
.gp-toggle:checked ~ .gp-fields { display: block; }
.fe-row--same { margin-top: -1px; border-top-style: dashed; background: color-mix(in srgb, var(--brand-soft) 35%, #fff); }
@media screen and (max-width: 800px) {
  .fe-mrp { display: inline-block; margin: 2px 0 2px 6px; font-size: .95rem; padding: 3px 12px; }
  .gp-box { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.gp-fields { display: none; margin-top: 10px; }
.gp-toggle:checked ~ .gp-fields { display: block; }
.fe-row--same { border-left: 4px solid var(--brand); }
}
/* one block per product; several MRPs = a rate drop-down under the name, the CTN / PCS boxes belong to the chosen rate */
.fe-product { border-bottom: 1px solid var(--line); }
.fe-product:last-child { border-bottom: 0; }
.fe-product .fe-row { border-bottom: 0; }
.fe-product--multi { padding: 8px 0 2px; }
.fe-product--multi .fe-product__head { padding: 0 8px; display: flex; flex-direction: column; gap: 6px; }
.fe-product--multi .fe-product__head strong { overflow-wrap: anywhere; }
.fe-version { width: 100%; margin: 0; padding: 10px 12px; font-size: 1.02rem; font-weight: 700; color: var(--brand-dark); background-color: var(--brand-soft); border: 2px solid var(--brand); border-radius: 12px; min-height: 46px; }
.fe-version.is-on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.fe-others { font-size: .88rem; font-weight: 600; color: var(--brand-dark); background: var(--brand-soft); border-radius: 8px; padding: 4px 10px; }
.fe-product--multi .fe-row { padding-top: 4px; }
/* Distributor rate list (printed or saved as PDF from the browser) */
.ratelist { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; overflow-x: auto; }
.ratelist__head { text-align: center; margin-bottom: 10px; }
.ratelist__head h2 { margin: 0 0 2px; font-size: 1.4rem; }
.ratelist__sub { font-weight: 600; }
.ratelist__meta { font-size: .85rem; color: var(--muted); }
.ratelist__table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ratelist__table th, .ratelist__table td { border: 1px solid #333; padding: 3px 6px; text-align: center; }
.ratelist__table th { background: #f1f3f5; font-weight: 700; }
.ratelist__table .l { text-align: left; }
.ratelist__cat td { background: #e8eef2; font-weight: 700; text-align: center; letter-spacing: .03em; }
.ratelist__foot { margin-top: 8px; font-size: .8rem; color: var(--muted); text-align: right; }
@media print {
  .ratelist { border: 0; padding: 0; margin: 0; border-radius: 0; page-break-after: always; break-after: page; overflow: visible; }
  .ratelist:last-of-type { page-break-after: auto; break-after: auto; }
  .ratelist__table { font-size: 9.5px; }
  .ratelist__table th, .ratelist__table td { padding: 2px 4px; }
  .ratelist__table tr { break-inside: avoid; }
  .ratelist__table thead { display: table-header-group; }
}
/* ===== Grouped side menu: groups that open like an accordion, and a slim icon bar with hover flyouts (WordPress style) ===== */
.ico { flex: none; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chev { flex: none; width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; transition: transform .18s; }
.side nav .item, .side nav .group > button, .side nav .group__label { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin: 2px 0; border: 0; border-radius: 10px; background: none; color: var(--side-ink); font: inherit; font-weight: 550; font-size: .95rem; text-align: left; text-decoration: none; cursor: pointer; position: relative; white-space: nowrap; }
.side nav .item:hover, .side nav .group > button:hover, .side nav .group__label:hover, .side nav .group__toggle:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav .group > button:focus-visible, .side nav .group__label:focus-visible, .side nav .group__toggle:focus-visible, .side nav .sub a:focus-visible, .side__collapse:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.side .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side .group.is-open > button .chev, .side .group.is-open .group__toggle .chev { transform: rotate(90deg); }
/* a group with an overview page: the name (a link) and the arrow (a button) are two separate targets */
.side .group__head { display: flex; align-items: stretch; gap: 2px; margin: 2px 0; }
.side nav .group__label { flex: 1; min-width: 0; width: auto; margin: 0; }
.side nav .group__toggle { flex: none; width: 38px; margin: 0; padding: 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--side-ink); cursor: pointer; }
.side .group.has-active > button, .side .group.has-active .group__label { color: #fff; }
.side .group.has-active > button .ico, .side .group.has-active .group__label .ico { color: var(--brand-accent); }
.side .group.has-active > button::before, .side .group.has-active .group__label::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-accent); }
.side .sub { display: none; margin: 0 0 4px 21px; padding-left: 13px; border-left: 1px solid rgba(255, 255, 255, .12); }
.side .group.is-open .sub { display: block; }
.side nav .sub a { display: block; min-height: 0; padding: 7px 10px; margin: 1px 0; border-radius: 8px; font-size: .9rem; font-weight: 500; position: relative; }
.side nav .sub a.is-active { background: none; color: #fff; font-weight: 650; }
.side nav .sub a.is-active::before { left: -17px; top: 50%; bottom: auto; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--brand-accent); }
.side .fly, .side .tip { display: none; }
.side__collapse { display: none; }
@media (min-width: 801px) {
  .side:has([data-side-menu]) .side__collapse { display: flex; }
  .side:has([data-side-menu]) .side__collapse .ico { transition: transform .18s; }
  .side { transition: width .18s ease; }

  /* the slim icon bar */
  html.side-rail .side:has([data-side-menu]) { width: 68px; padding-left: 10px; padding-right: 10px; overflow: visible; z-index: 30; }
  html.side-rail .side:has([data-side-menu]) .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  html.side-rail .side:has([data-side-menu]) .brand__text, html.side-rail .side:has([data-side-menu]) .lbl, html.side-rail .side:has([data-side-menu]) .chev, html.side-rail .side:has([data-side-menu]) .group__toggle { display: none; }
  html.side-rail .side:has([data-side-menu]) .brand__logo { max-width: 44px; max-height: 40px; object-fit: contain; }
  html.side-rail .side:has([data-side-menu]) nav .item, html.side-rail .side:has([data-side-menu]) nav .group > button, html.side-rail .side:has([data-side-menu]) nav .group__label { justify-content: center; padding: 11px 0; }
  html.side-rail .side:has([data-side-menu]) .sub { display: none !important; }
  html.side-rail .side:has([data-side-menu]) .group, html.side-rail .side:has([data-side-menu]) nav .item { position: relative; }
  html.side-rail .side:has([data-side-menu]) nav .item.is-active::before, html.side-rail .side:has([data-side-menu]) .group.has-active > button::before, html.side-rail .side:has([data-side-menu]) .group.has-active .group__label::before { left: -10px; }
  html.side-rail .side:has([data-side-menu]) .fly { position: absolute; left: calc(100% + 12px); top: -6px; min-width: 210px; padding: 8px; border-radius: 12px; background: #0f2f26; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); z-index: 50; }
  html.side-rail .side:has([data-side-menu]) .fly::before { content: ""; position: absolute; left: -16px; top: 0; bottom: 0; width: 16px; }
  html.side-rail .side:has([data-side-menu]) .fly h3 { margin: 0; padding: 6px 10px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-accent); }
  html.side-rail .side:has([data-side-menu]) nav .fly a { display: block; min-height: 0; margin: 1px 0; padding: 8px 10px; border-radius: 8px; font-size: .9rem; font-weight: 500; white-space: nowrap; }
  html.side-rail .side:has([data-side-menu]) nav .fly a:hover, html.side-rail .side:has([data-side-menu]) nav .fly a:focus-visible { background: rgba(255, 255, 255, .08); color: #fff; outline: none; }
  html.side-rail .side:has([data-side-menu]) nav .fly a.is-active { background: rgba(61, 220, 154, .14); color: #fff; font-weight: 650; }
  html.side-rail .side:has([data-side-menu]) nav .fly a.is-active::before { display: none; }
  html.side-rail .side:has([data-side-menu]) .group:hover .fly, html.side-rail .side:has([data-side-menu]) .group:focus-within .fly { display: block; }
  html.side-rail .side:has([data-side-menu]) .tip { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: #0f2f26; border: 1px solid rgba(255, 255, 255, .1); color: #fff; font-size: .85rem; white-space: nowrap; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); pointer-events: none; z-index: 50; }
  html.side-rail .side:has([data-side-menu]) nav .item:hover .tip { display: block; }
  /* the person: only the initial; the details open beside it on hover */
  html.side-rail .side:has([data-side-menu]) .side__collapse span { display: none; }
  html.side-rail .side:has([data-side-menu]) .side__collapse .ico { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) { .side, .chev, .side__collapse .ico { transition: none !important; } }
/* ===== UI polish (2026-10-16): one consistent, calmer look on every screen. Presentation only. ===== */
:root { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); --mag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
/* drop-downs and search boxes look the same in every browser */
select:not([multiple]) { -webkit-appearance: none; appearance: none; background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 36px; text-overflow: ellipsis; }
input[type=search] { background-image: var(--mag); background-repeat: no-repeat; background-position: 12px center; background-size: 16px; padding-left: 38px; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
/* numbers that are links (dashboard tiles) are tiles, not underlined text */
a.stat { display: block; text-decoration: none; color: inherit; }
a.stat b { color: var(--brand-dark); }
a.stat span { text-decoration: none; }
a.stat:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.table { font-variant-numeric: tabular-nums; }
.table td a:not(.btn) { font-weight: 600; }
.help, .muted { line-height: 1.45; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
* { scrollbar-width: thin; scrollbar-color: #c4ccd6 transparent; }

@media (min-width: 801px) {
  body { font-size: 15px; line-height: 1.5; }
  h1 { font-size: 1.35rem; }
  /* page header: the title never gets squeezed by buttons; long button rows wrap under it */
  .topbar { padding: 12px 28px; min-height: 66px; flex-wrap: wrap; row-gap: 8px; }
  .topbar h1 { flex: 1 1 auto; min-width: 0; font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .btn { white-space: nowrap; padding: 8px 14px; font-size: .88rem; }
  .page { padding: 22px 28px 40px; }
  .card { padding: 20px 22px; margin-bottom: 16px; }
  .card.table-wrap { padding: 16px 18px; }
  .card > h2:first-child { font-size: 1rem; padding-bottom: 10px; margin-bottom: 12px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
  .stat { padding: 16px 18px 16px 20px; }
  .stat b { font-size: 1.55rem; }
  .section-title { margin: 8px 2px 10px; }
  /* buttons: one height family */
  .btn { padding: 8px 16px; font-size: .9rem; line-height: 1.3; }
  .btn--sm { padding: 5px 11px; font-size: .84rem; }
  .actions { margin-top: 20px; gap: 8px; }
  /* tables: calmer, denser, easier to scan */
  .table { font-size: .9rem; }
  .table th { padding: 10px 14px; font-size: .72rem; }
  .table td { padding: 11px 14px; }
  .table tbody tr:hover { background: #f7faf9; }
  /* forms: fields do not stretch across a very wide card */
  form.card > :is(input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=month], input[type=time], input[type=tel], select, textarea) { max-width: 560px; }
  label { font-size: .85rem; }
  input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=month], input[type=time], input[type=number], input[type=tel], select, textarea { padding: 9px 12px; font-size: .94rem; }
  /* filters: a tidy toolbar */
  .filters { gap: 8px 12px; padding: 12px 16px; align-items: flex-end; }
  .filters label, .filters__field label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); }
  .filters input[type="search"], .filters input[type="text"], .filters input[type="date"], .filters select { min-height: 38px; padding: 7px 11px; }
  .filters input[type="search"] { padding-left: 36px; }
  .tabs { margin-bottom: 16px; }
  .tabs a { padding: 7px 16px; font-size: .9rem; }
  .kv { padding: 9px 0; }
  .footer { padding: 16px 12px 22px; }
  .modal__head { padding: 14px 22px; }
}
@media (min-width: 1500px) { .page { padding-left: 36px; padding-right: 36px; } .topbar { padding-left: 36px; padding-right: 36px; } }

/* ----- phones: a little smaller text so screens are more compact; typed text stays 16px (no zoom on iPhone); touch targets stay 44px ----- */
@media screen and (max-width: 800px) {
  body { font-size: 15px; line-height: 1.45; }
  .topbar h1 { font-size: 1.08rem; }
  .page { padding: 12px 10px 18px; }
  .card { padding: 14px; margin-bottom: 12px; }
  .card > h2:first-child { font-size: .98rem; margin-bottom: 10px; padding-bottom: 8px; }
  h2 { font-size: 1rem; }
  label { font-size: .84rem; margin: 12px 0 5px; }
  input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=month], input[type=time], input[type=number], input[type=tel], select, textarea { min-height: 44px; padding: 9px 12px; font-size: 16px; }
  input[type=search] { padding-left: 38px; }
  .btn { min-height: 44px; font-size: .92rem; padding: 9px 16px; }
  .btn--sm { min-height: 38px; font-size: .84rem; padding: 7px 12px; }
  .me-big { min-height: 54px; font-size: 1rem; }
  .stat { padding: 12px 12px 12px 14px; }
  .stat b { font-size: 1.2rem; }
  .stat span { font-size: .8rem; }
  .kv { padding: 9px 0; font-size: .92rem; }
  .help { font-size: .8rem; }
  .small { font-size: .84rem; }
  .badge { font-size: .74rem; padding: 2px 9px; }
  .chip { font-size: .84rem; }
  .side nav .item, .side nav .group > button, .side nav .group__label { font-size: .95rem; }
  .side nav .sub a { font-size: .9rem; }
  .bottomnav__label { font-size: .68rem; }
  table.table[data-stack] td { font-size: .9rem; padding: 8px 0; }
  table.table[data-stack] td::before { font-size: .68rem; }
  table.table[data-stack] tr { padding: 3px 12px; margin-bottom: 8px; }
  .section-title { font-size: .72rem; }
  /* distributor stock, market booking, shop booking, manual order, return and claim forms */
  .fe-tools { gap: 8px; margin: 2px 0 6px; }
  .fe-tools input[type=search] { min-height: 42px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; }
  .fe-tools__count { font-size: .78rem; }
  .fe-head { font-size: .66rem; padding: 5px 6px; }
  .fe-row { padding: 6px 6px; gap: 6px; }
  .fe-row__name { line-height: 1.2; }
  .fe-row__name strong { font-size: .92rem; font-weight: 650; }
  .fe-row__name .muted, .fe-row__name .small { font-size: .76rem; }
  .fe-row__sum { font-size: .76rem; }
  .fe-mrp { font-size: .78rem; padding: 2px 9px; margin: 1px 0 1px 4px; }
  .fe-row input[type=text] { min-height: 42px; padding: 6px 6px; font-size: 16px; }
  .fe-version { min-height: 42px; padding: 8px 10px; font-size: 16px; font-weight: 650; }
  .fe-others { font-size: .76rem; padding: 3px 8px; }
  .fe-product--multi { padding-top: 6px; }
  .fe-total { font-size: .92rem; padding: 10px 12px; margin: 10px 0 4px; border-radius: 12px; }
  .fe-geo { padding: 8px 10px; }
  .fe-geo__msg { font-size: .84rem; }
  .punch__body .punch__msg { font-size: .82rem; }
}@media (min-width: 801px) {
  .table td:first-child { min-width: 150px; }
  .table .btn { white-space: nowrap; }
}.fe-tools input[type=search], .filters input[type=search], .allow-list input[type=search] { padding-left: 38px; }
@media screen and (max-width: 800px) {
  .fe-version { border-width: 1.5px; font-weight: 600; }
  .fe-tools input[type=search] { padding-left: 38px; }
}
/* ===== tables fit the screen: no sideways scrolling on normal screens (also when the browser is zoomed) ===== */
/* long words (e-mail addresses) may break, but short words, dates and badges never do */
.table td, .table th { overflow-wrap: break-word; }
.table td:has(.badge, .btn, a[href^="mailto:"]) { overflow-wrap: anywhere; }
.table .badge, .chip { white-space: nowrap; overflow-wrap: normal; }
.table th { overflow-wrap: normal; hyphens: none; }
@media (min-width: 801px) and (max-width: 1500px) {
  .side { width: 236px; }
  .page { padding: 20px 20px 32px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .card { padding: 18px 18px; }
  .card.table-wrap { padding: 14px 14px; }
  .table th { padding: 9px 8px; font-size: .68rem; letter-spacing: .04em; }
  .table td { padding: 10px 8px; font-size: .88rem; }
  .table td:first-child { min-width: 0; }
  .table .btn { padding: 4px 9px; font-size: .8rem; }
  .table .badge { font-size: .72rem; padding: 2px 8px; }
}
/* the monthly attendance grid shrinks its day cells to fit the width instead of scrolling */
.grid-wrap { overflow-x: visible; }
.mgrid { width: 100%; min-width: 0; table-layout: fixed; font-size: .7rem; }
.mgrid thead th, .gcell { min-width: 0; }
.gcell { font-size: .68rem; height: 28px; }
.mgrid .mgrid__name { min-width: 0; width: 170px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; padding: 5px 8px; }
.mgrid .mgrid__sum { min-width: 0; width: 30px; padding: 5px 2px; }
.mgrid__day small { font-size: .56rem; }
@media screen and (max-width: 800px) {
  .grid-wrap { overflow-x: auto; }
  .mgrid { width: max-content; min-width: 100%; table-layout: auto; font-size: .82rem; }
  .mgrid thead th, .gcell { min-width: 31px; }
  .mgrid .mgrid__name { min-width: 150px; width: auto; max-width: 190px; }
  .mgrid .mgrid__sum { min-width: 34px; }
}@media (min-width: 801px) and (max-width: 1200px) {
  .side { width: 220px; }
  .page { padding: 16px 14px 28px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .card.table-wrap { padding: 12px 10px; }
  .table th { padding: 8px 5px; font-size: .64rem; letter-spacing: .02em; }
  .table td { padding: 8px 5px; font-size: .84rem; }
  .table .btn, .table .btn--sm { white-space: normal; padding: 3px 8px; line-height: 1.2; }
  .table .badge { padding: 2px 7px; }
  .table td:first-child { min-width: 0; }
}/* tables with many columns (allowance sheet, salary sheet...) get a tighter cell so they still fit without sideways scrolling */
@media (min-width: 801px) {
  .table:has(th:nth-child(10)) th { padding: 8px 4px; font-size: .6rem; letter-spacing: .01em; overflow-wrap: anywhere; }
  .table:has(th:nth-child(10)) td { padding: 8px 4px; font-size: .8rem; }
  .table:has(th:nth-child(10)) td:first-child, .table:has(th:nth-child(10)) th:first-child { padding-left: 8px; }
  .table:has(th:nth-child(10)) td:last-child, .table:has(th:nth-child(10)) th:last-child { padding-right: 8px; }
}
/* ===== reports on a phone: one card per row ===== */
.rcards { display: none; }
@media screen and (max-width: 800px) {
  table[data-report-cards][data-cards-built] { display: none; }
  .card.table-wrap:has(table[data-cards-built]) { background: transparent; border: 0; box-shadow: none; padding: 0; }
  .rcards { display: grid; gap: 10px; }
  .rcards__bar { display: flex; justify-content: flex-end; padding: 0 4px; }
  .rcards__toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .84rem; font-weight: 600; color: var(--ink); }
  .rcards__toggle input { width: 20px; height: 20px; }
  .rc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
  .rc__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .rc__name { font-weight: 700; font-size: .98rem; overflow-wrap: anywhere; }
  .rc__sub { color: var(--muted); font-size: .8rem; }
  .rc__key { text-align: right; flex: none; }
  .rc__key small { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
  .rc__key b { font-size: 1.12rem; color: var(--brand-dark); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
  .rc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .rc__f { min-width: 0; }
  .rc__f small { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; line-height: 1.25; }
  .rc__f span { display: block; font-size: .86rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .rc__f.is-empty span { color: var(--muted); font-weight: 400; }
  .rcards.is-hiding .rc:not(.is-open) .rc__f.is-empty { display: none; }
  .rc__more { margin-top: 8px; border: 0; background: none; color: var(--brand-dark); font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 0; min-height: 36px; cursor: pointer; }
  .rc--total { background: var(--brand-soft); border-color: var(--brand-soft2); }
  .rc--total .rc__name { color: var(--brand-dark); }
}
@media print { .rcards { display: none !important; } }
/* ===== Daily sales announcement: below the greeting on the sales dashboard ===== */
.announce { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 18px; padding: 16px 18px; border-radius: 16px; background: #fffaeb; border: 1px solid #fedf89; border-left: 5px solid #f79009; box-shadow: var(--shadow-sm); color: #6b3a07; }
.announce__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fef0c7; color: #b54708; display: grid; place-items: center; }
.announce__icon .ico { width: 22px; height: 22px; }
.announce__body { min-width: 0; }
.announce__body strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #93370d; }
.announce__body p { margin: 4px 0 0; font-size: 1.05rem; font-weight: 600; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; color: #4a2605; }
@media screen and (max-width: 800px) { .announce { padding: 12px 14px; gap: 10px; border-radius: 14px; margin-bottom: 12px; } .announce__icon { width: 34px; height: 34px; border-radius: 10px; } .announce__body p { font-size: .98rem; } }
@media print { .announce { display: none; } }
/* ===== Account menu in the top bar (replaces the profile box that used to sit at the bottom of the side menu) ===== */
.side__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side__foot .side__collapse { align-items: center; gap: 12px; width: 100%; margin: 0; padding: 8px 10px; border: 0; background: none; color: var(--side-ink); font: inherit; font-size: .85rem; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.side__foot .side__collapse:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.acct { position: relative; flex: none; }
.acct__btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.acct__btn:hover { border-color: #b8c0cc; background: #f9fafb; }
.acct__btn:focus-visible { outline: none; box-shadow: var(--ring); }
.acct__avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-light), var(--brand-deep)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.acct__btn .chev { stroke: var(--muted); opacity: 1; transition: transform .18s; }
.acct__btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.acct__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 270px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(20, 40, 60, .18); }
.acct__who { display: grid; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.acct__who strong { font-size: .98rem; overflow-wrap: anywhere; }
.acct__who span { color: var(--muted); font-size: .84rem; }
.acct__item { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; color: var(--ink); text-decoration: none; font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
.acct__item:hover, .acct__item:focus-visible { background: var(--brand-soft); color: var(--brand-dark); outline: none; }
.acct__out { margin: 6px 4px 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.acct__out .btn { width: 100%; justify-content: center; }
@media (min-width: 801px) and (max-width: 1000px) { .acct__name { display: none; } .acct__btn { padding-right: 6px; } }
@media screen and (max-width: 800px) {
  .side__foot { display: none; }
  .acct__btn { padding: 3px; gap: 0; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .32); min-height: 40px; min-width: 44px; justify-content: center; }
  .acct__btn:hover { background: rgba(255, 255, 255, .26); }
  .acct__name, .acct__btn .chev { display: none; }
  .acct__avatar { width: 34px; height: 34px; background: #fff; color: var(--brand-dark); }
  .acct__panel { position: fixed; left: 8px; right: 8px; top: calc(60px + var(--safe-t)); width: auto; border-radius: 18px; }
  .acct__item { min-height: 46px; display: flex; align-items: center; font-size: .98rem; }
}
@media print { .acct { display: none; } }
@media (min-width: 801px) { html.side-rail .side:has([data-side-menu]) .side__foot .side__collapse { justify-content: center; padding: 10px 0; } }
.acct__panel { color: var(--ink); }
.topbar .acct__out .btn { background: #fff; border-color: #d0d5dd; color: var(--ink); box-shadow: var(--shadow-sm); }
.topbar .acct__out .btn:hover { background: #f9fafb; }
@media screen and (max-width: 800px) { .acct__who strong { color: var(--ink); } }
/* ===== Language switch (English | اردو) in the account menu ===== */
.acct__lang { display: flex; gap: 6px; margin: 6px 4px 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.acct__lang button { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.acct__lang button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.acct__lang button[lang="ur"] { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; font-size: 1rem; }
@media screen and (max-width: 800px) { .acct__lang button { min-height: 44px; } }
/* ===== Urdu: right-to-left (the page is <html dir="rtl"> only for staff who chose Urdu) ===== */
html[dir="rtl"] body { font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif; line-height: 1.75; letter-spacing: 0; }
html[dir="rtl"] input, html[dir="rtl"] select, html[dir="rtl"] textarea, html[dir="rtl"] button { font-family: inherit; }
/* numbers, phone numbers and dates are typed left to right, but sit on the right edge */
html[dir="rtl"] input[inputmode="numeric"], html[dir="rtl"] input[inputmode="decimal"], html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="date"], html[dir="rtl"] input[type="time"], html[dir="rtl"] input[type="number"] { direction: ltr; text-align: right; }
html[dir="rtl"] .chev { transform: scaleX(-1); }
html[dir="rtl"] .group.is-open > button .chev, html[dir="rtl"] .group.is-open .group__toggle .chev, html[dir="rtl"] .acct__btn[aria-expanded="true"] .chev { transform: scaleX(-1) rotate(90deg); }
html[dir="rtl"] .side { border-right: 0; border-left: 1px solid rgba(255, 255, 255, .04); }
html[dir="rtl"] .side nav a.is-active::before, html[dir="rtl"] .side .group.has-active > button::before, html[dir="rtl"] .side .group.has-active .group__label::before { left: auto; right: -14px; border-radius: 4px 0 0 4px; }
html[dir="rtl"] .side .sub { margin: 0 21px 4px 0; padding: 0 13px 0 0; border-left: 0; border-right: 1px solid rgba(255, 255, 255, .12); }
html[dir="rtl"] .side nav .sub a.is-active::before { left: auto; right: -17px; }
html[dir="rtl"] .table th, html[dir="rtl"] .table td { text-align: right; }
html[dir="rtl"] .kv b { text-align: left; }
html[dir="rtl"] .fe-head span:first-child { text-align: right; }
html[dir="rtl"] select:not([multiple]) { background-position: left 12px center; padding-right: 14px; padding-left: 36px; }
html[dir="rtl"] input[type="search"], html[dir="rtl"] .fe-tools input[type="search"], html[dir="rtl"] .filters input[type="search"] { background-position: right 12px center; padding-left: 12px; padding-right: 38px; }
html[dir="rtl"] .alert { border-left-width: 1px; border-right-width: 4px; }
html[dir="rtl"] .alert--success { border-right-color: #12b76a; } html[dir="rtl"] .alert--error { border-right-color: #f04438; } html[dir="rtl"] .alert--warning { border-right-color: #f79009; } html[dir="rtl"] .alert--info { border-right-color: #2e90fa; }
html[dir="rtl"] .announce { border-left-width: 1px; border-right: 5px solid #f79009; }
html[dir="rtl"] .stat::before { left: auto; right: 0; }
html[dir="rtl"] .stat { padding: 18px 22px 18px 20px; }
html[dir="rtl"] .acct__panel, html[dir="rtl"] .bell__panel { right: auto; left: 0; }
html[dir="rtl"] .acct__btn { padding: 4px 4px 4px 10px; }
html[dir="rtl"] .punch__dot { margin-left: 0; }
html[dir="rtl"] .fly { left: auto; right: calc(100% + 12px); }
@media screen and (max-width: 800px) {
  html[dir="rtl"] .side { left: auto; right: calc(-1 * min(340px, 90vw)); transition: right .22s ease; }
  html[dir="rtl"] .side.is-open { left: auto; right: 0; }
  html[dir="rtl"] .acct__panel, html[dir="rtl"] .bell__panel { left: 8px; right: 8px; }
  html[dir="rtl"] .stat { padding: 12px 14px 12px 12px; }
  html[dir="rtl"] .fe-row { direction: rtl; }
}html[dir="rtl"] .announce__body p, html[dir="rtl"] .kv b, html[dir="rtl"] .rc__name { unicode-bidi: plaintext; }

/* ===== Announcement slider (several announcements running today) ===== */
.announce-slider { margin: 0 0 18px; }
.announce-slider__track { display: flex; align-items: flex-start; transition: height .2s; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.announce-slider__track::-webkit-scrollbar { display: none; }
.announce-slider__track .announce { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.announce-slider__nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.announce-slider__btn { width: 36px; height: 36px; border: 1px solid #fedf89; border-radius: 50%; background: #fffaeb; color: #93370d; display: grid; place-items: center; cursor: pointer; padding: 0; }
.announce-slider__btn .chev { stroke: currentColor; opacity: 1; width: 16px; height: 16px; }
.announce-slider__btn[data-slider-prev] .chev { transform: scaleX(-1); }
.announce-slider__btn:focus-visible, .announce-slider__dot:focus-visible { outline: 2px solid #f79009; outline-offset: 2px; }
.announce-slider__dots { display: inline-flex; gap: 8px; }
.announce-slider__dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #fedf89; cursor: pointer; transition: width .2s, background-color .2s; }
.announce-slider__dot[aria-current="true"] { width: 24px; border-radius: 6px; background: #f79009; }
.announce-slider__count { direction: ltr; unicode-bidi: isolate; font-size: .8rem; color: #93370d; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
html[dir="rtl"] .announce-slider__btn[data-slider-prev] .chev { transform: none; }
html[dir="rtl"] .announce-slider__btn[data-slider-next] .chev { transform: scaleX(-1); }
@media screen and (max-width: 800px) { .announce-slider { margin-bottom: 12px; } .announce-slider__btn { width: 40px; height: 40px; } }
@media print { .announce-slider { display: none; } }
/* ===== Page links (pagination) stay at the bottom of the screen while the list is scrolled ===== */
.card.table-wrap:has(.pager) { overflow: visible; }
.pager { position: sticky; bottom: 0; z-index: 8; margin: 10px -18px -16px; padding: 10px 18px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -8px 20px -14px rgba(16, 24, 40, .22); }
.page > .pager { margin: 10px 0 0; border-radius: var(--radius); border: 1px solid var(--line); }
@media screen and (max-width: 800px) {
  .pager { bottom: var(--bn, 0px); margin: 8px -14px -14px; padding: 8px 12px; }
  .page > .pager { margin: 8px 0 0; }
}
@media print { .pager { display: none; } }
/* Mark paid straight from the payroll list */
.paybox { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.paybox select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 16px; }

/* Daily visit links under the check-in/out columns of the Daily employee data tab */
.day__visits { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.day__visits h4 { margin: 0 6px 0 0; }
.day__visits a.badge { text-decoration: none; padding: 6px 10px; }

/* Top bar: a real ticking clock (company time, seconds) with a small connection dot */
.live-clock { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18,183,106,.18); }
.live-dot.is-bad { background: #f04438; box-shadow: 0 0 0 3px rgba(240,68,56,.2); }
.live-status:empty { display: none; }
@media screen and (max-width: 800px) { .topbar .live-clock { display: inline-flex; flex: 0 0 auto; gap: 5px; color: rgba(255, 255, 255, .92); font-size: .74rem; font-weight: 600; } .topbar .live-dot { width: 7px; height: 7px; } }
@media print { .live-clock { display: none; } }

/* Refresh button beside the bell */
.refresh-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; font-size: 1.25rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.refresh-btn span { display: inline-block; }
.refresh-btn.is-spinning span { animation: ems-spin .7s linear infinite; }
@keyframes ems-spin { to { transform: rotate(360deg); } }
@media print { .refresh-btn { display: none; } }

/* announcement: how long it runs */
.announce__until { display: inline-block; margin-left: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(247,144,9,.16); color: #93370d; font-size: .74rem; font-weight: 600; vertical-align: middle; }
html[dir="rtl"] .announce__until { margin-left: 0; margin-right: 10px; }

/* announcement: who sees it */
.aud__row { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-weight: 500; }
.aud__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding-inline-start: 26px; }
.aud__chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; margin: 0; }
.aud__row input, .aud__chip input { width: auto; margin: 0; }

.announce__for { background: rgba(16, 24, 40, .07); color: #475467; }

/* Sales entries kept on the phone while there is no internet (public/js/offline.js) */
.offq { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--bn, 0px) + 12px); max-width: 560px; margin-inline: auto; background: #fffaeb; border: 1px solid #fedf89; border-radius: 16px; box-shadow: 0 10px 30px -8px rgba(16, 24, 40, .35); padding: 10px 12px; }
.offq__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.offq__head strong { color: #93370d; font-size: .92rem; }
.offq__note { color: #b54708; font-size: .8rem; flex-basis: 100%; }
.offq__actions { display: flex; gap: 8px; margin-inline-start: auto; }
.offq__panel { margin-top: 10px; max-height: 40vh; overflow: auto; display: grid; gap: 8px; }
.offq__row { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.offq__row.is-failed { border-color: #fda29b; background: #fef3f2; }
.offq__info { display: grid; gap: 2px; min-width: 0; }
.offq__info strong { overflow-wrap: anywhere; font-size: .9rem; }
.offq__err { color: #b42318; font-size: .82rem; overflow-wrap: anywhere; }
.offq-toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--bn, 0px) + 84px); transform: translate(-50%, 20px); max-width: min(92vw, 520px); background: #101828; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.offq-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media print { .offq, .offq-toast { display: none; } }

/* a booking form before any stock of the day exists: only the notice and the (empty) distributor choice show */
form[data-offq-locked] > *:not(.alert):not([for="distributor_id"]):not(#distributor_id):not(.actions) { display: none; }

/* daily visit links now sit inside the Plan column, under the plan */
.day__col .day__visits { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); flex-direction: column; align-items: flex-start; gap: 6px; }
.day__col .day__visits h4 { margin: 0 0 2px; }
.lavatar { width: var(--s, 38px); height: var(--s, 38px); border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); background: var(--surface-2, #eef3f1); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--brand, #0a6b4d); font-size: calc(var(--s, 38px) * .4); vertical-align: middle; }
.lwho { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lwho > div { min-width: 0; }
.day__sum { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.day__col .day__visits a.badge { white-space: normal; text-align: start; }

/* Shop bookings of a day: share / picture of each booking, and all of them at once */
.bk-all { margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: #f8fafc; }
.bk-share { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.bk-share > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: .9rem; color: var(--brand-dark); list-style: none; }
.bk-share > summary::-webkit-details-marker { display: none; }
.bk-share > summary::before { content: "\25B8  "; }
.bk-share[open] > summary::before { content: "\25BE  "; }
.bk-share > [data-live-results] { padding: 0 8px 8px; }
@media print { .bk-all, .bk-share { display: none; } }

/* the note of a shop booking, under the booking */
.bk-note { margin: 2px 0 8px; padding: 6px 10px; border-inline-start: 3px solid #f79009; background: #fffaeb; border-radius: 6px; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }

/* a grouped report (for example manual orders by sales officer): the group heading, and the group total */
.table.is-grouped tr.section-row td { background: var(--brand-soft); color: var(--ink); font-weight: 600; font-size: 1rem; border-top: 2px solid var(--brand-soft2); }
.table.is-grouped tr.section-row td:first-child { color: var(--brand-dark); }      /* only the officer's name is green; the totals are plain dark text */
.table.is-grouped tr.total-row td { background: #f1f5f9; font-weight: 600; }
.rc--section { background: var(--brand-soft); border-color: var(--brand-soft2); padding-top: 8px; padding-bottom: 8px; }
.rc--section .rc__name { color: var(--brand-dark); font-size: 1rem; font-weight: 600; }
.table.is-grouped tr.section-row { cursor: pointer; }
.table.is-grouped tr.section-row:hover td { filter: brightness(.97); }
.table.is-grouped tr.section-row td:last-child { position: relative; padding-right: 44px; }
.grp-toggle { position: absolute; right: 12px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border: 1px solid var(--brand-soft2); border-radius: 50%; background: #fff; cursor: pointer; padding: 0; }
.grp-toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -6px 0 0 -4px; border-right: 2px solid var(--brand-dark); border-bottom: 2px solid var(--brand-dark); transform: rotate(45deg); transition: transform .15s; }
tr.is-open .grp-toggle::before, .rc--section.is-open::after { transform: rotate(-135deg); margin-top: -2px; }
.grp-actions { margin: 0 0 10px; }
.rc--section { position: relative; cursor: pointer; padding-right: 44px; }
.rc--section::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -7px; border-right: 2px solid var(--brand-dark); border-bottom: 2px solid var(--brand-dark); transform: rotate(45deg); transition: transform .15s; }
[hidden].rc { display: none; }

/* WhatsApp share buttons: icon + text on a computer; on a phone ONLY the WhatsApp icon (the full text did not fit), the name shows as a tooltip */
.btn--wa-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn--wa-icon .wa-ico { width: 18px; height: 18px; flex: none; }
@media screen and (max-width: 800px) {
  .btn--wa-icon { position: relative; justify-content: center; min-width: 46px; padding-left: 12px; padding-right: 12px; gap: 0; }
  .btn--wa-icon .btn__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }      /* hidden from the eye, still read by screen readers */
  .btn--wa-icon .wa-ico { width: 24px; height: 24px; }
  .btn--wa-icon[data-tip]:hover::after, .btn--wa-icon[data-tip]:focus-visible::after, .btn--wa-icon[data-tip]:active::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; white-space: nowrap;
    background: #17212b; color: #fff; font-size: .78rem; font-weight: 500; padding: 5px 9px; border-radius: 7px; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  }
}

/* image download buttons (Picture PNG, All Images PDF): icon + text on a computer; on a phone only the picture icon with a tiny format tag, the full name as a tooltip */
.ico-btn { display: inline-flex; align-items: center; gap: 6px; }
.ico-btn .ic-img { width: 18px; height: 18px; flex: none; }
.ico-tag, .wa-draft { display: none; }
@media screen and (max-width: 800px) {
  .ico-btn { position: relative; justify-content: center; min-width: 46px; padding-left: 10px; padding-right: 10px; gap: 4px; }
  .ico-btn .btn__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ico-btn .ic-img { width: 22px; height: 22px; }
  .ico-btn .ico-tag { display: inline; font-size: .62rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
  .ico-btn[data-tip]:hover::after, .ico-btn[data-tip]:focus-visible::after, .ico-btn[data-tip]:active::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; white-space: nowrap;
    background: #17212b; color: #fff; font-size: .78rem; font-weight: 500; padding: 5px 9px; border-radius: 7px; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  }
  /* a DRAFT payroll slip button keeps a tiny "draft" flag, so the difference is still visible without the words */
  .btn--wa-icon .wa-draft { display: block; position: absolute; top: -6px; right: -4px; background: #f79009; color: #fff; font-size: .56rem; font-weight: 700; line-height: 1; padding: 2px 4px; border-radius: 8px; }
}

/* ---------------------------------------------------------------- one confirm dialog, "working" signs, phone action buttons */
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -3px; animation: ems-spin .7s linear infinite; }
.spin--lg { width: 38px; height: 38px; border-width: 4px; }
@keyframes ems-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.btn.is-busy { cursor: progress; opacity: .92; }
.btn.is-busy .busy-txt { margin-left: 7px; }
@media screen and (max-width: 800px) { .table .btn.is-busy .busy-txt, .rc .btn.is-busy .busy-txt { display: none; } .table .btn.is-busy .spin { margin: 0; } }   /* in a narrow table cell: only the spinner */

.busy-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: rgba(16, 24, 40, .55); backdrop-filter: blur(2px); }
.busy-box { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(88vw, 380px); padding: 26px 28px; background: #fff; border-radius: 16px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); color: var(--ink); }
.busy-box .spin { color: var(--brand); }
.busy-box p { margin: 0; font-weight: 600; line-height: 1.45; }
html.is-busy-page { overflow: hidden; }

.report-top__result.is-working::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--brand); border-right-color: transparent; border-radius: 50%; animation: ems-spin .7s linear infinite; }

dialog.confirm { border: 0; padding: 0; border-radius: 16px; width: min(92vw, 400px); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(16, 24, 40, .55); backdrop-filter: blur(2px); }
.confirm__box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 22px 20px; text-align: center; }
.confirm__icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; background: var(--brand-soft); color: var(--brand-dark); }
.confirm--danger .confirm__icon { background: #fde8e8; color: #b3261e; }
.confirm__title { margin: 4px 0 0; font-size: 1.15rem; }
.confirm__msg { margin: 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.confirm__btns { display: flex; gap: 10px; width: 100%; margin-top: 12px; }
.confirm__btns .btn { flex: 1; min-height: 44px; justify-content: center; }

/* small action buttons on a phone: a picture with a small word under it (a computer keeps the word only) */
.btn--ic .bi { display: none; width: 20px; height: 20px; flex: none; }
@media screen and (max-width: 800px) {
  .btn.btn--ic { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 54px; padding: 6px 9px; line-height: 1.1; text-align: center; }
  .btn--ic .bi { display: block; }
  .btn--ic .bi-txt { font-size: .68rem; font-weight: 600; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table .btn.btn--ic { padding: 5px 8px; }
}

/* field-entry screens on a phone (distributor stock, shop booking, manual order, return, claim): the product names a little smaller and lighter */
@media screen and (max-width: 800px) {
  .fe-row__name strong { font-size: .84rem; font-weight: 500; line-height: 1.25; }
  .fe-product--multi .fe-product__head strong { font-size: .88rem; font-weight: 500; }
}
.bk-notes { margin: 8px 0 4px; padding: 7px 11px; border-inline-start: 3px solid #f79009; background: #fffaeb; border-radius: 6px; font-size: .9rem; overflow-wrap: anywhere; }
.bk-notes b { font-weight: 600; }

/* Shop booking: CTN | CTN rate | PCS | PCS rate (the rate not typed shows in grey, worked out from the other) */
.fe-list .fe-row.fe--rate4, .fe-head.fe--rate4 { grid-template-columns: minmax(0, 1fr) 74px 96px 74px 96px; }
.fe-row.fe--rate4 input[data-fe-rate]::placeholder, .fe-row.fe--rate4 input[data-fe-prate]::placeholder { color: var(--muted); opacity: .75; }
@media (max-width: 560px) {
  .fe-list .fe-row.fe--rate4, .fe-head.fe--rate4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px; }
  .fe-row.fe--rate4 .fe-row__name { grid-column: 1 / -1; }
  .fe-head.fe--rate4 span:first-child { display: none; }
  .fe-head.fe--rate4 { font-size: .6rem; }
}
/* Stock position (warehouse): one table, ONE header that stays on top while scrolling, products with their batches under them. */
.stockpos { padding: 12px 14px 8px; }
.table--pos { border-collapse: separate; border-spacing: 0; }
.table--pos thead th { position: sticky; top: 66px; z-index: 4; background: #f3f6f5; border-bottom: 2px solid var(--line); white-space: nowrap; font-size: .7rem; }
.table--pos td { padding: 9px 10px; vertical-align: middle; }
.table--pos tr.pos-main td { border-top: 2px solid #e3e9e7; background: #fff; }
.table--pos tr.pos-main.is-minus td { background: #fff5f5; }
.table--pos tr.pos-batch td { background: #fafcfb; font-size: .86rem; padding-top: 5px; padding-bottom: 5px; border-bottom: 1px dashed #edf1ef; color: #44524c; }
.table--pos .neg { color: #b42318; }
.table--pos td:last-child, .table--pos .btn { white-space: nowrap; }
.table--pos .pos-limit { margin-top: 4px; }
.table--pos .pos-limit summary { cursor: pointer; color: var(--brand-dark); display: inline-block; }
.table--pos .pos-limit form { display: flex; gap: 6px; margin-top: 4px; justify-content: flex-end; }
@media print { .table--pos thead th { position: static; } .table--pos .pos-limit, .topbar .btn { display: none; } }
@media screen and (max-width: 800px) { .table--pos thead th { position: static; } .stockpos { padding: 0; background: transparent; border: 0; box-shadow: none; } }
/* The claim form (sales person): who claims, then the money rows, then the products. */
.claim-head { border: 1px solid var(--line); border-radius: 12px; padding: 2px 14px; margin: 4px 0 10px; background: #fafcfb; }
.claim-title { font-size: 1.05rem; margin: 18px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.claim-row { display: grid; grid-template-columns: 150px 1.6fr 120px 1fr; gap: 8px; align-items: center; margin: 0 0 8px; }
.claim-row__name { font-weight: 700; }
.claim-row__error { grid-column: 1 / -1; margin: 0; }
@media screen and (max-width: 800px) { .claim-row { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 12px; } .claim-row__name { grid-column: 1 / -1; } .claim-row input:first-of-type { grid-column: 1 / -1; } }
/* announcements that can be answered */
.announce__reply { margin-top: 10px; display: grid; gap: 8px; max-width: 560px; }
.announce__reply textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.announce__choices { display: flex; flex-wrap: wrap; gap: 8px; }
.announce__choice { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; min-height: 38px; cursor: pointer; }
.announce__answers { margin: 8px 0 0; font-size: .9rem; }

/* pieces that exist for paper only (css/ems-print.css shows them when printing) */
.print-only, .slip__sign, .slip__printed { display: none; }

/* phone: an open account / bell panel (and its dimmed backdrop) must sit above the fixed bottom bars (Check in dock, Save bar, bottom navigation), or Sign out is hidden behind them */
@media screen and (max-width: 800px) { .topbar:has(.acct__panel:not([hidden])), .topbar:has(.bell__panel:not([hidden])) { z-index: 90; } .acct__panel { max-height: calc(100vh - 80px); overflow-y: auto; } }

/* a compulsory field: a red star after its label */
.req { color: #C2412D; font-weight: 700; margin-left: 2px; }
/* the running total of the estimate invoice form */
.estimate-total { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; margin: 14px 0 6px; padding: 12px 16px; border: 1px solid var(--line, #DCE3DE); border-radius: 12px; background: #F4F8F5; }
.estimate-total span { display: flex; flex-direction: column; }
.estimate-total small { font-size: .72rem; color: var(--muted, #5E6D65); text-transform: uppercase; letter-spacing: .05em; }
.estimate-total b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.estimate-total__sum { margin-left: auto; }
.estimate-total__sum b { font-size: 1.45rem; color: var(--brand, #13784F); }

/* an amount (or any figure) that opens a popup with the details behind it */
.link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 600; color: var(--brand, #13784F); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.link-btn:hover { text-decoration-style: solid; }
.modal--wide { width: min(760px, calc(100vw - 24px)); }

/* the Purchasing demand list: a light tint on the whole row by status (red = not ordered yet, yellow = ordered, green = received) */
tr.demand--open > td { background: #fff4f2; }
tr.demand--ordered > td { background: #fff9e6; }
tr.demand--received > td { background: #effaf3; }
tr.demand--open > td:first-child, tr.demand--ordered > td:first-child, tr.demand--received > td:first-child { box-shadow: inset 4px 0 0 var(--demand-bar, transparent); }
tr.demand--open { --demand-bar: #d92d20; } tr.demand--ordered { --demand-bar: #f5b301; } tr.demand--received { --demand-bar: #12a150; }
tr.section-row > td { background: #e3f1ea; font-weight: 600; color: #0d5133; }
tr.section-row > td:not(:first-child) { padding-top: 0; padding-bottom: 0; }
tr.section-row.section-row--sub > td { background: #f1f8f4; color: #0d5133; font-size: .82rem; padding-top: .3rem; padding-bottom: .3rem; }      /* a small heading inside a section (the raw material's category) */

/* voice message: hold-to-record button (announcement form) */
.voice-hold{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;padding:12px 22px;font-size:1rem;border-radius:999px}
.voice-hold.is-recording{background:#c0392b;border-color:#c0392b;color:#fff;animation:voicepulse 1s infinite}
@keyframes voicepulse{0%{box-shadow:0 0 0 0 rgba(192,57,43,.5)}100%{box-shadow:0 0 0 14px rgba(192,57,43,0)}}

/* Brand Ambassador daily sale: the price of one piece under the quantity boxes of a product row */
.fe-row .ba-price { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0; font-size: .8rem; font-weight: 500; color: var(--muted); }
.fe-row .ba-price input[type=text] { width: 130px; max-width: 45%; text-align: right; }

/* Address book on a laptop: twelve columns do not always fit. The table scrolls inside its own box (the pager under it stays put), and the Call / WhatsApp buttons never break into letters. */
.table-scroll { overflow-x: auto; max-width: 100%; }

/* Share button: the small window that asks "Share as Image" or "Share as PDF" */
.share-choose { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 32, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); padding: 16px; animation: share-fade .18s ease-out; }
.share-choose__card { width: 100%; max-width: 300px; background: var(--card, #fff); color: var(--ink, #101828); border-radius: 16px; padding: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: share-pop .2s cubic-bezier(.2, .9, .3, 1); }
.share-choose__grip { display: none; }
.share-choose__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.share-choose__title { font-size: 1rem; }
.share-choose__x { appearance: none; border: 0; background: rgba(120, 130, 140, .16); color: inherit; width: 28px; height: 28px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.share-choose__x:hover { background: rgba(120, 130, 140, .28); }
.share-choose__sub { display: none; margin: 2px 0 12px; font-size: .85rem; color: var(--muted, #667085); }
.share-choose__list { display: grid; gap: 8px; margin-top: 8px; }
.share-choose__opt { appearance: none; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line, #e4e9f0); background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer; min-height: 52px; transition: border-color .15s, transform .12s, box-shadow .15s, background .15s; }
.share-choose__opt:hover, .share-choose__opt:focus-visible { border-color: var(--brand, #0f7a4f); box-shadow: 0 4px 16px rgba(15, 122, 79, .14); outline: none; transform: translateY(-1px); }
.share-choose__opt:active { transform: scale(.985); }
.share-choose__ico { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(15, 122, 79, .12); color: var(--brand, #0f7a4f); }
.share-choose__opt--pdf .share-choose__ico { background: rgba(214, 69, 69, .12); color: #d64545; }
.share-choose__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.share-choose__txt b { font-size: .95rem; }
.share-choose__txt small { font-size: .74rem; color: var(--muted, #667085); }
.share-choose__go { flex: 0 0 auto; font-size: 1.4rem; color: var(--muted, #667085); line-height: 1; }
/* the popup also has Download (a copy to keep) and Print: smaller rows so it stays a small window, also on a phone */
.share-choose__card { max-width: 320px; max-height: calc(100vh - 32px); overflow-y: auto; }
.share-choose__list { gap: 6px; }
.share-choose__opt { min-height: 44px; padding: 5px 10px; gap: 10px; }
.share-choose__ico { width: 30px; height: 30px; border-radius: 9px; }
.share-choose__ico svg { width: 18px; height: 18px; }
.share-choose__lab { margin: 6px 0 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #667085); }
.share-choose__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.share-choose__opt--half .share-choose__go { display: none; }
.share-choose__opt--half .share-choose__txt b { font-size: .85rem; }
.share-choose__opt--print .share-choose__ico { background: rgba(60, 90, 160, .12); color: #3b5ba5; }
@keyframes share-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes share-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .share-choose, .share-choose__card { animation: none; } }
.recv-photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.recv-pics { display: inline-flex; align-items: center; gap: 4px; }
.recv-photos label { margin: 0; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* Attendance page: the 4th column and the Day progress sheet */
.dp__who { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 10px; }
.dp__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dp__tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dp__tile { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--card); min-width: 0; }
.dp__tile span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dp__tile b { display: block; font-size: 1.05rem; margin-top: 2px; overflow-wrap: anywhere; }
.dp__tile b small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }
.dp__tile--ok { border-color: #b7e4cf; background: #f1faf6; }
.dp__tile--warn { border-color: #f3d9a4; background: #fff9ec; }
/* NEW shops (added with the routes feature): one purple look everywhere, so they stand out from the other shops */
.badge.badge--new, body.rd-admin .badge.badge--new { background: #7c3aed; color: #fff; font-weight: 700; letter-spacing: .04em; }      /* two classes: the admin skin's plain .badge (grey) must not win */
.chip--new { background: #f3e8ff; border-color: #d8b4fe; color: #5b21b6; }
.stat--new { box-shadow: inset 0 0 0 2px #c4a1fb; }
.day__new { margin-top: 3px; padding: 3px 6px; border-radius: 8px; background: #f3e8ff; color: #4c1d95; }
.dp__tile--new { border-color: #d8b4fe; background: #faf5ff; }
.dp__tile--new small { display: block; font-weight: 500; font-size: .72rem; color: #6b21a8; }
.dp__newtag { display: inline-block; vertical-align: baseline; margin-right: 4px; padding: 1px 7px; font-size: .68rem; }
.dp__timeline li.dp__new { background: #faf5ff; border-radius: 8px; box-shadow: inset 3px 0 0 #7c3aed; }
.dp__block { margin-top: 14px; }
.dp__block h4 { margin: 0 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.dp__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dp__note { margin: 8px 0 0; }
.dp__timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.dp__timeline li { display: grid; grid-template-columns: 48px auto 1fr; gap: 8px; align-items: baseline; padding: 6px 0 6px 10px; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.dp__timeline li:last-child { border-bottom: 0; }
.dp__timeline time { font-weight: 700; color: var(--muted); }
.dp__kind { justify-self: start; }
.badge--info { background: #e8f0fe; color: #1d4ed8; }
@media screen and (max-width: 560px) { .dp__tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dp__timeline li { grid-template-columns: 44px 1fr; } .dp__timeline li > span:last-child { grid-column: 1 / -1; } }

/* Address book: a table that fits the screen (no sideways scroll), tooltips for phone and address, the status box that saves by itself */
@media (min-width: 801px) {
  .card.table-wrap.rd-shops-card, .rd-shops-card .table-scroll { overflow: visible; }
  table.rd-shops { width: 100%; table-layout: auto; }
  table.rd-shops th, table.rd-shops td { padding-left: 8px; padding-right: 8px; vertical-align: top; }
  table.rd-shops td[data-label="Shop"] { min-width: 120px; max-width: 240px; overflow-wrap: anywhere; }
  table.rd-shops td[data-label="Distributor"], table.rd-shops td[data-label="Sales person"] { max-width: 180px; overflow-wrap: anywhere; }
  table.rd-shops td[data-label="Phone"] { white-space: nowrap; }
}
.pop { position: relative; display: inline-block; }
.pop__t { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.pop__c { display: none; position: absolute; left: 0; top: 100%; z-index: 40; margin-top: 6px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(16, 24, 40, .2); padding: 8px 10px; white-space: normal; font-weight: 400; }
.pop__c::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.pop:hover > .pop__c, .pop:focus-within > .pop__c { display: flex; gap: 8px; align-items: center; }
.pop__c--addr { width: 260px; max-width: 70vw; }
.pop:hover > .pop__c--addr, .pop:focus-within > .pop__c--addr { display: block; }
.pop__c--addr a { color: var(--brand, #0f7b57); text-decoration: underline; }
.pop__a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pop__a:hover { background: #eef6f1; }
.pop__a--wa { color: #fff; background: #25d366; border-color: #25d366; }
.pop__a--wa .wa-ico { width: 22px; height: 22px; }
.shop-status { width: auto; min-width: 112px; font-weight: 600; }
.shop-status.is-ok { border-color: #12a150; background: #e8f7ee; color: #0a6b3a; }
.shop-status.is-warn { border-color: #f5b301; background: #fff7dc; color: #7a5a00; }
.shop-status.is-bad { border-color: #d92d20; background: #fdeceb; color: #a11d14; }
.shop-status.is-saving { opacity: .55; }
.sb-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; }
.sb-bar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
@media screen and (max-width: 800px) {
  /* on a phone the icons / address are always in the line (not a hover tooltip): the hover and focus rules of the laptop must not move them while a finger is on them */
  .pop > .pop__c, .pop:hover > .pop__c, .pop:focus-within > .pop__c { position: static; display: inline-flex; margin: 0 0 0 8px; padding: 0; border: 0; box-shadow: none; background: transparent; gap: 8px; vertical-align: middle; align-items: center; }
  .pop__c::before { display: none; }
  .pop > .pop__c--addr, .pop:hover > .pop__c--addr, .pop:focus-within > .pop__c--addr { display: block; width: auto; max-width: none; margin: 4px 0 0; font-size: .82rem; }
}
/* Inward / received items: the "Details" of a receiving opens in a popup (also on a phone: in the middle of the screen, never a wide card inside the page) */
.modal--inward { width: min(460px, calc(100vw - 24px)); text-align: left; }
.inw-dl { margin: 6px 0 4px; display: grid; gap: 6px; }
.inw-dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: baseline; }
.inw-dl dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.inw-dl dd { margin: 0; overflow-wrap: anywhere; }
.inw-pics { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.inw-pics img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.inw-ev { font-size: .84rem; margin: 6px 0; overflow-wrap: anywhere; }
@media screen and (max-width: 800px) {
  .modal.modal--inward { width: calc(100vw - 24px); max-width: 460px; margin: auto; border-radius: 16px; max-height: 82vh; max-height: 82dvh; }
  .modal--inward .modal__body { max-height: calc(82dvh - 64px); padding-bottom: 18px; }
}

/* Section pages: the page of a menu group (People, Money, Sales...) shows its pages as a grid of cards with a picture each */
.sec-head { display: flex; align-items: center; gap: 14px; margin: 2px 0 14px; }
.sec-head h2 { margin: 0; font-size: 1.35rem; }
.sec-head p { margin: 2px 0 0; }
.sec-head__ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft, #e7f6ef); color: var(--brand, #0e8a63); flex: 0 0 auto; }
.sec-head__ico .ico { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.sec-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--card, #fff); border: 1px solid var(--line, #e4e9f0); border-radius: 16px; color: var(--ink, #101828); text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; min-height: 84px; }
.sec-card:hover, .sec-card:focus-visible { transform: translateY(-2px); border-color: var(--brand, #0e8a63); box-shadow: 0 8px 22px rgba(20, 43, 73, .14); outline: none; text-decoration: none; }
.sec-card:active { transform: scale(.985); }
.sec-card.is-active { border-color: var(--brand, #0e8a63); background: var(--brand-soft, #e7f6ef); }
.sec-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft, #e7f6ef); color: var(--brand, #0e8a63); }
.sec-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sec-card:hover .sec-ico { background: var(--brand, #0e8a63); color: #fff; }
.sec-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sec-txt b { font-size: 1rem; line-height: 1.25; }
.sec-txt small { color: var(--muted, #667085); font-size: .8rem; line-height: 1.3; }
@media screen and (max-width: 600px) {
  .sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sec-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 0; }
  .sec-txt small { font-size: .74rem; }
}

/* Toggle cards: a heading that is plainly a button (picture, what it does, "Open" / "Close") and opens its form below; used on the labour khaata page */
.tgl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 0 0 14px; align-items: start; }
.tgl { background: var(--card, #fff); border: 1px solid var(--line, #e4e9f0); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); overflow: hidden; }
.tgl[open] { grid-column: 1 / -1; border-color: var(--brand, #0e8a63); box-shadow: 0 6px 20px rgba(20, 43, 73, .12); }
.tgl__head { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; user-select: none; }
.tgl__head::-webkit-details-marker { display: none; }
.tgl__head:hover { background: var(--brand-soft, #e7f6ef); }
.tgl__head:focus-visible { outline: 2px solid var(--brand, #0e8a63); outline-offset: -2px; }
.tgl__ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft, #e7f6ef); color: var(--brand, #0e8a63); }
.tgl__ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tgl--pay .tgl__ico { background: var(--brand, #0e8a63); color: #fff; }
.tgl__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tgl__txt b { font-size: .98rem; line-height: 1.25; }
.tgl__txt small { color: var(--muted, #667085); font-size: .78rem; line-height: 1.3; }
.tgl__tog { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1.5px solid var(--brand, #0e8a63); border-radius: 999px; color: var(--brand, #0e8a63); font-size: .8rem; font-weight: 700; }
.tgl__tog::after { content: "Open"; }
.tgl[open] .tgl__tog { background: var(--brand, #0e8a63); color: #fff; }
.tgl[open] .tgl__tog::after { content: "Close"; }
.tgl[open] .tgl__head { border-bottom: 1px solid var(--line, #e4e9f0); }
.tgl__body { padding: 14px 16px 16px; max-width: 760px; }
.stat--accent { border-color: var(--brand, #0e8a63); background: var(--brand-soft, #e7f6ef); }
@media screen and (max-width: 600px) {
  .tgl-grid { grid-template-columns: 1fr; gap: 10px; }
  .tgl__head { padding: 12px; gap: 10px; }
  .tgl__body { padding: 12px; }
}

/* "The site was updated" bar: offered (never forced) to a tab that is older than the server while somebody is filling a form */
.update-bar { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1200; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #101828; color: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: .9rem; max-width: calc(100vw - 24px); }
@media (min-width: 801px) { .update-bar { bottom: 20px; } }

/* Dispatch form: the live total of what is being sent stays in view at the bottom of the screen while the long tables are scrolled */
.dispatch-total { position: sticky; bottom: 10px; z-index: 6; margin: 14px 0 6px; padding: 10px 14px; background: var(--brand-soft, #e7f6ef); border: 1.5px solid var(--brand, #0e8a63); border-radius: 14px; box-shadow: 0 6px 18px rgba(20, 43, 73, .18); }
.dispatch-total.is-empty { background: #f4f6f8; border-color: var(--line, #e4e9f0); box-shadow: none; }
.dispatch-total__main { font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.dispatch-total__label { color: var(--muted, #667085); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.dispatch-total__main b { font-size: 1.25rem; }
.dispatch-total__parts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 3px; font-size: .82rem; color: var(--muted, #667085); }
@media screen and (max-width: 800px) { .dispatch-total { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
/* the form is a .table-wrap (it scrolls sideways); that kind of box stops a sticky child from sticking, so here the sideways overflow is only clipped */
form[data-dispatch-form].table-wrap { overflow: visible; overflow-x: clip; }

/* Group booking card */
.group-card__members { display: flex; flex-wrap: wrap; gap: 6px; }
.group-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.group-card .actions form { margin: 0; }

/* The product list that opens under a search box (input[data-pickdd]), see warehouse.js */
.pickdd { position: fixed; z-index: 90; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid var(--line, #DCE3DE); border-radius: 12px; box-shadow: 0 10px 28px rgba(16, 24, 40, .18); }
.pickdd[hidden] { display: none; }
.pickdd__opt { display: block; width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line, #E6ECE8); background: none; text-align: left; font: inherit; font-size: .95rem; line-height: 1.3; color: inherit; cursor: pointer; }
.pickdd__opt:last-child { border-bottom: 0; }
.pickdd__opt:hover, .pickdd__opt:active { background: #EEF5F0; }
.pickdd__none { padding: 12px 14px; color: var(--muted, #5E6D65); font-size: .92rem; }
input[data-pickdd] { scroll-margin-top: 96px; }
@media screen and (max-width: 800px) {
  /* the estimate total stays at the bottom of the phone screen, above the tabs, while products are added */
  [data-estimate-form] .estimate-total { position: sticky; bottom: var(--bn, 0px); z-index: 20; margin: 14px 0 6px; box-shadow: 0 -6px 16px rgba(16, 24, 40, .10); background: #F4F8F5; }
}

/* routes and shops (public/js/shop-routes.js): the shops already saved that match what is typed, and the "this shop is already saved" notice */
.sr-list { border: 1px solid var(--line, #d9e2dd); border-radius: 10px; margin: 6px 0 4px; overflow: hidden; background: var(--card, #fff); }
.sr-list__title { padding: 6px 12px; font-size: .82rem; color: var(--muted, #5a6b64); background: var(--bg, #f6f8f7); border-bottom: 1px solid var(--line, #d9e2dd); }
.sr-list__row { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line, #d9e2dd); background: transparent; color: inherit; font: inherit; }
.sr-list__row:last-child { border-bottom: 0; }
button.sr-list__row { cursor: pointer; min-height: 44px; }
button.sr-list__row:hover, button.sr-list__row:focus-visible { background: var(--brand-soft, #e7f4ee); }
.sr-found { margin: 6px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft, #e7f4ee); border: 1px solid var(--brand, #1a7f4b); font-size: .95rem; }
.sr-found--bad { background: #fdebea; border-color: #c0392b; }

/* routes and shops, built for a thumb on a phone: chips and rows that wrap (long town and shop names never push the page wider), taps of at least 44px */
.sr-page { min-width: 0; max-width: 100%; }
.sr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.sr-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line, #d9e2dd); border-radius: 22px; background: var(--card, #fff); color: inherit; text-decoration: none; font-size: .95rem; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere; }
.sr-chip.is-on { background: var(--brand-soft, #e7f4ee); border-color: var(--brand, #1a7f4b); font-weight: 600; }
.sr-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line, #e3e9e5); }
.sr-row:last-child { border-bottom: 0; }
.sr-row > * { min-width: 0; overflow-wrap: anywhere; }
.sr-row__main { flex: 1 1 220px; }
.sr-row__side { flex: 0 1 auto; text-align: right; }
.sr-row__btns { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.sr-row__btns .btn { flex: 1 1 130px; min-height: 44px; justify-content: center; text-align: center; }
.sr-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.sr-pick > select { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.sr-pick .btn { min-height: 44px; }
.sr-check { display: flex; gap: 12px; align-items: center; min-height: 44px; cursor: pointer; font-weight: 400; }
.sr-check input[type="checkbox"] { flex: none; width: 22px; height: 22px; }
@media (max-width: 640px) {
  .sr-row__side { text-align: left; flex-basis: 100%; }
  .sr-list__row { min-height: 52px; }
}
.sr-list { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sr-tel { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 1rem; }
[data-sr-geo] .btn, .sr-found .btn { min-height: 44px; }
.sr-row__main a { display: inline-block; padding: 11px 0; }

/* a closed <details> that looks like what it is: a button (pencil, label, arrow) */
.sr-summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line, #d9e2dd); border-radius: 12px; background: var(--card, #fff); font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.sr-summary::-webkit-details-marker { display: none; }
.sr-summary::before { content: "\270E"; font-size: 1.15rem; }
.sr-summary::after { content: "\25BE"; margin-left: auto; transition: transform .15s; }
details[open] > .sr-summary::after { transform: rotate(180deg); }
details[open] > .sr-summary { background: var(--brand-soft, #e7f4ee); border-color: var(--brand, #1a7f4b); }
/* a long town or route name must never widen the page: the phone's own drop-down takes the width of its longest option unless it is held (iPhone Safari then zooms the whole page out) */
.sr-page select, .sr-pick select, [data-sr-box] select { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; text-overflow: ellipsis; }
.sr-page, .sr-pick, [data-sr-box] { contain: inline-size; }
.sr-fixed { padding: 12px 14px; border: 1px solid var(--line, #d9e2dd); border-radius: 12px; background: var(--bg, #f6f8f7); overflow-wrap: anywhere; font-size: 1.05rem; margin-top: 4px; }
[data-sr-routesearch] { width: 100%; }

/* Routes & shops: the Manage popup is a little wider; the page list always keeps its pages bar at the bottom of the screen */
.modal--inward.modal--shop { width: min(560px, calc(100vw - 24px)); }
.pagebar { position: sticky; bottom: var(--bn, 0px); z-index: 8; margin-top: 12px; }
.pagebar .pager { position: static; margin: 0; padding: 10px 14px; background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -8px 20px -14px rgba(16, 24, 40, .22); }
/* a primary button inside an alert keeps its white label (the alert link colour made it unreadable) */
.alert a.btn--primary { color: #fff; }

/* Raw materials list (/warehouse/materials): ONE table, so Material / Purchase unit / Actions line up in every category; the category is a group heading */
html body .rm-list { padding: 0; overflow: visible; }
html body .rm-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
html body .rm-table .rm-col-unit { width: 11rem; }
html body .rm-table .rm-col-act { width: 13rem; }
html body .rm-table thead th { white-space: normal; }
html body .rm-table .rm-th-act { text-align: right; }
html body .rm-table td { vertical-align: middle; }
html body .rm-table .rm-name, html body .rm-table .rm-unit { overflow-wrap: anywhere; word-break: break-word; }
html body .rm-table .rm-row--hidden .rm-name, html body .rm-table .rm-row--hidden .rm-unit { opacity: .6; }
html body .rm-table tbody.rm-group { border-top: 0; }
html body .rm-table .rm-cat th { text-align: left; background: #eaf3ee; color: #16231C; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 700; white-space: normal; padding: 9px 14px; border-top: 2px solid var(--brand, #13784F); border-bottom: 1px solid var(--line); border-radius: 0; }
html body .rm-table tbody.rm-group:first-of-type .rm-cat th { border-top-width: 1px; }
html body .rm-table .rm-cat__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
html body .rm-table .rm-cat__name { margin: 0; font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
html body .rm-table .rm-cat__acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding: 3px 4px 3px 10px; border: 1px dashed #9db8a9; border-radius: 10px; background: #f7fbf9; }
html body .rm-table .rm-cat__label { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5b7a69; }
html body .rm-table .rm-acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
html body .rm-table .rm-acts .btn { min-width: 5.6rem; text-align: center; justify-content: center; }
html body .rm-table .rm-acts form { margin: 0; }
html body .rm-table .rm-pop { position: relative; display: inline-block; }
html body .rm-table .rm-pop > summary { list-style: none; cursor: pointer; }
html body .rm-table .rm-pop > summary::-webkit-details-marker { display: none; }
html body .rm-table .rm-pop[open] > .rm-pop__form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 6px; width: min(20rem, calc(100vw - 2rem)); padding: .7rem; margin: 0; box-shadow: 0 10px 28px -8px rgba(16, 24, 40, .35); }
html body .rm-table .rm-empty td { padding: 10px 14px; }
/* after a save: the saved row is lit for a moment; a note says why a saved material is not in the filtered list; an edit form that came back with an error shows it inside the form */
html body .rm-table .rm-row--saved td { animation: rm-saved 2.6s ease-out; }
@keyframes rm-saved { from { background: #fff3b0; } to { background: transparent; } }
html body .rm-note { position: sticky; top: 64px; z-index: 12; margin: 0 0 .6rem; }
html body .rm-pop__error { margin: 0; padding: 8px 10px; font-size: .85rem; }
html body .rm-pop__error ul { margin: 0 0 0 16px; padding: 0; }
@media (max-width: 640px) {
  html body .rm-table .rm-col-unit { width: 4.8rem; }
  html body .rm-table .rm-col-act { width: 6.4rem; }
  html body .rm-table th, html body .rm-table td { padding-left: 8px; padding-right: 8px; }
  html body .rm-table .rm-cat th { padding: 8px; }
  html body .rm-table .rm-cat__acts { width: 100%; justify-content: flex-start; padding-left: 8px; }
  html body .rm-table .rm-acts { flex-direction: column; align-items: stretch; gap: 5px; }
  html body .rm-table .rm-acts .btn { min-width: 0; width: 100%; padding-left: 6px; padding-right: 6px; }
  html body .rm-table .rm-acts .rm-pop { display: block; }
  html body .rm-note { top: 112px; }      /* below the taller phone header */
}
/* v2 */

/* the record the person just worked on (after an edit or a delete the list opens at it) and the field that failed validation */
@keyframes pos-flash { 0% { background-color: rgba(250, 204, 21, .45); } 100% { background-color: transparent; } }
.pos-flash, .pos-flash > td { animation: pos-flash 1.5s ease-out; }
input.is-invalid, select.is-invalid, textarea.is-invalid { outline: 2px solid #d92d20; outline-offset: 1px; }.pos-notice { position: sticky; top: 8px; z-index: 30; }
/* a filter bar that stays under the desktop header while a long list scrolls (desktop only; the phone has its own header) */
@media (min-width: 801px) { .filters--sticky { position: sticky; top: var(--topbar-h, 66px); z-index: 15; } }

/* CentraBrix ERP: the product block at the top of the side menu (full logo; the blocks icon when the menu is collapsed). The company keeps its own row below it. */
.side__product { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; padding: 9px 12px; margin: 0 0 12px; text-decoration: none; }
.side__product-full { display: block; width: 100%; max-width: 190px; height: auto; }
.side__product-icon { display: none; width: 28px; height: 28px; object-fit: contain; }
.side__platform { margin: 0 0 10px; padding: 0 6px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--side-ink); opacity: .85; }
@media (min-width: 801px) {
  html.side-rail .side:has([data-side-menu]) .side__product { padding: 8px 0; }
  html.side-rail .side:has([data-side-menu]) .side__product-full { display: none; }
  html.side-rail .side:has([data-side-menu]) .side__product-icon { display: block; }
  html.side-rail .side:has([data-side-menu]) .side__platform { display: none; }
}
/* Cash counter */
.cash-grid { max-width: 560px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cash-grid__row { display: grid; grid-template-columns: 4.2em 1em minmax(0, 1fr) 1em minmax(6.5em, 34%); gap: 6px; align-items: center; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.cash-grid--banks .cash-grid__row { grid-template-columns: minmax(0, 1fr) minmax(7em, 42%); }
.cash-grid__head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f6f8f7; padding-top: 8px; padding-bottom: 8px; }
.cash-grid__head span:last-child { text-align: right; }
.cash-grid__val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; margin: 0; }
.cash-grid__op { color: var(--muted); text-align: center; }
.cash-grid input { width: 100%; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; margin: 0; }
.cash-grid label { margin: 0; }
.cash-grid__amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.cash-grid__row.is-filled { background: #f2f7f4; }
.cash-grid__foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px; font-weight: 700; background: #f6f8f7; }
.cash-grid__foot b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-grand { max-width: 560px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: var(--green-dark); color: #fff; }
.cash-grand b { font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-dock { max-width: 560px; }
.cash-dock__btns { display: flex; gap: 8px; }
/* the total and Save stay at the bottom of the screen (above the phone bottom bar, where there is one) for as long as the form is on screen */
  .cash-dock { position: sticky; bottom: var(--bn, 0px); z-index: 5; display: flex; gap: 8px; align-items: stretch; background: #fff; padding: 8px 0 calc(8px + var(--safe-b)); margin-top: 6px; box-shadow: 0 -8px 12px -8px rgba(15, 23, 42, .18); }
  .content:has(.bottomnav) .cash-dock { padding-bottom: 8px; }
  .cash-dock .cash-grand { flex: 1 1 auto; min-width: 0; margin: 0; padding: 6px 12px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
  .cash-dock .cash-grand span { font-size: .72rem; opacity: .85; }
  .cash-dock .cash-grand b { font-size: 1.1rem; }
  .cash-dock__btns { flex: 0 0 auto; }
  .cash-dock__btns .btn { margin: 0; white-space: nowrap; }
.cash-row { border-bottom: 1px solid var(--line); }
.cash-row > summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.cash-row__total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-row__for { font-weight: 600; overflow-wrap: anywhere; }
#cash-purpose { max-width: 560px; }
.cash-row__body { padding: 0 0 10px 12px; }
.cash-rowwrap { border-bottom: 1px solid var(--line); }
.cash-rowwrap .cash-row { border-bottom: 0; }
.cash-row__acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
.cash-row[open] > summary { color: var(--green-dark); }
/* Monthly grid: the search box under the Employee heading */
.mgrid__search { display: block; width: 100%; margin-top: 4px; padding: 4px 8px; font-size: 12px; font-weight: 400; height: auto; }

/* hover box on a status (address book): when and by whom it was chosen; phones have no hover, so it stays hidden there */
.stip { position: relative; display: inline-block; }
.stip__c { display: none; position: absolute; left: 0; top: 100%; z-index: 40; margin-top: 6px; width: 250px; max-width: 70vw; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16, 24, 40, .2); padding: 8px 10px; white-space: normal; font-size: .82rem; font-weight: 400; line-height: 1.45; }
.stip__c strong { font-weight: 700; }
@media (hover: hover) { .stip:hover > .stip__c { display: block; } }

/* Sales person target: the month grid (sales/person-targets), drawn like its approved prototype. The frame scrolls by itself, the page never scrolls sideways. */
.stg { --s-ink: #142B49; --s-muted: #5B6B7F; --s-line: #DCE4EC; --s-soft: #EAF0F6; --s-navy: var(--brand, #142B49); --s-teal: var(--brand-accent, #10A89A); --s-teal-soft: #D5F1EE; --s-off: #F0F3F7;
    --s-good: #0B7A4B; --s-good-soft: #DDF3E8; --s-warn: #9A5B00; --s-warn-soft: #FBEBD0; --s-bad: #B42318; --s-bad-soft: #FBE3E0;
    display: flex; flex-direction: column; gap: 14px; color: var(--s-ink); }
.stg-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stg-month { display: flex; align-items: center; gap: 6px; }
.stg-month b { font-size: 1.05rem; min-width: 150px; text-align: center; }
.stg-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--s-line); background: #fff; color: var(--s-ink); border-radius: 999px; padding: 8px 14px; min-height: 38px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.stg-btn:hover { border-color: var(--s-teal); }
.stg-btn.is-on { background: var(--s-navy); color: #fff; border-color: var(--s-navy); }
.stg-btn:focus-visible, .stg select:focus-visible, .stg input:focus-visible { outline: 2px solid var(--s-teal); outline-offset: 1px; }
.stg-find { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1 1 300px; min-width: 0; margin: 0; }
.stg-find select, .stg-find input { border: 1px solid var(--s-line); background: #fff; border-radius: 12px; padding: 8px 10px; min-height: 38px; font: inherit; color: var(--s-ink); flex: 1 1 150px; min-width: 0; width: auto; }
.stg-find input[type="month"] { flex: 0 1 160px; }
.stg-search { flex: 2 1 220px; min-width: 0; border: 1px solid var(--s-line); background: #fff; border-radius: 12px; padding: 8px 10px; min-height: 38px; font: inherit; color: var(--s-ink); }
.stg-card--todo { box-shadow: inset 0 0 0 2px var(--s-warn); }
.stg-card--todo b { color: var(--s-warn); }
.stg-views { margin-left: auto; display: inline-flex; gap: 6px; }
.stg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stg-card { background: #fff; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; box-shadow: 0 1px 2px rgba(20, 43, 73, .06); }
.stg-card small { color: var(--s-muted); font-size: .76rem; }
.stg-card b { font-size: 1.3rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stg-card--main { background: var(--s-navy); color: #fff; }
.stg-card--main small { color: #B9C6D6; }
.stg-card--main b { font-size: 1.7rem; }
.stg-rec { color: var(--s-teal); }
.stg-meter { position: relative; height: 8px; border-radius: 99px; background: var(--s-soft); margin: 6px 0 3px; }
.stg-meter i { display: block; height: 100%; border-radius: 99px; max-width: 100%; }
.stg-meter u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--s-ink); opacity: .55; }
.stg-card--main .stg-meter { background: rgba(255, 255, 255, .18); }
.stg-card--main .stg-meter u { background: #fff; opacity: 1; }
.stg-card--main .stg-meter i { background: var(--s-teal) !important; }
.stg-good { background: var(--s-good); } .stg-warn { background: var(--s-warn); } .stg-bad { background: var(--s-bad); }
.stg-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: .76rem; font-variant-numeric: tabular-nums; }
.stg-pill--good { background: var(--s-good-soft); color: var(--s-good); } .stg-pill--warn { background: var(--s-warn-soft); color: var(--s-warn); } .stg-pill--bad { background: var(--s-bad-soft); color: var(--s-bad); }
.stg-frame { background: #fff; border: 1px solid var(--s-line); border-radius: 16px; overflow: auto; max-height: 72vh; }
.stg-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
.stg-table th, .stg-table td { border-bottom: 1px solid var(--s-line); border-right: 1px solid var(--s-line); padding: 0; text-align: right; white-space: nowrap; }
.stg-table thead th { position: sticky; top: 0; z-index: 3; background: var(--s-navy); color: #fff; font-size: .76rem; font-weight: 600; padding: 8px 6px; text-align: center; min-width: 84px; }
.stg-table thead th.is-off { background: color-mix(in srgb, var(--s-navy) 82%, #fff); }
.stg-table thead th.is-today { box-shadow: inset 0 -3px 0 var(--s-teal); }
.stg-table thead th small { display: block; font-weight: 400; color: #B9C6D6; font-size: .64rem; }
.stg-table .stg-dist { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; white-space: normal; padding: 8px 10px; width: 240px; min-width: 240px; max-width: 240px; vertical-align: top; }
.stg-table thead .stg-dist { z-index: 4; background: var(--s-navy); }
.stg-dist strong { display: block; font-size: .9rem; line-height: 1.25; overflow-wrap: anywhere; }
.stg-dist em { display: block; font-style: normal; color: var(--s-muted); font-size: .76rem; overflow-wrap: anywhere; }
.stg-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 5px; font-size: .76rem; color: var(--s-muted); white-space: nowrap; }
.stg-line input, .stg-line select { width: 120px; height: 28px; padding: 2px 6px; border: 1px solid var(--s-line); border-radius: 8px; font: inherit; font-weight: 600; color: var(--s-ink); background: #fff; }
.stg-line input { text-align: right; }
.stg-line select { width: auto; flex: 1 1 0; min-width: 0; height: 30px; min-height: 0; padding: 0 22px 0 6px; font-size: .8rem; line-height: 1.2; }
.stg-line select.is-empty { border-color: var(--s-warn); background: var(--s-warn-soft); }
.stg-line b, .stg-line strong { color: var(--s-ink); }
.stg-table .stg-type { position: sticky; left: 240px; z-index: 2; width: 104px; min-width: 104px; max-width: 104px; padding: 0 8px; font-size: .76rem; font-weight: 700; text-align: left; background: #fff; color: var(--s-navy); }      /* the Sale / Recovery label stays beside the distributor when the days scroll */
.stg-table thead th:nth-child(2) { left: 240px; z-index: 4; width: 104px; min-width: 104px; max-width: 104px; }
.stg-row--recovery .stg-type { color: var(--s-teal); }
.stg-row--recovery td { border-bottom-width: 2px; }
.stg-row--recovery .stg-day input, .stg-row--recovery .stg-day span { color: var(--s-teal); font-weight: 600; }
.stg-day { position: relative; height: 40px; }
.stg-day input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; text-align: right; padding: 0 8px; font: inherit; color: var(--s-ink); }
.stg-day span { display: block; min-width: 68px; padding: 9px 8px; }
.stg-day input:focus { background: var(--s-teal-soft); outline: 2px solid var(--s-teal); outline-offset: -2px; }
.stg input.is-bad, .stg select.is-bad { outline: 2px solid var(--s-bad); outline-offset: -2px; }
.stg-table td.is-off { background: var(--s-off); }
.stg-table td.is-today { box-shadow: inset 2px 0 0 var(--s-teal), inset -2px 0 0 var(--s-teal); }
.stg-group td { background: var(--s-soft); text-align: left; font-weight: 700; padding: 6px 10px; }
.stg-group td:first-child { position: sticky; left: 0; }
.stg-table tfoot td { position: sticky; bottom: 0; background: var(--s-soft); font-weight: 700; padding: 8px; z-index: 2; height: 36px; }
.stg-table tfoot tr:first-child td { bottom: 36px; }
.stg-table tfoot .stg-dist, .stg-table tfoot .stg-type { background: var(--s-soft); z-index: 3; }
.stg-status { margin: 0; font-size: .82rem; color: var(--s-muted); }
.stg-status.is-bad { color: var(--s-bad); font-weight: 700; }
.stg-sub { margin: 0; font-size: .82rem; color: var(--s-muted); }
.stg-h { margin: 8px 0 0; font-size: 1.05rem; }
.stg-days { display: flex; flex-wrap: wrap; gap: 6px; }
.stg-days .stg-btn { width: 44px; padding: 6px 0; }
.stg-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.stg-entry { background: #fff; border-radius: 16px; padding: 12px; min-width: 0; box-shadow: 0 1px 2px rgba(20, 43, 73, .06); }
.stg-entry strong { display: block; overflow-wrap: anywhere; }
.stg-entry small { color: var(--s-muted); }
.stg-entry__two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.stg-entry__two label { display: flex; flex-direction: column; gap: 2px; font-size: .76rem; color: var(--s-muted); min-width: 0; }
.stg-entry__two input { width: 100%; height: 44px; padding: 0 10px; text-align: right; border: 1px solid var(--s-line); border-radius: 12px; font-size: 1rem; color: var(--s-ink); background: #fff; }
.stg-entry__two label:last-child input, .stg-entry__two label:last-child b { color: var(--s-teal); font-weight: 600; }
.stg-entry__two b { font-size: 1rem; color: var(--s-ink); text-align: right; }
.stg-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.stg-people .stg-card b { font-size: .95rem; }
.stg-people .stg-line { margin-top: 0; font-size: .9rem; white-space: normal; }
.stg-card--open { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.stg-card--open:hover, .stg-card--open:focus-visible { box-shadow: 0 0 0 2px var(--s-teal), 0 4px 12px rgba(20, 43, 73, .12); outline: none; transform: translateY(-1px); }
/* the popup of one recovery person */
.stg-pop { --s-ink: #142B49; --s-muted: #5B6B7F; --s-line: #DCE4EC; --s-teal: var(--brand-accent, #10A89A); --s-good: #0B7A4B; --s-good-soft: #DDF3E8; --s-warn: #9A5B00; --s-warn-soft: #FBEBD0; --s-bad: #B42318; --s-bad-soft: #FBE3E0; border: 0; padding: 0; border-radius: 18px; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: #fff; color: var(--s-ink); box-shadow: 0 20px 60px rgba(20, 43, 73, .3); }
.stg-pop::backdrop { background: rgba(20, 43, 73, .45); }
.stg-pop__box { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.stg-pop__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--s-line); }
.stg-pop__head > div { flex: 1; min-width: 0; }
.stg-pop__head h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.stg-pop__head small { color: var(--s-muted); }
.stg-pop__sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; padding: 12px 16px; background: #F5F8FB; }
.stg-pop__sum small { display: block; color: var(--s-muted); font-size: .74rem; }
.stg-pop__sum b { font-size: .98rem; font-variant-numeric: tabular-nums; }
.stg-pop__list { overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
.stg-pop__dist { border: 1px solid var(--s-line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.stg-pop__line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.stg-pop__dist small { color: var(--s-muted); }
.stg-pop__kv { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .86rem; }
.stg-pop__kv b { font-variant-numeric: tabular-nums; }
.stg-pop details summary { cursor: pointer; color: var(--s-teal); font-size: .86rem; margin-top: 2px; }
.stg-pop table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 4px; }
.stg-pop th, .stg-pop td { padding: 3px 6px; border-bottom: 1px solid var(--s-line); text-align: right; }
.stg-pop th:first-child, .stg-pop td:first-child { text-align: left; }
.stg-pop td:nth-child(3) { color: var(--s-teal); font-weight: 600; }
.stg-pop__foot { margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--s-line); }
.stg-kv { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; margin-top: 3px; }
.stg-kv span { color: var(--s-muted); }
@media (max-width: 700px) {
    .stg-views { margin-left: 0; width: 100%; }
    .stg-views .stg-btn { flex: 1; }
    .stg-month { width: 100%; justify-content: space-between; }
    .stg-table .stg-dist { width: 170px; min-width: 170px; max-width: 170px; padding: 6px 8px; }
    .stg-table .stg-type, .stg-table thead th:nth-child(2) { left: 170px; }
    .stg-line { flex-wrap: wrap; } .stg-line input, .stg-line select { width: 100%; }
    .stg-frame { max-height: 64vh; }
}
.stg-dayview { display: flex; flex-direction: column; gap: 10px; }
.stg-dayview[hidden] { display: none; }

/* Side menu, design B (2026-11-14): the product logo without its white box, the company in a bordered card, "Find a page", and a ring on the page you are on.
   The same on the desktop and in the phone's drawer; only the slim icon bar is desktop-only. */
.side__product-light, .side__product-icon-light, .side__find, .side__none { display: none; }
.side__product--plain { background: none; padding: 2px 8px 0; margin: 0 0 14px; justify-content: flex-start; }
.side__product--plain .side__product-full { display: none; }
.side__product--plain .side__product-light { display: block; height: 30px; width: auto; max-width: 100%; }
.side:has([data-side-menu]) .brand { padding: 9px 10px; margin: 0 0 10px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; }
.side:has([data-side-menu]) .brand__logo, .side:has([data-side-menu]) .brand__mark { width: 34px; height: 34px; border-radius: 9px; }
.side:has([data-side-menu]) .brand__text strong { font-size: .95rem; }
.side:has([data-side-menu]) .side__find { display: flex; flex: none; align-items: center; gap: 8px; height: 36px; margin: 0 0 8px; padding: 0 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); color: var(--side-ink); cursor: text; }
.side .side__find .ico { width: 17px; height: 17px; flex: none; }
.side .side__find input { text-align: start !important; flex: 1; min-width: 0; width: auto; height: 100%; min-height: 0; margin: 0; padding: 0 !important; border: 0; border-radius: 0; background: none; box-shadow: none; color: #fff; font: inherit; font-size: .88rem; outline: 0; }
.side .side__find input::placeholder { color: var(--side-ink); opacity: .75; }
.side .side__find:focus-within { box-shadow: inset 0 0 0 1px var(--brand-accent); }
.side:has([data-side-menu]) .side__none:not([hidden]) { display: block; margin: 4px 10px; font-size: .85rem; color: var(--side-ink); }
.side nav [hidden] { display: none !important; }
/* the page you are on: a thin teal ring and a teal icon instead of the bar at the edge */
.side nav a.item.is-active { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px var(--brand-accent); }
.side nav a.item.is-active::before { display: none; }
.side nav a.item.is-active .ico { color: var(--brand-accent); }
@media (max-width: 800px) {
  /* a phone: a taller box to tap, and 16px text so the browser does not zoom into it */
  .side:has([data-side-menu]) .side__find { height: 44px; }
  .side .side__find input { font-size: 16px; }
}
@media (min-width: 801px) {
  /* the slim icon bar: the small light icon, no search box */
  html.side-rail .side:has([data-side-menu]) .side__product--plain .side__product-light { display: none; }
  html.side-rail .side:has([data-side-menu]) .side__product--plain-icon { background: none; }
  html.side-rail .side:has([data-side-menu]) .side__product--plain-icon .side__product-icon { display: none; }
  html.side-rail .side:has([data-side-menu]) .side__product--plain-icon .side__product-icon-light { display: block; width: 28px; height: 26px; }
  html.side-rail .side:has([data-side-menu]) .side__find, html.side-rail .side:has([data-side-menu]) .side__none { display: none; }
  html.side-rail .side:has([data-side-menu]) .brand { border: 0; padding: 0; }
}

/* Sign-in page, design A (2026-11-14): light and clean. On a desktop the six ERP points stand on a pale page at the left and the sign-in on a white panel at
   the right; a phone shows the sign-in card alone, on the same pale page. */
.guest { background: #f4f7fa; }
.guest .footer { color: var(--muted); }
.guest__card { box-shadow: 0 10px 30px -18px rgba(15, 32, 56, .35); border: 1px solid #e3e9f0; }
.guest__demo-m { color: var(--muted); }
.guest__demo-m a { color: var(--brand); }
@media (min-width: 960px) {
  .guest__hero { background: none; color: var(--ink); padding: 56px 6%; }
  .guest__hero::before, .guest__hero::after { content: none; }
  .guest__hero-inner { max-width: 600px; }
  .guest__hero h2 { margin: 0 0 12px; color: var(--ink); }
  .guest__hero h2 em { font-style: normal; color: var(--brand-accent); }
  .guest__hero p { color: var(--muted); }
  .guest__feats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  .guest__feats li { display: flex; gap: 12px; padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; min-width: 0; }
  .guest__feats li i { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-accent) 15%, #fff); }
  .guest__feats li svg { width: 20px; height: 20px; fill: none; stroke: var(--brand-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .guest__feats b { font-size: .98rem; color: var(--ink); }
  .guest__feats span { margin-top: 1px; font-size: .86rem; line-height: 1.45; color: var(--muted); }
  .guest__demo { margin-top: 28px; padding: 18px 0 0; border-radius: 0; background: none; border: 0; border-top: 1px solid #dce4ec; }
  .guest__demo b { color: var(--ink); }
  .guest__demo span { color: var(--muted); }
  .guest__demo a { color: #fff; background: var(--brand); }
  .guest__panel { background: #fff; border-left: 1px solid #dce4ec; }
  .guest__card { border: 0; box-shadow: none; }
}
.stg-slabs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.stg-slab { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: 0 1px 2px rgba(20, 43, 73, .06); }
.stg-slab input { width: 5.5em; min-height: 34px; text-align: right; }
.stg-people .stg-btn { align-self: flex-start; margin-top: 6px; text-decoration: none; }

.tgt-report { position: relative; display: inline-flex; align-items: center; }
/* the answer of the Share button (preparing, ready, the picture) is a small panel under the button, never over the page */
.tgt-report .report-top__result { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; flex: none; width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px -12px rgba(15, 32, 56, .45); font-size: .88rem; line-height: 1.45; text-align: left; white-space: normal; }
.tgt-report .report-top__result[hidden] { display: none; }
.tgt-report .report-top__preview { display: block; max-width: 100%; height: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }

/* Address book filter card: big search, quick dates, status chips, "More filters" */
.ab-card { gap: 10px 12px; padding: 12px 16px; align-items: center; }
.ab-search { flex: 1 1 340px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; margin: 0; border: 1px solid #c9d5e1; border-radius: 10px; background: #f8fafc; color: var(--muted); }
.ab-search:focus-within { border-color: var(--brand-accent); background: #fff; }
.ab-search input[type="search"] { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; font-size: .85rem; color: var(--ink); }
.ab-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-pill { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid #c9d5e1; border-radius: 999px; background: #fff; color: var(--brand); font-size: .76rem; font-weight: 600; text-transform: none; letter-spacing: 0; text-decoration: none; white-space: nowrap; }
.ab-pill:hover { background: var(--brand-soft); }
.ab-pill.is-on { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.ab-row { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.ab-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ab-label { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.ab-chip, .ab-seg label { position: relative; margin: 0; cursor: pointer; }
.ab-chip input, .ab-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ab-chip > span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid #c9d5e1; border-radius: 9px; background: #fff; color: var(--brand); font-size: .76rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.ab-chip > span i { font-style: normal; min-width: 22px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--brand-soft); font-size: .66rem; }
.ab-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.ab-chip input:checked + span i { background: rgba(255, 255, 255, .2); color: #fff; }
.ab-chip input:focus-visible + span, .ab-seg input:focus-visible + span { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.ab-chip--new > span { border-color: #d8b4fe; color: #5b21b6; font-weight: 700; }
.ab-chip--new > span u { width: 8px; height: 8px; border-radius: 50%; background: #7c3aed; }
.ab-chip--new > span i { background: #7c3aed; color: #fff; }
.ab-chip--new input:checked + span { background: #f3e8ff; border-color: #7c3aed; color: #5b21b6; }
.ab-chip--new input:checked + span i { background: #7c3aed; color: #fff; }
.ab-seg { display: inline-flex; border: 1px solid #c9d5e1; border-radius: 10px; overflow: hidden; }
.ab-seg span { display: block; padding: 6px 10px; font-size: .76rem; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--brand); background: #fff; }
.ab-seg label + label span { border-left: 1px solid #c9d5e1; }
.ab-seg input:checked + span { background: var(--brand-soft2); }
.ab-clear { margin-left: auto; font-size: .76rem; font-weight: 600; color: #0b7f74; text-decoration: underline; }
.ab-more { flex: 1 0 100%; border-top: 1px solid var(--line); padding-top: 10px; }
.ab-more summary { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--brand); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.ab-more summary::-webkit-details-marker { display: none; }
.ab-more summary::before { content: "\25B8"; font-size: .8rem; transition: transform .15s; }
.ab-more[open] summary::before { transform: rotate(90deg); }
.ab-more summary b { background: var(--brand); color: #fff; border-radius: 9px; font-size: .7rem; padding: 0 7px; line-height: 18px; }
.ab-more__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.ab-more__grid .filters__field { flex: none; min-width: 0; }
@media (max-width: 900px) { .ab-more__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ab-card { padding: 12px; } .ab-clear { margin-left: 0; } .ab-more__grid { grid-template-columns: 1fr; } .ab-ranges { flex-wrap: nowrap; overflow-x: auto; flex: 1 0 100%; } .ab-pill { flex: none; } }

/* the phone Filter button exists only in the staff phone look (ems-me.css shows it there) */
.rd-filter__btn { display: none; }

/* NEW shop: a soft purple tag right after the shop name (same line, centred) and a purple edge on the row */
.shop-line { display: flex; align-items: center; gap: 6px; }
.shop-line > .pop, .shop-line > strong { min-width: 0; overflow-wrap: anywhere; }
.shop-line > .badge { flex: none; }
.badge.badge--new, body.rd-admin .badge.badge--new { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 8px 2px 6px; border: 1px solid #d8b4fe; border-radius: 999px; background: #f3e8ff; color: #6d28d9; font-size: .7rem; font-weight: 700; letter-spacing: .05em; line-height: 1.4; }
.badge.badge--new::before, body.rd-admin .badge.badge--new::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #7c3aed; }
.rd-shops tbody tr.is-new > td:first-child { box-shadow: inset 3px 0 0 #7c3aed; }

/* address book table on a laptop screen: let the headings and the date columns wrap, so the table fits next to the side menu without a sideways scroll */
@media (min-width: 901px) and (max-width: 1600px) {
  body.rd-admin table.rd-shops th { white-space: normal; overflow-wrap: normal; word-break: normal; vertical-align: bottom; font-size: .7rem; letter-spacing: 0; }
  body.rd-admin table.rd-shops td[data-confirmed-at], body.rd-admin table.rd-shops tbody td:last-child { white-space: normal !important; max-width: 120px; }
  body.rd-admin table.rd-shops th, body.rd-admin table.rd-shops td { padding-left: 6px; padding-right: 6px; }
  body.rd-admin table.rd-shops select.shop-status { max-width: 112px; }
}

.ab-card .filters__field label { font-size: .68rem; }
.ab-card .filters__field select, .ab-card .filters__field input { font-size: .82rem; min-height: 32px; }

/* address book filter: compact buttons */
.ab-pill { height: 28px; padding: 0 10px; font-size: .72rem; }
.ab-chip > span { height: 28px; padding: 0 9px; gap: 5px; font-size: .72rem; border-radius: 8px; }
.ab-chip > span i { font-size: .62rem; min-width: 18px; padding: 0 5px; }
.ab-seg span { padding: 5px 9px; font-size: .72rem; }
.ab-group { gap: 4px; }
.ab-row { gap: 8px 14px; padding-top: 10px; }
.ab-search { height: 36px; }

/* address book: smaller status drop-down in the table */
body.rd-admin table.rd-shops select.shop-status, table.rd-shops select.shop-status { font-size: .74rem; min-height: 28px; padding: 3px 22px 3px 8px; border-radius: 8px; max-width: 104px; }
body.rd-admin table.rd-shops .stip .nice-select, table.rd-shops .stip .ns, table.rd-shops .stip .ns__btn { font-size: .74rem; min-height: 28px; }

/* My profile: picture + the menu avatar */
.acct__avatar { overflow: hidden; }
.acct__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-photo { display: flex; align-items: center; gap: 16px; margin: 0 0 12px; flex-wrap: wrap; }
.pf-photo img, .pf-photo__letter { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.pf-photo__letter { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-light), var(--brand-deep)); color: #fff; font-size: 1.9rem; font-weight: 700; }


/* a search box above a drop-down (public/js/select-search.js) */
.ss-box { display: block; width: 100%; margin: 0 0 6px; box-sizing: border-box; }


/* Stock page: folded batches */
.pos-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.pos-toggle .ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.pos-toggle.is-open .ico { transform: rotate(90deg); }
.pos-toggle:hover strong { text-decoration: underline; }

.stg-type__sum { display: block; margin-top: 3px; font-size: .86rem; font-weight: 700; color: var(--s-ink); white-space: nowrap; }
.stg-row--recovery .stg-type__sum { color: var(--s-teal); }
@media (max-width: 700px) { .stg-table .stg-type, .stg-table thead th:nth-child(2) { width: 92px; min-width: 92px; max-width: 92px; } .stg-type__sum { font-size: .78rem; } }

/* live search pick list (reminder-form.js) */
.cb { position: relative; }
.cb__box { display: block; width: 100%; box-sizing: border-box; }
.cb__list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 260px; overflow-y: auto; background: var(--card, #fff); border: 1px solid var(--line, #e4e9f0); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .14); padding: 4px; }
.cb__opt { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--ink, #101828); cursor: pointer; }
.cb__opt:hover, .cb__opt.is-on { background: var(--brand-soft, #e8eef6); }
.cb__opt--none { color: var(--muted, #667085); }
.cb__none { padding: 8px 10px; color: var(--muted, #667085); }
