@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); }

/* ---------- design tokens (colors follow the Customs app palette; sizes are about 10% tighter) ---------- */
:root {
  --primary: #1668d8; --primary-dark: #0f4fa8; --primary-soft: #e6effc;
  --ok: #00a587; --ok-text: #00755f; --ok-soft: #dcf5ee;
  --warn: #ef8a00; --warn-text: #9a5700; --warn-soft: #fdeccf;
  --bad: #d64545; --bad-text: #b02f2f; --bad-soft: #fbe3e3;
  --indigo: #5b5fd6; --indigo-soft: #e6e7fa;
  --bg: #f4f7fb; --card: #fff; --ink: #0f1b2d; --muted: #5b6b80; --line: #dde5ef;
  --field-off: #eef2f7; --off-ink: #55616c; --chip-bg: #e9eef5; --chip-ink: #37475c; --indigo-ink: #3a3eaa; --tint: #f3f8ff; --press: #e9eff7;
  --info-ink: #0f4fa8; --bar-from: #1668d8; --bar-to: #0f4fa8; --toast-bg: #0f1b2d; color-scheme: light;
  --radius: 14px; --tap: 44px; --nav-h: 56px; --top-h: 52px;
  --shadow: 0 1px 2px rgb(15 27 45 / .06), 0 3px 12px rgb(15 27 45 / .06);
  font-family: Vazirmatn, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); line-height: 1.55; font-size: 15px;
}
/* dark theme: set by ui.js (data-theme on <html>) */
:root[data-theme=dark] {
  --primary: #3b82e0; --primary-dark: #1d4f94; --primary-soft: #1b3152;
  --ok: #0a9b82; --ok-text: #4fd1b5; --ok-soft: #10352f;
  --warn: #c97800; --warn-text: #f2b45a; --warn-soft: #3a2a0d;
  --bad: #c94b4b; --bad-text: #ff9a9a; --bad-soft: #3d1c20;
  --indigo: #6a6fe0; --indigo-soft: #262850; --indigo-ink: #b6b9ff;
  --bg: #0d131c; --card: #17202c; --ink: #e7edf5; --muted: #98a8bd; --line: #2b3849;
  --field-off: #121a25; --off-ink: #8f9db0; --chip-bg: #263243; --chip-ink: #c8d4e4; --tint: #1b2839; --press: #222e3f;
  --info-ink: #a9cbff; --bar-from: #17355f; --bar-to: #102441; --toast-bg: #334155; color-scheme: dark;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 3px 12px rgb(0 0 0 / .3);
}
:root[data-theme=dark] .linkbtn, :root[data-theme=dark] .btn.soft, :root[data-theme=dark] .ibtn:not(.call, .wa, .dng, .plain), :root[data-theme=dark] .chip.info, :root[data-theme=dark] .nav a.on { color: var(--info-ink); }
:root[data-theme=dark] .ibtn.wa { background: #123a24; color: #5fe08f; }
:root[data-theme=dark] .btn.danger { border-color: #6b3338; }
@media (min-width: 900px) { :root[data-theme=dark] .nav a.on.sub { color: var(--muted); } }
:root[data-theme=dark] .auth .logo { background: #fff; border-radius: 24px; padding: 8px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); overscroll-behavior-y: none; }
h1 { font-size: 1.15rem; margin: 0; font-weight: 700; } h2 { font-size: .95rem; margin: 0; font-weight: 700; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
input, select { width: 100%; min-height: var(--tap); padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 16px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(22 104 216 / .35); outline-offset: 1px; }
input:disabled, select:disabled { background: var(--field-off); color: var(--off-ink); }
[dir=rtl] input[dir=ltr] { text-align: left; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 24px; height: 24px; }

/* ---------- shell ---------- */
.shell { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.scroller { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; position: relative; }
/* the app's own scrollbars (standard properties for Firefox, -webkit- for the rest) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; } }
.topbar { position: relative; flex: none; z-index: 20; background: linear-gradient(100deg, var(--bar-from), var(--bar-to)); color: #fff;
  padding-top: env(safe-area-inset-top); }
.topbar-in { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-inline: .75rem; max-width: 1100px; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.brand-mark img { width: 28px; height: 28px; object-fit: contain; }
.brand strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userpill { display: flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .5rem 0 .3rem; border: 0; border-radius: 999px; background: rgb(255 255 255 / .16); color: #fff; cursor: pointer; max-width: 220px; }
[dir=rtl] .userpill { padding: 0 .3rem 0 .5rem; }
.userpill:hover { background: rgb(255 255 255 / .24); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.userpill span.nm { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-wrap { position: relative; display: flex; justify-content: flex-end; min-width: 0; }
.menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 30; min-width: 210px; background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: 0 8px 30px rgb(15 27 45 / .22); padding: .4rem; }
.menu .who { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; } .menu .who strong { display: block; font-size: .95rem; }
.menu button { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 42px; padding: 0 .7rem; border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: start; font-size: .9rem; }
.menu button:hover { background: var(--bg); } .menu button.dng { color: var(--bad-text); }
.scrim { position: fixed; inset: 0; z-index: 25; }
.content { width: 100%; max-width: 1100px; margin-inline: auto; padding: .85rem .8rem; padding-block-end: calc(var(--nav-h) + 5.5rem); }

.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 22; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-block-end: env(safe-area-inset-bottom); }
.nav a { flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 700; }
.nav a .pill { width: 52px; height: 26px; border-radius: 999px; display: grid; place-items: center; transition: background .15s; }
.nav a.on { color: var(--primary); } .nav a.on .pill { background: var(--primary-soft); }

/* ---------- primitives ---------- */
.row { display: flex; align-items: center; gap: .6rem; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; } .gap { gap: 1rem; } .gap-s { gap: .4rem; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.muted { color: var(--muted); } .small { font-size: .8rem; } .dim { opacity: .6; } .grow { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.page-head .count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 .45rem; margin-inline-start: .35rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .75rem; font-weight: 700; vertical-align: middle; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem; }
.sec-title { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .01em; }
.cards { display: grid; grid-template-columns: 1fr; gap: .7rem; }
.owe { color: var(--bad-text); } .paid { color: var(--ok-text); }

/* entry card with the status stripe on the side */
.entry { --stripe: var(--warn); position: relative; cursor: pointer; display: flex; flex-direction: column; gap: .35rem; padding: .8rem .9rem; border-inline-start: 5px solid var(--stripe); }
.entry.s-pending { --stripe: var(--warn); } .entry.s-verified { --stripe: var(--ok); } .entry.s-rejected { --stripe: var(--bad); }
.entry:active { background: var(--tint); } .entry.ro .nm { opacity: .92; }
.entry .nm { font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; line-height: 1.35; }
.entry .sub { color: var(--muted); font-size: .85rem; }
.entry .foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-top: .3rem; border-top: 1px dashed var(--line); margin-top: .1rem; }
.entry .amt { font-weight: 700; font-size: .95rem; }
.ticks { display: flex; gap: .9rem; font-size: .8rem; } .tk { display: inline-flex; align-items: center; gap: .25rem; color: var(--bad-text); } .tk.on { color: var(--ok-text); }

.chip { display: inline-flex; align-items: center; gap: .3rem; height: 24px; padding: 0 .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); } .chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.bad { background: var(--bad-soft); color: var(--bad-text); } .chip.info { background: var(--primary-soft); color: var(--primary); } .chip.indigo { background: var(--indigo-soft); color: var(--indigo-ink); }
.chip.lg { height: 30px; padding: 0 .8rem; font-size: .85rem; }

.btn { min-height: var(--tap); padding: .35rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 700; font-size: .9rem; transition: transform .12s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn.danger { color: var(--bad-text); border-color: #f1c6c6; }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.small { min-height: 36px; padding: .15rem .75rem; font-size: .8rem; border-radius: 10px; } .btn.block { width: 100%; } .btn:disabled { opacity: .55; cursor: not-allowed; }
.ibtn { width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary); cursor: pointer; text-decoration: none; }
.ibtn.call { background: var(--ok-soft); color: var(--ok-text); } .ibtn.wa { background: #d9f7e3; color: #128c4a; } .ibtn.plain { background: transparent; color: var(--muted); } .ibtn.plain:hover { background: var(--bg); }
.ibtn.dng { background: var(--bad-soft); color: var(--bad-text); }
.fab { position: fixed; inset-inline: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + .8rem); z-index: 21; display: flex; justify-content: center; pointer-events: none; }
.fab button { pointer-events: auto; height: 48px; padding: 0 1.4rem; display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; font-size: .95rem; box-shadow: 0 6px 18px rgb(22 104 216 / .4); cursor: pointer; }
.fab button:active { transform: scale(.96); }
.alert { padding: .6rem .85rem; border-radius: 12px; background: var(--bad-soft); color: var(--bad-text); font-size: .88rem; } .alert.info { background: var(--primary-soft); color: var(--info-ink); }
.toast { position: fixed; inset-inline: 1rem; bottom: calc(var(--nav-h) + 4.8rem); z-index: 60; max-width: 420px; margin-inline: auto; padding: .7rem 1rem; border-radius: 12px; background: var(--toast-bg); color: #fff; text-align: center; font-size: .9rem; box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
.toast.err { background: var(--bad-text); }
.spinner { width: 22px; height: 22px; margin: 1rem auto; border: 3px solid #cfd8e4; border-top-color: var(--primary); border-radius: 50%; animation: sp .7s linear infinite; }
.btn.primary .spinner { margin: 0 auto; border-color: rgb(255 255 255 / .4); border-top-color: #fff; } @keyframes sp { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; } .field .lbl { font-size: .78rem; color: var(--muted); font-weight: 700; }
.field.has-error input, .field.has-error select, .datepicker.has-error .dp-field { border-color: var(--bad); } .field .err { color: var(--bad-text); font-size: .78rem; }
.with-action { display: flex; gap: .45rem; align-items: center; } .with-action input { flex: 1; min-width: 0; }
.pin { letter-spacing: .5em; text-align: center; font-size: 1.3rem; }
.pwbox { position: relative; direction: ltr; } .pwbox input { padding-inline-end: 2.8rem; } .pwbox .ibtn { position: absolute; inset-inline-end: 3px; top: 3px; width: 38px; height: 38px; background: transparent; color: var(--muted); }
.tick { position: relative; display: flex; align-items: center; gap: .55rem; min-height: var(--tap); padding: .25rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; flex: 1; font-size: .9rem; min-width: 0; }
.tick input { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.tick .box { width: 22px; height: 22px; border: 2px solid #9aabbd; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.tick.on { border-color: var(--ok); background: var(--ok-soft); } .tick.on .box { background: var(--ok); border-color: var(--ok); } .tick.off { cursor: default; opacity: .8; }
.tick:focus-within { outline: 3px solid rgb(22 104 216 / .35); }
.pair { display: flex; gap: .6rem; } .pair > * { min-width: 0; }          /* Passport + Slip: always side by side */
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg button { flex: 1 1 auto; min-height: 40px; padding: .25rem .7rem; border: 0; background: transparent; cursor: pointer; font-size: .85rem; border-inline-end: 1px solid var(--line); }
.seg button:last-child { border-inline-end: 0; } .seg button.on { background: var(--primary); color: #fff; font-weight: 700; }
.seg button.on.green { background: var(--ok); } .seg button.on.amber { background: var(--warn); } .seg button.on.red { background: var(--bad); } .seg button.on.indigo { background: var(--indigo); } .seg button.on.blue { background: var(--primary); }
.totals { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .55rem .8rem; background: var(--bg); border-radius: 12px; font-size: .88rem; }
.savebar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + .4rem); z-index: 4; padding: .4rem 0; }
.savebar .btn { box-shadow: 0 6px 18px rgb(22 104 216 / .35); }
.pay { padding: .45rem 0; border-bottom: 1px solid var(--line); } .pay:last-of-type { border-bottom: 0; } .pay-form { margin-top: .4rem; padding-top: .8rem; border-top: 2px dashed var(--line); }
.back { display: inline-flex; align-items: center; gap: .3rem; height: 36px; padding: 0 .8rem 0 .6rem; border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; font-size: .85rem; font-weight: 700; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .7rem 0; }
.hero h1 { font-size: 1.25rem; overflow-wrap: anywhere; }

/* ---------- search, chips, filters ---------- */
.searchbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: 0 .4rem 0 .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); }
[dir=rtl] .searchbox { padding: 0 .8rem 0 .4rem; } .searchbox:focus-within { outline: 3px solid rgb(22 104 216 / .35); border-color: var(--primary); }
.searchbox input { border: 0; outline: 0; min-height: 40px; padding: 0 .2rem; background: transparent; } .searchbox input::-webkit-search-cancel-button { display: none; }
.filterbtn { position: relative; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; } .filterbtn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.filterbtn .dot { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-inline: -.8rem; padding-inline: .8rem; } .chips::-webkit-scrollbar { display: none; }
.chipbtn { flex: none; height: 32px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chipbtn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; }
.sortsel { width: auto; min-height: 30px; padding: 0 .4rem; border: 0; background: transparent; color: var(--ink); font-size: .8rem; font-weight: 700; }
.ownersel { width: auto; max-width: 42%; min-height: var(--tap); }
.alert.warn { background: var(--warn-soft); color: var(--warn-text); margin-top: .3rem; }

.grid2.two { grid-template-columns: 1fr 1fr; gap: .6rem; } .grid2.two select, .grid2.two .dp-field { font-size: .85rem; }
.sticky-actions { position: sticky; bottom: calc(-1rem - env(safe-area-inset-bottom)); background: var(--card); padding: .6rem 0 .2rem; border-top: 1px solid var(--line); }

/* ---------- attachments ---------- */
.tiles { display: grid; grid-template-columns: 1fr; gap: .6rem; } .tiles.lib { grid-template-columns: repeat(2, 1fr); }
.tile { display: flex; gap: .7rem; padding: .55rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); min-width: 0; } .tile.gone { opacity: .65; }
.tiles.lib .tile { flex-direction: column; }
.thumb { flex: none; position: relative; width: 78px; height: 78px; border: 0; border-radius: 10px; overflow: hidden; background: var(--bg); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.tiles.lib .thumb { width: 100%; height: 110px; } .thumb img { width: 100%; height: 100%; object-fit: cover; } .thumb .ext { position: absolute; bottom: 4px; font-size: .65rem; font-weight: 700; }
.tmeta { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 0; flex: 1; } .tname { font-size: .85rem; overflow-wrap: anywhere; line-height: 1.3; }
.viewer { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 12px; background: var(--bg); }
.progress { position: relative; height: 34px; border-radius: 10px; background: var(--primary-soft); overflow: hidden; display: flex; align-items: center; padding: 0 .7rem; }
.progress span { position: absolute; inset-block: 0; inset-inline-start: 0; background: rgb(22 104 216 / .25); transition: width .15s; } .progress small { position: relative; color: var(--info-ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; } .meter span { display: block; height: 100%; background: var(--primary); } .meter.hot span { background: var(--bad); }

/* ---------- workflow: stages, dashboard, notifications ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; border-inline-start: 2px solid var(--line); padding-inline-start: .8rem; }
.timeline li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; } .stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .7rem .4rem; border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--ink); border-top: 4px solid var(--line); }
.stat .n { font-size: 1.5rem; font-weight: 700; line-height: 1.2; } .stat .l { font-size: .75rem; color: var(--muted); text-align: center; }
.stat.ok { border-top-color: var(--ok); } .stat.warn { border-top-color: var(--warn); } .stat.bad { border-top-color: var(--bad); } .stat:active { background: var(--press); }
.inboxrow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px dashed var(--line); } .inboxrow:last-child { border-bottom: 0; } .inboxrow a { text-decoration: none; }
.bellbtn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .16); color: #fff; text-decoration: none; } .bellbtn:hover { background: rgb(255 255 255 / .24); }
.themebtn { border: 0; cursor: pointer; padding: 0; }
.bellbtn .dot { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--primary-dark); }
.note { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: start; padding: .7rem .8rem; border: 0; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; }
.note.unread { background: var(--tint); border-inline-start: 4px solid var(--primary); }
.note .nicon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.note .ntext { display: block; font-size: .9rem; line-height: 1.45; } .dotmark { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgb(10 20 35 / .5); }
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .8rem; padding-block-end: calc(1rem + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* ---------- date picker ---------- */
.dp-field { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: var(--tap); padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; text-align: start; color: var(--primary); }
.dp-field span.v { color: var(--ink); } .dp-field:disabled { background: var(--field-off); cursor: default; } .dp-field .ph { color: #8895a7; } .dp-field small { margin-inline-start: auto; color: var(--muted); }
.dp-head { display: flex; align-items: center; gap: .4rem; } .dp-head select { min-height: 40px; flex: 1; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; } .dp-wd { text-align: center; font-size: .75rem; color: var(--muted); padding: .2rem 0; } .dp-wd.fri, .dp-day.fri { color: var(--bad-text); }
.dp-day { min-height: 40px; border: 1px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; }
.dp-day:hover { border-color: #9cc3e4; } .dp-day.today { border-color: var(--primary); } .dp-day.sel { background: var(--primary); color: #fff; font-weight: 700; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .9rem; padding: 1.2rem 1rem; }
.auth .card { width: 100%; max-width: 380px; padding: 1.1rem; }
.auth .logo { width: 132px; height: 132px; object-fit: contain; }
.auth h1 { color: var(--info-ink); font-size: 1.3rem; margin-top: -.4rem; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang-switch button { border: 0; background: transparent; padding: .3rem .9rem; cursor: pointer; font-size: .85rem; } .lang-switch button.on { background: var(--primary); color: #fff; }

/* ---------- responsive ---------- */
@media (min-width: 720px) {
  .tiles:not(.lib) { grid-template-columns: repeat(2, 1fr); } .tiles.lib { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr 1fr; }
  .overlay { align-items: center; } .sheet { border-radius: 20px; }
}
/* ---------- entries table (desktop) ---------- */
.etable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .84rem; }
.etable th { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 2px solid var(--line); text-align: start; padding: 0; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.etable th.c-xl:last-child { padding: .55rem .6rem; }
.etable th button { display: flex; align-items: center; gap: .25rem; width: 100%; padding: .55rem .6rem; border: 0; background: none; font-weight: 700; cursor: pointer; }
.etable th.num button { justify-content: flex-end; }
.etable th .arrow { font-size: .6rem; opacity: .4; } .etable th[aria-sort$=ing] { color: var(--primary); } .etable th[aria-sort$=ing] .arrow { opacity: 1; }
.etable td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: break-word; }
.etable td:nth-child(2) { min-width: 130px; }
.etable tbody tr { cursor: pointer; } .etable tbody tr:hover td { background: var(--tint); } .etable tbody tr:last-child td { border-bottom: 0; }
.etable td:first-child { border-inline-start: 4px solid var(--warn); } .etable tr.s-verified td:first-child { border-inline-start-color: var(--ok); } .etable tr.s-rejected td:first-child { border-inline-start-color: var(--bad); }
.etable td a { font-weight: 700; text-decoration: none; } .etable .num { text-align: end; white-space: nowrap; } .etable .nw { white-space: nowrap; overflow-wrap: normal; } .etable .amt { font-weight: 700; }
@media (max-width: 1599px) { .etable .c-xl { display: none; } }
@media (max-width: 1365px) { .etable .c-lg { display: none; } }
@media (max-width: 1099px) { .etable .c-md { display: none; } }

img.avatar { object-fit: cover; }
.profile .avatar { width: 64px; height: 64px; font-size: 1.5rem; background: var(--primary-soft); } .profile label.btn { cursor: pointer; }
.scrollrow { position: relative; }
.scrollrow.more-end .chips { -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
[dir=rtl] .scrollrow.more-end .chips { -webkit-mask-image: linear-gradient(to left, #000 80%, transparent); mask-image: linear-gradient(to left, #000 80%, transparent); }
.nudge { position: absolute; top: 2px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--primary); box-shadow: var(--shadow); cursor: pointer; }
.nudge.start { inset-inline-start: -6px; } .nudge.end { inset-inline-end: -6px; }
.entry, .etable tbody tr { -webkit-touch-callout: none; } .entry { user-select: none; }
.ibtn.more { width: 28px; height: 28px; }
fieldset.quick { border: 0; margin: 0; padding: 0; min-width: 0; }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; font-size: .84rem; }
.pager select { width: auto; min-height: 34px; font-size: .84rem; } .pager .goto { width: 6.5rem; min-height: 34px; font-size: .84rem; }
.pg { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; padding: 0 .6rem; border: 1px solid var(--line); border-radius: 9px; background: var(--card); cursor: pointer; font-weight: 700; }
.pg.on { background: var(--primary); border-color: var(--primary); color: #fff; } .pg:disabled { opacity: .45; cursor: default; }

/* ---------- loading, network, errors ---------- */
.loadbar { position: fixed; inset-inline: 0; top: env(safe-area-inset-top); z-index: 80; height: 3px; overflow: hidden; pointer-events: none; background: rgb(59 130 224 / .25); }
.loadbar span { position: absolute; inset-block: 0; width: 40%; background: #4fd1b5; animation: slide 1s ease-in-out infinite; }
@keyframes slide { from { left: -40%; } to { left: 100%; } }
body.saving .btn, body.saving .ibtn, body.saving .seg button, body.saving .tick { pointer-events: none; opacity: .65; }
.netbanner { position: fixed; inset-inline: 0; top: calc(env(safe-area-inset-top) + var(--top-h)); z-index: 70; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .35rem .8rem; font-size: .82rem; font-weight: 700; text-align: center; }
.netbanner.offline { background: var(--bad-text); color: var(--card); } .netbanner.slow { background: var(--warn-soft); color: var(--warn-text); } .netbanner.back { background: var(--ok-soft); color: var(--ok-text); }
.errview { align-items: center; text-align: center; max-width: 420px; margin: 1rem auto; }
.errview p { margin: 0; } .errico { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--bad-soft); color: var(--bad-text); }
.game { width: 100%; max-width: 340px; } .game canvas { width: 100%; height: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; touch-action: none; cursor: pointer; }

.side-only { display: none !important; }
@media (min-width: 900px) {
  .shell { --side: 236px; --nav-h: 0px; padding-inline-start: var(--side); }
  .shell.mini { --side: 68px; }
  .side-only { display: flex !important; }
  .nav { top: 0; bottom: 0; inset-inline-start: 0; inset-inline-end: auto; width: var(--side); flex-direction: column; gap: 2px; padding: .6rem .6rem .8rem; overflow-y: auto;
    background: var(--card); border: 0; border-inline-end: 1px solid var(--line); z-index: 23; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; height: 40px; gap: .7rem; padding: 0 .7rem; border-radius: 10px; font-size: .88rem; white-space: nowrap; }
  .nav a .pill { width: 22px; height: 22px; background: transparent !important; }
  .nav a:hover { background: var(--bg); }
  .nav a.on, .nav a.on:hover { background: var(--primary-soft); color: var(--primary); }
  .nav a.on.sub { background: transparent; color: var(--muted); }
  .side-brand { align-items: center; gap: .55rem; min-height: 44px; padding: 0 .2rem; margin-bottom: .3rem; text-decoration: none; }
  .side-brand .brand-mark { border: 1px solid var(--line); } .side-brand strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav .side-brand { height: auto; flex: none; color: var(--ink); font-size: .95rem; }
  .nav-group { padding: .8rem .7rem .25rem; font-size: .68rem; font-weight: 700; color: var(--muted); }
  .nav-toggle { margin-top: auto; flex: none; align-items: center; gap: .7rem; height: 38px; padding: 0 .7rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: .82rem; }
  .nav-toggle:hover { background: var(--bg); }
  [dir=rtl] .nav-toggle .ic { transform: scaleX(-1); } .shell.mini .nav-toggle .ic { transform: scaleX(-1); } [dir=rtl] .shell.mini .nav-toggle .ic { transform: none; }
  .shell.mini .nav a, .shell.mini .nav-toggle { justify-content: center; padding: 0; gap: 0; }
  .shell.mini .nav .lb, .shell.mini .side-brand strong { display: none; }
  .shell.mini .nav-group { height: 1px; padding: 0; margin: .5rem .4rem; background: var(--line); font-size: 0; }
  .topbar { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); }
  .topbar-in { max-width: none; justify-content: flex-end; padding-inline: 1.4rem; }
  .topbar .brand { display: none; }
  .topbar .userpill, .topbar .bellbtn { background: var(--bg); color: var(--ink); }
  .topbar .bellbtn:hover { background: var(--press); }
  .topbar .userpill .avatar { background: var(--primary); color: #fff; }
  .topbar .bellbtn .dot { border-color: var(--card); }
  .content { max-width: 1280px; padding: 1.2rem 1.4rem; padding-block-end: 6rem; }
  .content:has(.etable) { max-width: 1700px; }
  .content:has(.pager) { padding-block-end: 5.5rem; }
  .content:has(.fab) .pager { padding-inline-end: 11rem; }
  .sortbox { display: none; }                      /* the table headers sort */
  .fab, .toast { inset-inline-start: var(--side, 0px); }
  .fab { inset-inline-end: 1.4rem; justify-content: flex-end; bottom: 1.4rem; } .savebar { bottom: 1rem; } .toast { bottom: 5.5rem; }
}
@media (min-width: 1100px) { .tiles.lib { grid-template-columns: repeat(4, 1fr); } .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .form-page { max-width: 820px; margin-inline: auto; } }
@media (max-width: 430px) { .userpill span.nm { display: none; } .userpill { padding: 0 .3rem; } .brand strong { font-size: .95rem; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } * { transition-duration: .01ms !important; } }
