/* Bangla font (only downloaded when Bangla text is on the page) */
@font-face { font-family: "Hind Siliguri"; font-style: normal; font-weight: 400; font-display: swap; src: url(../vendor/fonts/hind-siliguri-bengali-400-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-style: normal; font-weight: 500; font-display: swap; src: url(../vendor/fonts/hind-siliguri-bengali-500-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-style: normal; font-weight: 600; font-display: swap; src: url(../vendor/fonts/hind-siliguri-bengali-600-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-style: normal; font-weight: 700; font-display: swap; src: url(../vendor/fonts/hind-siliguri-bengali-700-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
/* =========================================================
   RiceMill ERP — theme
   Palette: paddy-field green + rice-grain gold on warm paper
   ========================================================= */
:root {
  --rm-primary: #1d6b47;
  --rm-primary-600: #175a3b;
  --rm-primary-050: #e8f3ed;
  --rm-accent: #c98a00;
  --rm-accent-050: #fbf3df;
  --rm-sidebar: #0e261b;
  --rm-sidebar-2: #143425;
  --rm-sidebar-ink: #c9d8cf;
  --rm-bg: #f4f5f0;
  --rm-surface: #ffffff;
  --rm-ink: #17201b;
  --rm-ink-2: #56605a;
  --rm-line: #e3e6df;
  --rm-radius: 12px;
  --sidebar-w: 264px;
  --bs-primary: #1d6b47;
  --bs-primary-rgb: 29,107,71;
  --bs-link-color: #1d6b47;
  --bs-link-color-rgb: 29,107,71;
  --bs-link-hover-color: #134a31;
  --bs-body-font-family: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--rm-bg);
  --bs-body-color: var(--rm-ink);
  --bs-border-color: var(--rm-line);
  --bs-border-radius: .55rem;
}
[data-bs-theme="dark"] {
  --rm-primary: #3fa877;
  --rm-primary-600: #2f8f62;
  --rm-primary-050: #17301f;
  --rm-accent: #e0a92b;
  --rm-accent-050: #2f2713;
  --rm-sidebar: #0a1712;
  --rm-sidebar-2: #10241a;
  --rm-bg: #0f1311;
  --rm-surface: #171c19;
  --rm-ink: #e8ece9;
  --rm-ink-2: #a3ada7;
  --rm-line: #2a312d;
  --bs-primary: #3fa877;
  --bs-primary-rgb: 63,168,119;
  --bs-link-color: #5cc191;
  --bs-link-color-rgb: 92,193,145;
  --bs-body-bg: var(--rm-bg);
  --bs-body-color: var(--rm-ink);
  --bs-border-color: var(--rm-line);
  --bs-secondary-bg: #1d2420;
  --bs-tertiary-bg: #1a201d;
}

html, body { background: var(--rm-bg); color: var(--rm-ink); }
body { font-size: clamp(.84rem, .8rem + .22vw, .95rem); -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
img, svg, canvas { max-width: 100%; }
a { text-decoration: none; }

/* ---------- Bootstrap primary overrides ---------- */
.btn-primary {
  --bs-btn-bg: var(--rm-primary); --bs-btn-border-color: var(--rm-primary);
  --bs-btn-hover-bg: var(--rm-primary-600); --bs-btn-hover-border-color: var(--rm-primary-600);
  --bs-btn-active-bg: var(--rm-primary-600); --bs-btn-active-border-color: var(--rm-primary-600);
  --bs-btn-disabled-bg: var(--rm-primary); --bs-btn-disabled-border-color: var(--rm-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--rm-primary); --bs-btn-border-color: var(--rm-primary);
  --bs-btn-hover-bg: var(--rm-primary); --bs-btn-hover-border-color: var(--rm-primary);
  --bs-btn-active-bg: var(--rm-primary); --bs-btn-active-border-color: var(--rm-primary);
}
.text-primary { color: var(--rm-primary) !important; }
.bg-primary { background-color: var(--rm-primary) !important; }
.form-control:focus, .form-select:focus { border-color: var(--rm-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15); }
.form-check-input:checked { background-color: var(--rm-primary); border-color: var(--rm-primary); }
.page-link { color: var(--rm-primary); }
.active > .page-link, .page-link.active { background-color: var(--rm-primary); border-color: var(--rm-primary); }
.nav-pills .nav-link.active { background: var(--rm-primary); }
.form-control, .form-select, .input-group-text { background-color: var(--rm-surface); }
.input-group-text { color: var(--rm-ink-2); }
.form-control[readonly] { background-color: color-mix(in srgb, var(--rm-bg) 60%, var(--rm-surface)); }
.form-label { font-size: .78rem; font-weight: 600; color: var(--rm-ink-2); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--rm-sidebar) !important; color: var(--rm-sidebar-ink);
  display: flex; flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030; }
  .main { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { --bs-offcanvas-width: 284px; background: var(--rm-sidebar); }
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.05rem 1rem .9rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.brand-text small { color: #93ab9d; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #e6b43a, #c98a00); color: #fff8e6; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark.lg { width: 64px; height: 64px; border-radius: 16px; }
.brand-mark.lg svg { width: 40px; height: 40px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; background: #fff; }
.login-logo { width: 84px; height: 84px; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 8px; margin-bottom: 1rem; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.login-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-set { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.logo-prev { width: 120px; height: 90px; flex: 0 0 auto; border: 1px dashed var(--rm-line); border-radius: 12px; display: grid; place-items: center; background: #fff; overflow: hidden; text-align: center; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .6rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: #2a4a3a transparent; }
.nav-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6f8c7c; padding: 1rem .75rem .35rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .7rem; color: var(--rm-sidebar-ink); padding: .52rem .75rem;
  border-radius: 8px; font-size: .9rem; margin-bottom: 1px;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--rm-primary); color: #fff; }
.sidebar .nav-group .caret { margin-left: auto; font-size: .75rem; transition: transform .2s; }
.sidebar .nav-group.collapsed .caret { transform: rotate(-90deg); }
.sidebar .nav-group.open { color: #fff; }
.nav-sub { margin: .1rem 0 .35rem 1.35rem; padding-left: .75rem; border-left: 1px solid rgba(255,255,255,.1); }
.sidebar .nav-link.sub { padding: .38rem .65rem; font-size: .85rem; color: #a9bdb1; }
.sidebar .nav-link.sub.active { background: rgba(230,180,58,.16); color: #f3cd6d; }
.nav-subhead { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #6f8c7c; padding: .55rem .65rem .2rem; display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.nav-subhead::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.07); }
.nav-sub > .nav-subhead:first-of-type { padding-top: .2rem; }
.sidebar-foot { font-size: .72rem; color: #5f7a6b; padding: .7rem 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1.25rem; background: color-mix(in srgb, var(--rm-surface) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rm-line); min-height: 60px;
}
.topbar-title { font-weight: 600; color: var(--rm-ink-2); }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink); padding: 0; }
.btn-icon:hover { background: var(--rm-primary-050); }
.btn-icon i { font-size: 1.15rem; }
.btn-user { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--rm-line); background: var(--rm-surface); border-radius: 12px; padding: .25rem .6rem .25rem .3rem; color: var(--rm-ink); }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--rm-primary); color: #fff; font-weight: 700; font-size: .85rem; }
.content { padding: 1.25rem; flex: 1; }
@media (min-width: 1200px) { .content { padding: 1.5rem 1.75rem; } }
@media (max-width: 575.98px) { .content { padding: .9rem .75rem; } .topbar { padding: .5rem .75rem; } }
.app-footer { font-size: .75rem; color: var(--rm-ink-2); padding: .75rem 1.25rem 1.25rem; }

/* ---------- Page header ---------- */
.page-title { font-size: clamp(1.08rem, .95rem + .7vw, 1.5rem); font-weight: 700; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.page-sub { color: var(--rm-ink-2); font-size: .85rem; margin-top: .15rem; }
@media (max-width: 575.98px) {
  .page-title { font-size: 1.15rem; }
  .page-actions .btn span { display: none; }
  .page-actions .btn.btn-primary span, .page-actions .btn.keep-label span { display: inline; }
}

/* ---------- Cards ---------- */
.card { --bs-card-bg: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); box-shadow: 0 1px 2px rgba(16,24,20,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--rm-line); padding: clamp(.6rem, .45rem + .4vw, .85rem) clamp(.75rem, .55rem + .6vw, 1.1rem); font-weight: 600; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-header .card-tools { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-bar { padding: .8rem 1rem; }
.filter-bar .form-label { font-size: .7rem; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; gap: clamp(.5rem, .3rem + .6vw, .85rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
@media (max-width: 575.98px) { .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; } }
.stat-card { background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: clamp(.65rem, .5rem + .5vw, 1rem); display: flex; gap: .85rem; align-items: flex-start; min-width: 0; container-type: inline-size; }
.stat-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; }
.stat-body { min-width: 0; }
.stat-label { font-size: clamp(.64rem, .6rem + .2vw, .74rem); text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); font-weight: 600; overflow-wrap: anywhere; }
.stat-value { font-size: 1.2rem; font-size: clamp(.84rem, 7.4cqi, 1.4rem); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: clamp(.66rem, .62rem + .2vw, .76rem); color: var(--rm-ink-2); overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .stat-card { flex-direction: column; gap: .5rem; padding: .75rem; }
  .stat-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 1rem; }
}
.tone-primary .stat-icon { background: var(--rm-primary-050); color: var(--rm-primary); }
.tone-accent .stat-icon  { background: var(--rm-accent-050); color: var(--rm-accent); }
.tone-blue .stat-icon    { background: rgba(42,120,214,.12); color: #2a78d6; }
.tone-red .stat-icon     { background: rgba(208,59,59,.12); color: #d03b3b; }
.tone-violet .stat-icon  { background: rgba(74,58,167,.12); color: #6a5bd0; }
.tone-orange .stat-icon  { background: rgba(235,104,52,.12); color: #eb6834; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .62rem .8rem; border-bottom-color: var(--rm-line); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); font-weight: 700; background: color-mix(in srgb, var(--rm-bg) 60%, var(--rm-surface)); white-space: nowrap; }
.table tfoot td, .table tfoot th { font-weight: 700; background: color-mix(in srgb, var(--rm-bg) 60%, var(--rm-surface)); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--rm-primary-050); }

/* Responsive "stacked" tables on phones */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--rm-line); border-radius: 10px; margin: .6rem; width: auto; background: var(--rm-surface); padding: .35rem 0; }
  .table-stack > :not(caption) > * > * { border-bottom: 0; padding: .3rem .8rem; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right !important; }
  .table-stack td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rm-ink-2); font-weight: 600; text-align: left; flex: 0 0 auto; }
  .table-stack td[data-label=""]::before, .table-stack td.empty-row::before { display: none; }
  .table-stack td.empty-row { justify-content: center; }
  .table-stack tfoot { display: block; }
  .table-stack tfoot tr { display: block; margin: .6rem; }
  .table-stack tfoot td { display: flex; }
  .table-responsive > .table-stack { min-width: 0 !important; }
}

/* ---------- Badges ---------- */
.badge { font-weight: 600; letter-spacing: .01em; }
.badge-soft-success { background: rgba(12,163,12,.12) !important; color: #0a7d0a !important; }
.badge-soft-danger  { background: rgba(208,59,59,.12) !important; color: #b42f2f !important; }
.badge-soft-warning { background: rgba(250,178,25,.18) !important; color: #8a5a00 !important; }
.badge-soft-info    { background: rgba(42,120,214,.12) !important; color: #2163b5 !important; }
.badge-soft-secondary { background: rgba(120,120,120,.14) !important; color: var(--rm-ink-2) !important; }
.badge-soft-primary { background: var(--rm-primary-050) !important; color: var(--rm-primary) !important; }
[data-bs-theme="dark"] .badge-soft-success { color: #5fd35f !important; }
[data-bs-theme="dark"] .badge-soft-danger { color: #f08585 !important; }
[data-bs-theme="dark"] .badge-soft-warning { color: #f3c55c !important; }
[data-bs-theme="dark"] .badge-soft-info { color: #79acef !important; }

/* ---------- Invoice / line-item editor ---------- */
.line-items td { vertical-align: top; }
.line-items .form-control, .line-items .form-select { min-width: 90px; }
.line-items .col-product { min-width: 220px; }
.line-items .stock-hint { font-size: .72rem; color: var(--rm-ink-2); margin-top: .2rem; }
.totals-box { background: color-mix(in srgb, var(--rm-bg) 50%, var(--rm-surface)); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: 1rem; }
.totals-box .row-t { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .3rem 0; }
.totals-box .row-t input { max-width: 150px; text-align: right; }
.totals-box .grand { font-size: 1.2rem; font-weight: 800; border-top: 1px dashed var(--rm-line); margin-top: .35rem; padding-top: .6rem; }
/* Line items become a card grid on phones, tablets and small laptops (no sideways scrolling) */
@media (max-width: 1399.98px) {
  .line-items thead { display: none; }
  .line-items tr { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .75rem; border: 1px solid var(--rm-line); border-radius: 10px; margin-bottom: .6rem; background: var(--rm-surface); }
  .line-items td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
  .line-items td.col-product, .line-items td.col-wh { grid-column: 1 / -1; }
  .line-items td::before { content: attr(data-label); display: block; font-size: .68rem; text-transform: uppercase; color: var(--rm-ink-2); font-weight: 600; margin-bottom: .15rem; }
  .line-items td[data-label=""]::before { content: none; }
  .line-items .form-control, .line-items .form-select, .line-items .col-product { min-width: 0 !important; }
  .line-items, .line-items tbody, .line-items tfoot { display: block; }
  .line-items tfoot tr { display: flex; justify-content: space-between; }
}
@media (min-width: 576px) and (max-width: 1399.98px) {
  .line-items tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .line-items td.col-product, .line-items td.col-wh { grid-column: span 2; }
}

/* ---------- Document view (invoice preview) ---------- */
.doc { background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: 2rem; }
.doc-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 2px solid var(--rm-primary); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.doc-title { font-size: 1.6rem; font-weight: 800; color: var(--rm-primary); letter-spacing: .02em; text-transform: uppercase; }
.doc-meta td { padding: .15rem .5rem .15rem 0; }
@media (max-width: 575.98px) { .doc { padding: 1rem; } .doc-title { font-size: 1.2rem; } }

/* ---------- Production workflow ---------- */
.stage-track { display: flex; gap: 0; overflow-x: auto; padding: .25rem 0 .5rem; }
.stage { flex: 1 0 110px; text-align: center; position: relative; }
.stage::before { content: ""; position: absolute; top: 19px; left: -50%; width: 100%; height: 3px; background: var(--rm-line); z-index: 0; }
.stage:first-child::before { display: none; }
.stage .dot { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; margin: 0 auto .4rem; display: grid; place-items: center; background: var(--rm-surface); border: 2px solid var(--rm-line); color: var(--rm-ink-2); font-size: 1.05rem; }
.stage .lbl { font-size: .76rem; font-weight: 600; color: var(--rm-ink-2); }
.stage .when { font-size: .68rem; color: var(--rm-ink-2); }
.stage.done .dot { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }
.stage.done::before, .stage.current::before { background: var(--rm-primary); }
.stage.current .dot { border-color: var(--rm-accent); color: var(--rm-accent); box-shadow: 0 0 0 5px var(--rm-accent-050); }
.stage.current .lbl { color: var(--rm-ink); }

.flow-steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.flow-steps .fs { border: 1px dashed var(--rm-line); border-radius: 10px; padding: .6rem .75rem; font-size: .8rem; background: var(--rm-surface); }
.flow-steps .fs b { display: block; font-size: .85rem; }

/* ---------- Dashboard ---------- */
.chart-box { position: relative; height: clamp(220px, 18vw + 120px, 340px); }
.chart-box.sm { height: clamp(200px, 14vw + 110px, 280px); }
.chart-box.chart-lg { height: clamp(240px, 20vw + 130px, 380px); }
tr.row-peak > td { background: rgba(237, 161, 0, .10); }
.list-compact .item { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--rm-line); font-size: .87rem; }
.list-compact .item:last-child { border-bottom: 0; }
.progress-thin { height: 6px; border-radius: 6px; background: var(--rm-line); }
.progress-thin .bar { height: 100%; border-radius: 6px; background: var(--rm-primary); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: middle; }
.range-pills .btn { font-size: .8rem; }

/* ---------- Attendance grid ---------- */
.att-opt { display: inline-flex; gap: .25rem; flex-wrap: wrap; }
.att-opt input { display: none; }
.att-opt label { min-width: 36px; text-align: center; border: 1px solid var(--rm-line); border-radius: 8px; padding: .25rem .45rem; cursor: pointer; font-weight: 700; font-size: .8rem; background: var(--rm-surface); }
.att-opt input:checked + label.P { background: #0ca30c; border-color: #0ca30c; color: #fff; }
.att-opt input:checked + label.A { background: #d03b3b; border-color: #d03b3b; color: #fff; }
.att-opt input:checked + label.L { background: #2a78d6; border-color: #2a78d6; color: #fff; }
.att-opt input:checked + label.H { background: #c98a00; border-color: #c98a00; color: #fff; }
.att-grid td, .att-grid th { padding: .3rem .25rem !important; text-align: center; font-size: .75rem; }
.att-grid .c-P { color: #0a7d0a; font-weight: 700; } .att-grid .c-A { color: #d03b3b; font-weight: 700; }
.att-grid .c-L { color: #2a78d6; font-weight: 700; } .att-grid .c-H { color: #c98a00; font-weight: 700; }

/* ---------- Permission matrix ---------- */
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }

/* ---------- Login ---------- */
.login-body { background: var(--rm-bg); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { position: relative; color: #eef5f0; padding: 3rem; display: flex; align-items: center;
  background:
    radial-gradient(1200px 600px at -10% 110%, rgba(230,180,58,.35), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.03) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, #123524, #0b2117); }
.login-hero-inner { max-width: 460px; }
.login-hero h1 { font-size: 2.2rem; font-weight: 800; margin: 1.2rem 0 .6rem; letter-spacing: -.02em; }
.login-hero p { color: #b9cdc1; font-size: 1.05rem; }
.login-points { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.login-points li { padding: .35rem 0; color: #d8e5dd; }
.login-points i { color: #e6b43a; margin-right: .4rem; }
.login-panel { display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-weight: 800; letter-spacing: -.02em; }
@media (max-width: 991.98px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 2rem 1.5rem; }
  .login-hero h1 { font-size: 1.6rem; }
  .login-points { display: none; }
}

/* ---------- Misc ---------- */
.text-secondary { color: var(--rm-ink-2) !important; }
.modal-content { border-radius: var(--rm-radius); border: 0; }
.dropdown-menu { border-color: var(--rm-line); border-radius: 10px; }
.alert { border-radius: 10px; }
.tag-mon { font-size: .72rem; color: var(--rm-ink-2); display: block; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.nowrap { white-space: nowrap; }

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .no-print, .filter-bar, .page-actions, .app-footer, .btn, .alert, form[data-confirm] { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .card, .doc { border: 0 !important; box-shadow: none !important; }
  body { background: #fff; font-size: 11pt; }
  .table-responsive { overflow: visible !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- Responsive extras ---------- */
.card-body { padding: clamp(.75rem, .55rem + .6vw, 1rem); }
.list-compact .item { font-size: clamp(.8rem, .76rem + .2vw, .87rem); }
.list-compact .item > *:first-child { min-width: 0; overflow-wrap: anywhere; }
.totals-box .grand { font-size: clamp(1rem, .9rem + .5vw, 1.2rem); }
.doc-title { font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem); }
.topbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.range-pills { max-width: 100%; }
@media (max-width: 575.98px) {
  .range-pills .btn { flex: 1 0 30%; }
  .filter-bar .btn-group { width: 100%; }
  .modal-footer .btn { flex: 1; }
  .card-header .card-tools { margin-left: 0; width: 100%; }
  .stage { flex-basis: 92px; }
  .stage .lbl { font-size: .7rem; }
}
@media (min-width: 1600px) {
  .content { padding: 1.75rem 2.25rem; }
}
@media (max-width: 360px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .btn-user { padding-right: .35rem; }
  .topbar { gap: .25rem; }
}

/* Dashboard KPI grid: always even rows (12 tiles -> 2, 3, 4 or 6 per row) */
.stat-grid.kpi-12 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .stat-grid.kpi-12 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .stat-grid.kpi-12 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1760px) { .stat-grid.kpi-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Dark mode: neutral buttons follow the surface colour */
[data-bs-theme="dark"] .btn-light {
  --bs-btn-bg: var(--rm-surface); --bs-btn-color: var(--rm-ink); --bs-btn-border-color: var(--rm-line);
  --bs-btn-hover-bg: #232b27; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #3a443f;
  --bs-btn-active-bg: #2a332e; --bs-btn-active-color: #fff;
}
[data-bs-theme="dark"] .table thead th, [data-bs-theme="dark"] .table tfoot td { background: #1b211e; }
[data-bs-theme="dark"] .table-light, [data-bs-theme="dark"] .table-light > * { --bs-table-bg: #1d2420; --bs-table-color: var(--rm-ink); }

/* Top bar search */
.topbar-search { position: relative; display: flex; align-items: center; flex: 0 1 380px; margin-left: .5rem; min-width: 0; }
.topbar-search > .bi-search { position: absolute; left: .7rem; color: var(--rm-ink-2); font-size: .85rem; pointer-events: none; z-index: 1; }
.topbar-search .form-control { padding-left: 2rem; padding-right: 2rem; border-radius: 10px; height: 38px; }
.topbar-search .ts-kbd { position: absolute; right: .55rem; font-size: .7rem; padding: .05rem .4rem; background: var(--bs-tertiary-bg); color: var(--rm-ink-2); border: 1px solid var(--bs-border-color); border-radius: 5px; pointer-events: none; }
.topbar-search .form-control:focus ~ .ts-kbd, .topbar-search .form-control:not(:placeholder-shown) ~ .ts-kbd { display: none; }
.topbar-search .ts-close, .ts-open-btn { display: none; }
.ts-pop { position: absolute; top: calc(100% + 6px); left: 0; width: min(520px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 12px; z-index: 1060; padding: .35rem 0; }
.ts-pop .ts-group { padding: .45rem .9rem .2rem; font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--rm-ink-2); display: flex; align-items: center; gap: .4rem; }
.ts-pop .ts-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .9rem; color: inherit; text-decoration: none; min-width: 0; }
.ts-pop .ts-item:hover, .ts-pop .ts-item.active { background: var(--bs-tertiary-bg); }
.ts-pop .ts-item.active { box-shadow: inset 3px 0 0 var(--bs-primary); }
.ts-pop .ts-item .ts-ic { flex-shrink: 0; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 8px; background: var(--bs-tertiary-bg); color: var(--rm-ink-2); font-size: .85rem; }
.ts-pop .ts-item .ts-tx { flex: 1 1 auto; min-width: 0; }
.ts-pop .ts-item .ts-t, .ts-pop .ts-item .ts-s { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-pop .ts-item .ts-t { font-weight: 600; font-size: .88rem; }
.ts-pop .ts-item .ts-s { font-size: .76rem; color: var(--rm-ink-2); }
.ts-pop .ts-item mark { padding: 0; background: rgba(255, 193, 7, .35); color: inherit; border-radius: 2px; }
.ts-pop .ts-b { flex-shrink: 0; font-size: .68rem; }
.ts-pop .ts-msg { padding: .9rem; text-align: center; color: var(--rm-ink-2); font-size: .85rem; }
.ts-pop .ts-all { display: block; margin: .3rem .6rem .2rem; padding: .45rem; text-align: center; border-radius: 8px; font-size: .84rem; font-weight: 600; text-decoration: none; background: var(--bs-tertiary-bg); }
.ts-pop .ts-all.active { outline: 2px solid var(--bs-primary); }
.ts-pop .ts-foot { padding: .3rem .9rem .1rem; font-size: .7rem; color: var(--rm-ink-2); display: flex; gap: .8rem; flex-wrap: wrap; }
@media (max-width: 767.98px) {
  .topbar-search { display: none; }
  .ts-open-btn { display: inline-grid; }
  body.ts-open .topbar { backdrop-filter: none; } /* a filter would make the topbar the box for position: fixed */
  body.ts-open .topbar-search { display: flex; position: fixed; inset: 0 0 auto 0; height: 60px; margin: 0; padding: 10px 12px; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); z-index: 1070; flex: none; }
  body.ts-open .topbar-search > .bi-search { left: 1.45rem; }
  body.ts-open .topbar-search .form-control { padding-right: .75rem; width: calc(100% - 46px); flex: 0 0 auto; }
  body.ts-open .topbar-search .ts-close { display: inline-grid; position: absolute; right: 8px; z-index: 2; }
  body.ts-open .topbar-search .ts-kbd { display: none; }
  body.ts-open .ts-pop { position: fixed; top: 60px; left: 0; right: 0; width: auto; max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); border-radius: 0; border-width: 0 0 1px; }
  body.ts-open .ts-pop .ts-foot { display: none; }
}
@media (hover: none) { .topbar-search .ts-kbd { display: none; } }

.notif-row { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: .35rem .6rem; align-items: center; }
.notif-row .notif-act { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; align-items: center; }
@media (max-width: 767.98px) { .notif-row { grid-template-columns: 1.75rem minmax(0, 1fr); } .notif-row .notif-act { grid-column: 2; justify-content: flex-start; } }
.alerts-menu { width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; }

/* =========================================================
   Warehouse overview & floor map
   ========================================================= */
.wh-type-paddy { --wh: #c98a00; --wh-soft: rgba(201,138,0,.12); }
.wh-type-rice { --wh: #1d6b47; --wh-soft: rgba(29,107,71,.12); }
.wh-type-byproduct { --wh: #2a78d6; --wh-soft: rgba(42,120,214,.12); }
.wh-type-packaging { --wh: #6b6f76; --wh-soft: rgba(107,111,118,.12); }
.wh-type-store { --wh: #6a5bd0; --wh-soft: rgba(106,91,208,.12); }
.wh-type-general { --wh: #56605a; --wh-soft: rgba(86,96,90,.12); }
[data-bs-theme="dark"] .wh-type-rice { --wh: #3fa877; }

.wh-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.wh-card { position: relative; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.wh-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(16,24,20,.09); }
.wh-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--wh); }
.wh-card-head { display: flex; gap: .85rem; align-items: center; padding: 1.1rem 1.1rem .6rem; }
.wh-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; display: grid; place-items: center; background: var(--wh-soft); color: var(--wh); font-size: 1.35rem; }
.wh-name { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.wh-meta { font-size: .76rem; color: var(--rm-ink-2); }
.wh-gauge { margin-left: auto; position: relative; width: 64px; height: 64px; flex: 0 0 64px; }
.wh-gauge svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.wh-gauge .track { stroke: var(--rm-line); }
.wh-gauge .val { stroke: var(--wh); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.wh-gauge.full .val { stroke: #d03b3b; }
.wh-gauge .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: .82rem; }
.wh-gauge .pct small { display: block; font-size: .55rem; font-weight: 600; color: var(--rm-ink-2); text-align: center; line-height: 1; }
.wh-body { padding: 0 1.1rem .8rem; flex: 1; }
.wh-big { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.wh-big small { font-size: .78rem; font-weight: 600; color: var(--rm-ink-2); margin-left: .25rem; }
.mix-bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--rm-line); margin: .55rem 0 .65rem; gap: 2px; }
.mix-bar span { display: block; height: 100%; }
.wh-prod { display: flex; justify-content: space-between; gap: .75rem; font-size: .82rem; padding: .22rem 0; }
.wh-prod .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-prod .nm i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
.wh-prod .q { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-foot { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px dashed var(--rm-line); }
.wh-foot > div { padding: .6rem .5rem; text-align: center; border-right: 1px dashed var(--rm-line); }
.wh-foot > div:last-child { border-right: 0; }
.wh-foot b { display: block; font-size: .9rem; font-variant-numeric: tabular-nums; }
.wh-foot span { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rm-ink-2); }
.wh-card a.stretched { position: absolute; inset: 0; z-index: 1; }
.wh-card .wh-actions { position: relative; z-index: 2; display: flex; gap: .4rem; padding: .6rem 1.1rem 1rem; }
.loc-heading { display: flex; align-items: center; gap: .6rem; margin: 1.4rem 0 .8rem; font-weight: 700; color: var(--rm-ink-2); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.loc-heading::after { content: ""; flex: 1; height: 1px; background: var(--rm-line); }
.chip-filter { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink); font-size: .8rem; font-weight: 600; }
.chip-filter.active { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }

/* Floor map */
.floor { position: relative; border: 2px dashed color-mix(in srgb, var(--wh, var(--rm-primary)) 45%, transparent); border-radius: 18px; padding: 1rem;
  background: repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--rm-line) 55%, transparent) 23px 24px),
              repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--rm-line) 55%, transparent) 23px 24px); }
.floor-label { position: absolute; top: -.75rem; left: 1rem; background: var(--rm-bg); padding: 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rm-ink-2); }
.zone-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.zone { --zc: #2a78d6; background: var(--rm-surface); border: 1px solid var(--rm-line); border-left: 5px solid var(--zc); border-radius: 12px; padding: .8rem .9rem; display: flex; flex-direction: column; min-height: 170px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.zone-head { display: flex; align-items: flex-start; gap: .5rem; }
.zone-code { font-size: .7rem; font-weight: 800; color: var(--zc); background: color-mix(in srgb, var(--zc) 14%, transparent); border-radius: 6px; padding: .1rem .4rem; }
.zone-name { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.zone-side { font-size: .72rem; color: var(--rm-ink-2); }
.zone-fill { height: 6px; border-radius: 6px; background: var(--rm-line); margin: .55rem 0 .2rem; overflow: hidden; }
.zone-fill span { display: block; height: 100%; background: var(--zc); border-radius: 6px; }
.zone-cap { font-size: .7rem; color: var(--rm-ink-2); display: flex; justify-content: space-between; }
.zone-items { margin-top: .5rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.zone-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .8rem; padding: .3rem .45rem; border-radius: 8px; background: color-mix(in srgb, var(--rm-bg) 70%, var(--rm-surface)); }
.zone-item .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-item .q { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zone-item .btn { --bs-btn-padding-y: 0; --bs-btn-padding-x: .3rem; --bs-btn-font-size: .75rem; }
.zone.unassigned { --zc: #898781; border-left-style: dashed; background: repeating-linear-gradient(135deg, var(--rm-surface) 0 10px, color-mix(in srgb, var(--rm-bg) 80%, var(--rm-surface)) 10px 20px); }
.zone-empty { font-size: .78rem; color: var(--rm-ink-2); text-align: center; padding: .8rem 0; margin: auto 0; }
.where-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; border-radius: 999px; padding: .12rem .5rem; margin: .1rem .15rem .1rem 0;
  background: color-mix(in srgb, var(--zc, #898781) 13%, transparent); color: var(--rm-ink); border: 1px solid color-mix(in srgb, var(--zc, #898781) 35%, transparent); }
.where-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--zc, #898781); display: inline-block; }
.wh-hero { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding: 1.1rem 1.25rem; border-radius: 16px; background: linear-gradient(120deg, var(--wh-soft), transparent 70%), var(--rm-surface); border: 1px solid var(--rm-line); }
.wh-hero .wh-gauge, .wh-hero .wh-gauge svg { width: 84px; height: 84px; flex-basis: 84px; }
.wh-hero .wh-gauge .pct { font-size: 1rem; }
.wh-hero-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-left: auto; }
.wh-hero-stats div b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.wh-hero-stats div span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rm-ink-2); }
@media (max-width: 575.98px) { .wh-hero-stats { margin-left: 0; gap: 1rem; } .floor { padding: .7rem; } }

/* change badges & sparklines */
.chg { display: inline-flex; align-items: center; gap: .15rem; font-size: .74rem; font-weight: 700; border-radius: 6px; padding: .08rem .4rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chg.good { color: #0a7d0a; background: rgba(12,163,12,.12); }
.chg.bad { color: #b42f2f; background: rgba(208,59,59,.12); }
.chg.flat { color: var(--rm-ink-2); background: rgba(120,120,120,.12); }
[data-bs-theme="dark"] .chg.good { color: #5fd35f; } [data-bs-theme="dark"] .chg.bad { color: #f08585; }
.spark { display: block; }
.price-hero { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.sup-card { border: 1px solid var(--rm-line); border-radius: 12px; padding: .85rem; background: var(--rm-surface); }
.sup-card .rate { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sup-card.best { border-color: #0ca30c; box-shadow: 0 0 0 3px rgba(12,163,12,.10); }
.sup-card .tag { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* =========================================================
   Dashboard KPI tiles (creative)
   ========================================================= */
.tone-primary { --tone: var(--rm-primary); } .tone-accent { --tone: var(--rm-accent); } .tone-blue { --tone: #2a78d6; }
.tone-red { --tone: #d03b3b; } .tone-violet { --tone: #6a5bd0; } .tone-orange { --tone: #eb6834; }
.kpi-grid { display: grid; gap: clamp(.5rem, .3rem + .6vw, .85rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .35rem; min-width: 0; container-type: inline-size;
  background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 14px; padding: clamp(.7rem, .55rem + .5vw, 1rem); color: var(--rm-ink);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.kpi::after { content: ""; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%); pointer-events: none; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,20,.08); border-color: color-mix(in srgb, var(--tone) 45%, var(--rm-line)); color: var(--rm-ink); }
.kpi-top { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.kpi-top .stat-icon { width: 34px; height: 34px; flex: 0 0 34px; font-size: 1rem; border-radius: 10px; }
.kpi-label { font-size: clamp(.64rem, .6rem + .2vw, .74rem); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--rm-ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value { font-size: 1.25rem; font-size: clamp(.95rem, 9cqi, 1.5rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; margin-top: auto; }
.kpi-sub { font-size: clamp(.66rem, .62rem + .2vw, .76rem); color: var(--rm-ink-2); min-width: 0; }
.kpi-spark { flex: 0 0 auto; opacity: .9; }
.kpi-grid.kpi-12 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .kpi-grid.kpi-12 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpi-grid.kpi-12 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1760px) { .kpi-grid.kpi-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 400px) { .kpi-spark { display: none; } }
.dash-section-title { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--rm-ink-2); margin: 1.2rem 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.dash-section-title::after { content: ""; flex: 1; height: 1px; background: var(--rm-line); }
.mini-wh { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; padding: .5rem 0; border-bottom: 1px solid var(--rm-line); font-size: .84rem; color: var(--rm-ink); }
.mini-wh:last-child { border-bottom: 0; }
.mini-wh .bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--rm-line); overflow: hidden; }
.mini-wh .bar span { display: block; height: 100%; border-radius: 6px; }
/* role → dashboard widget picker */
.widget-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-bottom: .75rem; }
.widget-opt { display: flex; align-items: flex-start; gap: .55rem; padding: .55rem .7rem; border: 1px solid var(--rm-line); border-radius: 10px; cursor: pointer; background: var(--rm-surface); font-size: .86rem; line-height: 1.25; }
.widget-opt:hover { border-color: var(--rm-primary); }
.widget-opt:has(input:checked) { border-color: color-mix(in srgb, var(--rm-primary) 55%, var(--rm-line)); background: var(--rm-primary-050); }
.widget-opt .form-check-input { margin-top: .1rem; flex: 0 0 auto; }
.widget-opt > i { color: var(--rm-primary); font-size: 1rem; }
.widget-opt small { display: block; color: var(--rm-ink-2); font-size: .72rem; margin-top: .1rem; }
.widget-opt.disabled { opacity: .5; }
a.mini-wh:hover strong { color: var(--rm-primary); text-decoration: underline; }
.widget-opt.disabled:has(input:checked) { background: var(--rm-surface); border-color: var(--rm-line); }
@container (max-width: 210px) {
  .kpi-top .stat-icon { display: none; }
  .kpi-label { white-space: normal; line-height: 1.15; }
}

/* ---------- Invoice design (HTML view; mirrors the PDF) ---------- */
.inv { --inv: var(--rm-primary); position: relative; overflow: hidden; }
.inv .doc-title { color: var(--inv); }
.inv-letterhead { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--inv); padding-bottom: 1rem; margin-bottom: 1.25rem; position: relative; }
.inv-logo { height: 58px; width: auto; max-width: 140px; object-fit: contain; }
.inv-logo.logo-s { height: 44px; max-width: 110px; } .inv-logo.logo-l { height: 76px; max-width: 180px; } .inv-logo.logo-xl { height: 96px; max-width: 220px; }
.inv-company { flex: 1 1 260px; min-width: 0; }
.inv-name { font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem); font-weight: 800; color: var(--inv); line-height: 1.2; }
.inv-lines { font-size: .82rem; color: var(--rm-ink-2); margin-top: .2rem; }
.inv-titlebox { text-align: right; margin-left: auto; }
.inv.logo-right .inv-logo { order: 3; }
.inv.logo-right .inv-titlebox { order: 2; }
.inv.logo-center .inv-letterhead, .inv.inv-classic .inv-letterhead { flex-direction: column; align-items: center; text-align: center; }
.inv.logo-center .inv-titlebox, .inv.inv-classic .inv-titlebox { text-align: center; margin: .25rem auto 0; }
.inv.inv-classic .inv-letterhead { border-bottom: 3px double var(--inv); }
.inv.inv-classic .inv-titlebox .doc-title { background: color-mix(in srgb, var(--inv) 12%, transparent); padding: .1rem 1rem; border-radius: 4px; font-size: 1.15rem; }
.inv.inv-bold .inv-letterhead { background: var(--inv); color: #fff; border: 0; margin: -2rem -2rem 1.25rem; padding: 1.25rem 2rem; }
.inv.inv-bold .inv-name, .inv.inv-bold .doc-title { color: #fff; }
.inv.inv-bold .inv-lines, .inv.inv-bold .inv-titlebox .text-secondary { color: rgba(255,255,255,.85) !important; }
.inv.inv-minimal .inv-letterhead { border-bottom: 1px solid var(--rm-line); }
.inv.inv-minimal .inv-name { color: var(--rm-ink); }
.inv .table thead th { background: color-mix(in srgb, var(--inv) 10%, transparent); }
.inv .totals-box .grand { color: var(--inv); }
.inv-pad-title { display: none; text-align: center; margin-bottom: 1rem; }
.inv-bank { margin-top: 1rem; padding: .6rem .8rem; border-radius: 8px; background: color-mix(in srgb, var(--inv) 8%, transparent); font-size: .84rem; }
.inv-bank .lbl { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--inv); margin-bottom: .15rem; }
.inv-signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1.5rem; margin-top: 3.2rem; font-size: .8rem; text-align: center; color: var(--rm-ink-2); }
.inv-signs span { display: block; border-top: 1px solid var(--rm-ink-2); margin: 0 .75rem .3rem; }
.inv-foot { margin-top: 1.25rem; padding-top: .5rem; border-top: 1px solid var(--inv); text-align: center; font-size: .78rem; color: var(--inv); }
.inv-wm { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; font-size: clamp(2.2rem, 7vw, 6rem); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--inv); opacity: .06; z-index: 0; white-space: nowrap; }
.inv-wm > span { display: block; transform: rotate(-30deg); }
.inv > *:not(.inv-wm) { position: relative; z-index: 1; }
@media (max-width: 575.98px) { .inv.inv-bold .inv-letterhead { margin: -1rem -1rem 1rem; padding: 1rem; } .inv-titlebox { text-align: left; margin-left: 0; } }
@media print {
  .inv { padding: 0 !important; }
  .inv .table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-bold .inv-letterhead, .inv-bank, .inv-wm { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-pad .inv-letterhead, body.print-pad .inv-foot { display: none !important; }
  body.print-pad .inv-pad-title { display: block; }
  body.print-pad .inv { padding-top: var(--pad-top) !important; padding-bottom: var(--pad-bottom) !important; }
  body.print-pad .inv-wm { display: none; }
}
/* sales invoice copies: customer / office / delivery */
.copy-badge { display: inline-block; margin-top: .35rem; padding: .1rem .55rem; border: 1.5px solid var(--inv, var(--rm-primary)); color: var(--inv, var(--rm-primary)); border-radius: 4px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.inv-pad-title .copy-badge { margin-top: .25rem; }
.print-copies .copy-page + .copy-page { margin-top: 1.5rem; }
.copies-menu { max-height: min(75vh, 560px); overflow-y: auto; }
@media print {
  .print-copies .copy-page + .copy-page { margin-top: 0; break-before: page; page-break-before: always; }
  .print-copies ~ *, .page-head:has(+ .alert + .print-copies) { display: none !important; }
  .copy-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* invoice design page */
.style-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: .5rem; }
.style-opt { position: relative; border: 1px solid var(--rm-line); border-radius: 10px; padding: .55rem; cursor: pointer; font-size: .82rem; background: var(--rm-surface); }
.style-opt input { position: absolute; opacity: 0; }
.style-opt:has(input:checked) { border-color: var(--rm-primary); box-shadow: 0 0 0 3px var(--rm-primary-050); }
.style-opt:has(input:focus-visible) { outline: 2px solid var(--rm-primary); }
.style-opt strong, .style-opt small { display: block; } .style-opt small { color: var(--rm-ink-2); font-size: .7rem; line-height: 1.25; }
.style-opt .thumb { display: block; height: 52px; border: 1px solid var(--rm-line); border-radius: 6px; margin-bottom: .4rem; position: relative; background: #fff; overflow: hidden; }
.style-opt .thumb i { position: absolute; left: 6px; top: 6px; width: 14px; height: 14px; border-radius: 3px; background: var(--rm-primary); }
.style-opt .thumb b { position: absolute; left: 24px; top: 7px; width: 45%; height: 5px; border-radius: 3px; background: var(--rm-primary); }
.style-opt .thumb u { position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; background: #ddd; text-decoration: none; }
.style-opt .thumb u:nth-of-type(1) { top: 32px; } .style-opt .thumb u:nth-of-type(2) { top: 40px; right: 30%; }
.thumb-modern::after { content: ""; position: absolute; left: 6px; right: 6px; top: 25px; height: 2px; background: var(--rm-primary); }
.thumb-classic i { left: calc(50% - 7px) !important; } .thumb-classic b { left: 27.5% !important; top: 23px !important; }
.thumb-classic::after { content: ""; position: absolute; left: 6px; right: 6px; top: 30px; height: 4px; border-top: 1px solid var(--rm-primary); border-bottom: 1px solid var(--rm-primary); }
.thumb-classic u:nth-of-type(1) { top: 38px !important; } .thumb-classic u:nth-of-type(2) { top: 45px !important; }
.thumb-bold { background: linear-gradient(var(--rm-primary) 0 26px, #fff 26px) !important; } .thumb-bold i, .thumb-bold b { background: #fff !important; }
.thumb-minimal i { background: #999 !important; } .thumb-minimal b { background: #333 !important; } .thumb-minimal::after { content: ""; position: absolute; left: 6px; right: 6px; top: 25px; height: 1px; background: #ccc; }
.swatches { display: flex; flex-wrap: wrap; gap: .3rem; } .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rm-line); padding: 0; }
.preview-sticky { position: sticky; top: 76px; }
.paper-wrap { background: color-mix(in srgb, var(--rm-line) 60%, transparent); border-radius: 12px; padding: clamp(.5rem, 2vw, 1.25rem); }
.paper { background: #fff; color: #1d1d1b; max-width: 760px; margin: 0 auto; box-shadow: 0 6px 24px rgba(0,0,0,.12); border-radius: 4px; overflow: hidden; --bs-body-color: #1d1d1b; }
.paper.a5 { max-width: 540px; }
.paper .doc { border: 0; border-radius: 0; background: #fff; }
.paper .inv-lines, .paper .text-secondary { color: #6b6a65 !important; }
.paper .table { --bs-table-color: #1d1d1b; --bs-table-bg: #fff; }
.pad-zone { display: none; align-items: center; justify-content: center; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #9a9890; background: repeating-linear-gradient(45deg, #f4f3ee 0 8px, #ebe9e1 8px 16px); }
.paper.pad .pad-zone { display: flex; } .paper.pad .pad-zone.top { height: var(--pt, 40px); } .paper.pad .pad-zone.bottom { height: var(--pb, 22px); }
.paper.pad .inv-letterhead, .paper.pad .inv-foot, .paper.pad .inv-wm { display: none !important; }
.paper.pad .inv-pad-title { display: block; }
.inv-logo-ph { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 8px; border: 1px dashed #bbb; color: #bbb; font-size: 1.4rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--rm-bg, var(--bs-body-bg)); padding: .6rem 0; z-index: 5; }
@media (max-width: 1199.98px) { .preview-sticky { position: static; } }
@media (min-width: 768px) { .inv-letterhead { flex-wrap: nowrap; } .inv.logo-center .inv-letterhead, .inv.inv-classic .inv-letterhead { flex-wrap: wrap; } }

/* ---------- Dashboard: milling pipeline ---------- */
.pipe { display: grid; gap: .45rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 575.98px) { .pipe-step { padding: .5rem .25rem; } .pipe-label { font-size: .6rem; letter-spacing: .02em; } .pipe-ico { width: 30px; height: 30px; } }
.pipe-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .65rem .4rem .55rem; border-radius: 12px;
  border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink); min-width: 0; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.pipe-step:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(16,24,20,.08); border-color: var(--rm-primary); color: var(--rm-ink); }
.pipe-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--rm-line); color: var(--rm-ink-2); font-size: 1rem; }
.pipe-step.active .pipe-ico { background: var(--rm-accent); color: #fff; box-shadow: 0 0 0 4px var(--rm-accent-050); animation: pipePulse 2s ease-in-out infinite; }
.pipe-step.active { border-color: color-mix(in srgb, var(--rm-accent) 45%, var(--rm-line)); }
.pipe-end .pipe-ico { background: var(--rm-primary); color: #fff; }
.pipe-end { background: var(--rm-primary-050); border-color: color-mix(in srgb, var(--rm-primary) 35%, var(--rm-line)); }
.pipe-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); line-height: 1.2; min-height: 1.65em; display: flex; align-items: center; }
.pipe-val { font-size: clamp(.86rem, .8rem + .3vw, 1.02rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pipe-val small { font-size: .66rem; font-weight: 600; color: var(--rm-ink-2); }
.pipe-sub { font-size: .7rem; color: var(--rm-ink-2); }
@media (min-width: 1200px) {
  .pipe { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .9rem; }
  .pipe-step:not(:last-child)::after { content: ""; position: absolute; right: -.78rem; top: 27px; width: .66rem; height: .66rem; border-top: 2px solid var(--rm-ink-2); border-right: 2px solid var(--rm-ink-2); transform: rotate(45deg); opacity: .45; }
}
@keyframes pipePulse { 0%, 100% { box-shadow: 0 0 0 3px var(--rm-accent-050); } 50% { box-shadow: 0 0 0 7px var(--rm-accent-050); } }
@media (prefers-reduced-motion: reduce) { .pipe-step.active .pipe-ico { animation: none; } }
.pipe-out { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px dashed var(--rm-line); font-size: .82rem; }
.pipe-out-title { color: var(--rm-ink-2); margin-right: .25rem; }
.pipe-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.pipe-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pipe-chip span { color: var(--rm-ink-2); font-size: .74rem; }
/* panels: each card only as tall as its content (no empty white area) */
.dash-masonry { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
.dash-masonry > .dash-tile { min-width: 0; }
@media (min-width: 768px) { .dash-masonry:not(.n1) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .dash-masonry.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-masonry.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Supplier bill attachments ---------- */
.bill-box { border: 1px dashed color-mix(in srgb, var(--rm-primary) 40%, var(--rm-line)); border-radius: 12px; padding: .8rem .9rem; background: color-mix(in srgb, var(--rm-primary-050) 55%, transparent); }
.bill-box-title { font-weight: 700; font-size: .9rem; margin-bottom: .6rem; }
.bill-files { display: flex; flex-wrap: wrap; gap: .5rem; }
.bill-file { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; border: 1px solid var(--rm-line); border-radius: 8px; background: var(--rm-surface); font-size: .82rem; }
.bill-picked { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.bill-picked span { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--rm-surface); border: 1px solid var(--rm-line); }
.bill-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.bill-thumb { border: 1px solid var(--rm-line); border-radius: 10px; overflow: hidden; background: var(--rm-surface); display: flex; flex-direction: column; min-width: 0; }
.bill-prev { display: grid; place-items: center; height: 130px; background: color-mix(in srgb, var(--rm-line) 45%, transparent); color: #d03b3b; font-size: 2.6rem; overflow: hidden; }
.bill-prev img { width: 100%; height: 100%; object-fit: cover; }
.bill-meta { padding: .45rem .6rem 0; font-size: .8rem; min-width: 0; }
.bill-meta span { display: block; color: var(--rm-ink-2); font-size: .7rem; }
.bill-act { display: flex; gap: .35rem; padding: .45rem .6rem .55rem; margin-top: auto; }

/* ---------- Daily labour sheet ---------- */
.labour-lines { display: flex; flex-direction: column; gap: .5rem; }
.labour-line { display: grid; gap: .45rem .5rem; align-items: end; padding: .6rem; border: 1px solid var(--rm-line); border-radius: 10px; background: color-mix(in srgb, var(--rm-line) 18%, var(--rm-surface));
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, .7fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, .8fr) auto auto; }
.labour-line .form-label { font-size: .64rem; margin-bottom: .15rem; }
.labour-line .ll-note { grid-column: 1 / -2; }
.labour-line .ll-del { grid-row: 1; grid-column: -2; align-self: end; }
.ll-a { font-weight: 800; font-variant-numeric: tabular-nums; padding: .25rem 0; text-align: right; }
.ll-pay { padding-bottom: .35rem; white-space: nowrap; min-width: 0; }
@media (max-width: 575.98px) { .ll-pay, .ll-pay .form-check { white-space: normal; } }
.labour-total { font-size: .95rem; padding: .35rem .75rem; border-radius: 8px; background: var(--rm-primary-050); }
.labour-total strong { font-size: 1.1rem; color: var(--rm-primary); font-variant-numeric: tabular-nums; }
@media (max-width: 1199.98px) {
  .labour-line { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .labour-line .ll-lab { grid-column: span 3; } .labour-line .ll-work { grid-column: span 2; } .labour-line .ll-del { grid-row: 1; grid-column: 6; justify-self: end; }
  .labour-line .ll-unit { grid-column: span 2; } .labour-line .ll-num { grid-column: span 1; } .labour-line .ll-amt { grid-column: span 1; }
  .labour-line .ll-pay { grid-column: span 2; } .labour-line .ll-note { grid-column: span 4; }
}
@media (max-width: 575.98px) {
  .labour-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .labour-line .ll-lab { grid-column: 1 / 3; } .labour-line .ll-del { grid-column: 3; }
  .labour-line .ll-work, .labour-line .ll-note { grid-column: 1 / -1; } .labour-line .ll-unit { grid-column: span 3; }
  .labour-line .ll-amt { grid-column: span 2; } .labour-line .ll-pay { grid-column: span 1; }
}

/* ---------- Bangla interface ---------- */
html[lang="bn"] body { font-size: 1.02rem; }
html[lang="bn"] * { letter-spacing: normal !important; }
html[lang="bn"] .kpi-label, html[lang="bn"] .stat-label, html[lang="bn"] .pipe-label, html[lang="bn"] .form-label, html[lang="bn"] th { text-transform: none; }
.lang-btn span { font-size: .74rem; font-weight: 800; }
.login-lang { display: flex; justify-content: flex-end; align-items: center; gap: .45rem; margin-bottom: .75rem; color: var(--rm-ink-2); }
.login-lang .form-select { width: auto; max-width: min(100%, 300px); border-radius: 999px; font-size: .84rem; }
/* invoice preview paper always looks like paper; brand colour lifted for contrast in dark mode */
.paper { --rm-surface: #fff; --rm-ink: #1d1d1b; --rm-ink-2: #6b6a65; --rm-line: #e1e0d9; --rm-primary-050: #e8f3ed; color-scheme: light; }
.paper .totals-box { background: #fafaf7; border-color: #e1e0d9; color: #1d1d1b; }
[data-bs-theme="dark"] .inv:not(.paper .inv) .inv-name, [data-bs-theme="dark"] .inv:not(.paper .inv) .doc-title, [data-bs-theme="dark"] .inv:not(.paper .inv) .inv-bank .lbl,
[data-bs-theme="dark"] .inv:not(.paper .inv) .inv-foot, [data-bs-theme="dark"] .inv:not(.paper .inv) .totals-box .grand { color: color-mix(in srgb, var(--inv) 45%, #fff); }
[data-bs-theme="dark"] .inv:not(.paper .inv) .inv-letterhead { border-color: color-mix(in srgb, var(--inv) 60%, #fff); }
[data-bs-theme="dark"] .inv.inv-bold .inv-name, [data-bs-theme="dark"] .inv.inv-bold .doc-title { color: #fff; }
@media print { [data-bs-theme="dark"] .inv .inv-name, [data-bs-theme="dark"] .inv .doc-title { color: var(--inv) !important; } }
/* dark mode: filled green surfaces a shade deeper so white text stays readable */
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #2b8259; --bs-btn-border-color: #2b8259; --bs-btn-hover-bg: #246f4c; --bs-btn-hover-border-color: #246f4c; --bs-btn-active-bg: #246f4c; --bs-btn-disabled-bg: #2b8259; }
[data-bs-theme="dark"] .bg-primary, [data-bs-theme="dark"] .chip-filter.active, [data-bs-theme="dark"] .nav-pills .nav-link.active,
[data-bs-theme="dark"] .sidebar-nav .nav-link.active, [data-bs-theme="dark"] .nav-link.active.btn-primary { background-color: #2b8259 !important; }
[data-bs-theme="dark"] .table-success { --bs-table-bg: #18352a; --bs-table-color: #e6efe9; }
[data-bs-theme="dark"] .table-success td, [data-bs-theme="dark"] .table-success .text-secondary { color: #e6efe9 !important; }
/* readable warning text on light backgrounds */
[data-bs-theme="light"] .text-warning, :root:not([data-bs-theme="dark"]) .text-warning { color: #9a6700 !important; }
.btn-outline-warning { --bs-btn-color: #9a6700; }
[data-bs-theme="dark"] .btn-outline-warning { --bs-btn-color: #ffc107; }
@media (max-width: 400px) { .pipe-chip { white-space: normal; max-width: 100%; flex-wrap: wrap; } }

/* ---------- Navigation drawer (PC: full drawer ⇄ icon rail with fly-out menus) ---------- */
.nav-fly, .nav-fly-title { display: none; }
.nav-find { position: relative; padding: .6rem .7rem 0; }
.nav-find i { position: absolute; left: 1.35rem; top: 1.12rem; font-size: .8rem; color: #7f9a8a; pointer-events: none; }
.nav-find .form-control { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); color: #e6efe9; padding-left: 2rem; border-radius: 9px; }
.nav-find .form-control::placeholder { color: #7f9a8a; }
.nav-find .form-control:focus { background: rgba(255,255,255,.1); border-color: #e6b43a; box-shadow: 0 0 0 .18rem rgba(230,180,58,.18); }
.nav-empty { color: #7f9a8a; font-size: .82rem; padding: .75rem; }
.sidebar .nav-link { position: relative; transition: background .15s, color .15s; }
.sidebar .nav-link.active::before, .sidebar .nav-item.current > .nav-group::before { content: ""; position: absolute; left: -.6rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: #e6b43a; }
.sidebar .nav-item.current > .nav-group { background: rgba(255,255,255,.04); }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.nav-pin { align-items: center; gap: .35rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: #a9bdb1; border-radius: 8px; padding: .2rem .55rem; font-size: .72rem; }
.nav-pin:hover { color: #fff; background: rgba(255,255,255,.1); }
mark.nav-hit { background: rgba(230,180,58,.35); color: #fff; padding: 0 1px; border-radius: 2px; }
@media (min-width: 992px) {
  html.nav-anim .sidebar { transition: width .2s ease; }
  html.nav-anim .main { transition: margin-left .2s ease; }
  html.nav-rail { --sidebar-w: 76px; }
  html.nav-rail .sidebar { overflow: visible; }
  html.nav-rail .sidebar-brand { justify-content: center; padding: 1rem .5rem .85rem; }
  html.nav-rail .brand-text, html.nav-rail .nav-find, html.nav-rail .nav-empty, html.nav-rail .foot-ver,
  html.nav-rail .sidebar .nav-link > span, html.nav-rail .sidebar .caret, html.nav-rail .nav-pin span { display: none !important; }
  html.nav-rail .sidebar-nav { padding: .6rem .55rem 1rem; overflow-x: hidden; }
  html.nav-rail .nav-heading { font-size: 0; padding: 0; height: 1px; margin: .6rem .4rem; background: rgba(255,255,255,.08); }
  html.nav-rail .sidebar .nav-link { justify-content: center; padding: .62rem 0; }
  html.nav-rail .sidebar .nav-link i { font-size: 1.2rem; width: auto; }
  html.nav-rail .sidebar .nav-item.current > .nav-group { background: var(--rm-primary); color: #fff; }
  html.nav-rail .sidebar .nav-item.has-sub > .collapse { display: none !important; }
  html.nav-rail .sidebar-foot { justify-content: center; padding: .7rem .4rem; }
  html.nav-rail .nav-pin i { transform: rotate(180deg); }
  /* fly-out panel next to the rail */
  html.nav-rail .sidebar .nav-item.fly > .collapse, html.nav-rail .sidebar .nav-item.fly > .nav-fly {
    display: block !important; position: fixed; left: calc(var(--sidebar-w) - 4px); top: var(--fly-top, 80px); z-index: 1045;
    min-width: 230px; max-width: 280px; max-height: calc(100vh - var(--fly-top, 80px) - 12px); overflow-y: auto;
    background: var(--rm-sidebar-2); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.35);
    padding: .45rem; height: auto !important; animation: navFly .14s ease-out;
  }
  html.nav-rail .nav-item.fly > .nav-fly { min-width: 0; padding: .35rem .7rem; border-radius: 8px; }
  html.nav-rail .nav-item.fly > .nav-fly .nav-fly-title { display: block; padding: 0; margin: 0; border: 0; }
  html.nav-rail .nav-item.fly .nav-sub { margin: 0; padding: 0; border: 0; }
  html.nav-rail .nav-item.fly .nav-fly-title { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 600; font-size: .86rem; padding: .35rem .55rem .5rem; margin-bottom: .25rem; border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
  html.nav-rail .nav-item.fly .nav-link.sub { justify-content: flex-start; padding: .42rem .65rem; }
  html.nav-rail .nav-item.fly .nav-link.sub > span { display: inline !important; }
  html.nav-rail .nav-item.fly .nav-link.sub.active::before { display: none; }
}
@keyframes navFly { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@media print { html.nav-rail .main { margin-left: 0 !important; } }
/* barcodes */
.bc-cell svg { width: auto; max-width: 170px; height: 44px; background: #fff; border-radius: 4px; padding: 2px; }
.scan-box { position: relative; max-width: 320px; flex: 1 1 220px; }
.scan-box i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--rm-ink-2); pointer-events: none; }
.scan-box .form-control { padding-left: 2rem; }
.scan-msg { font-size: .76rem; }
.line-items tr.scan-hit td { animation: scanHit .9s ease-out; }
@keyframes scanHit { from { background: color-mix(in srgb, var(--rm-primary) 22%, transparent); } to { background: transparent; } }

/* ---------- searchable select ---------- */
.ss-wrap { position: relative; min-width: 0; }
.ss-native { position: absolute !important; left: 0; bottom: 0; width: 100% !important; height: 1px !important; opacity: 0 !important; pointer-events: none; padding: 0 !important; border: 0 !important; }
.ss-toggle { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; background-color: var(--bs-body-bg); }
.ss-toggle.ss-empty { color: var(--rm-ink-2); }
.ss-toggle.is-invalid { border-color: var(--bs-danger); box-shadow: 0 0 0 .2rem rgba(220,53,69,.18); }
.ss-pop { position: absolute; z-index: 1065; top: calc(100% + 4px); left: 0; min-width: 100%; width: max(100%, 300px); max-width: min(440px, 92vw); background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 10px; box-shadow: 0 14px 36px rgba(0,0,0,.18); padding: .4rem; }
.ss-pop.up { top: auto; bottom: calc(100% + 4px); }
.ss-search { position: relative; margin-bottom: .3rem; }
.ss-search i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--rm-ink-2); font-size: .8rem; }
.ss-search .form-control { padding-left: 1.8rem; }
.ss-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.ss-item { padding: .4rem .55rem; border-radius: 7px; cursor: pointer; font-size: .86rem; line-height: 1.25; }
.ss-item small { display: block; color: var(--rm-ink-2); font-size: .72rem; }
.ss-item.act { background: var(--rm-primary-050); color: var(--rm-ink); }
.ss-item.sel { font-weight: 600; }
.ss-item.sel::after { content: " ✓"; color: var(--rm-primary); }
.ss-item.ss-none { color: var(--rm-ink-2); font-style: italic; }
.ss-nores { padding: .6rem; color: var(--rm-ink-2); font-size: .82rem; text-align: center; }
.ss-count { font-size: .7rem; color: var(--rm-ink-2); text-align: right; padding: .15rem .3rem 0; }
.ss-count:empty { display: none; }
.line-items .ss-pop { width: max(100%, 340px); }
@media print { .ss-pop { display: none !important; } }

/* ---------- bags & bosta, oil & fuel ---------- */
.bag-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.bag-card { background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: .9rem; }
.bag-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .7rem; }
.bag-ico { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(137,135,129,.14); color: var(--rm-ink-2); font-size: 1.1rem; }
.bag-name { font-weight: 700; line-height: 1.2; }
.bag-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.bag-col { border-radius: 10px; padding: .6rem .7rem; background: color-mix(in srgb, var(--tone) 7%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent); min-width: 0; }
.bag-lbl { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--tone); }
.bag-qty { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bag-qty small { font-size: .7rem; font-weight: 600; color: var(--rm-ink-2); }
.bag-bundle { font-size: .82rem; font-weight: 600; }
.oil-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.oil-item { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; }
.oil-tank { width: 26px; height: 64px; flex: 0 0 26px; border: 2px solid var(--rm-line); border-radius: 6px 6px 8px 8px; position: relative; overflow: hidden; background: var(--rm-surface); }
.oil-tank span { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#e6b43a, #c98a00); }
.oil-tank span.low { background: linear-gradient(#f08585, #d03b3b); }
.oil-q { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .bag-cols { grid-template-columns: 1fr; } }

/* ---------- bills & expense analysis ---------- */
.bill-trend { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.bt-card { display: block; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: .75rem .85rem; color: var(--rm-ink); transition: transform .15s, box-shadow .15s; }
.bt-card:hover { color: var(--rm-ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,20,.08); }
.bt-card .stat-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; font-size: .9rem; background: rgba(42,120,214,.12); color: #2a78d6; display: grid; place-items: center; }
.bt-val { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-now { border: 1px dashed var(--rm-line); border-radius: 10px; padding: .7rem; background: color-mix(in srgb, var(--rm-primary) 4%, transparent); }
.bill-pays td { background: color-mix(in srgb, var(--rm-line) 25%, transparent); }
.heads-menu { max-height: 320px; overflow-y: auto; min-width: 260px; }
.heads-menu .dropdown-item { white-space: normal; font-size: .86rem; cursor: pointer; }
.pivot-wrap { max-height: 70vh; }
.pivot th, .pivot td { font-size: .8rem; }
.pivot .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--rm-surface); min-width: 160px; }
.pivot thead th { position: sticky; top: 0; z-index: 2; background: var(--rm-surface); }
.pivot thead th.sticky-col { z-index: 3; }
.pv { font-size: .62rem; margin-left: .2rem; }
.pv.up { color: #d03b3b; } .pv.down { color: #1a8a5a; }
[data-bs-theme="dark"] .pv.up { color: #f08585; } [data-bs-theme="dark"] .pv.down { color: #5fd35f; }
@media (min-width: 992px) { .bill-cell { min-width: 240px; } }

/* ---------- POS: scan & sell ---------- */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.pos-side { position: sticky; top: calc(var(--topbar-h, 60px) + .75rem); }
.pos-scan-row { display: flex; gap: .5rem; }
.pos-scan-input { position: relative; flex: 1; margin: 0; }
.pos-scan-input > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); font-size: 1.35rem; color: var(--rm-primary); pointer-events: none; }
.pos-scan-input .form-control { padding-left: 2.9rem; font-weight: 600; letter-spacing: .02em; border-width: 2px; }
.pos-scan-input .form-control:focus { border-color: var(--rm-primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--rm-primary) 22%, transparent); }
.pos-pick { min-width: 0; max-width: 520px; }
.pos-msg { min-height: 1.4rem; margin-top: .45rem; font-size: .86rem; font-weight: 600; }
.pos-msg.good { color: var(--bs-success); }
.pos-msg.bad { color: var(--bs-danger); }
.pos kbd { font-size: .68rem; padding: .05rem .3rem; background: var(--rm-bg); color: var(--rm-ink-2); border: 1px solid var(--rm-line); box-shadow: none; }
.pos .btn-success kbd, .pos .btn-primary kbd { background: rgba(255,255,255,.2); color: inherit; border-color: transparent; }
.pos-cart th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rm-ink-2); font-weight: 600; white-space: nowrap; }
.pos-cart td { vertical-align: middle; }
.pos-c-qty { width: 180px; } .pos-c-rate { width: 110px; } .pos-c-amt { width: 120px; white-space: nowrap; } .pos-c-x { width: 44px; }
.pos-item-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pos-wh { position: relative; max-width: 260px; margin-top: .3rem; }
.pos-wh i { position: absolute; left: .5rem; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--rm-ink-2); pointer-events: none; }
.pos-wh .form-select { padding-left: 1.6rem; font-size: .8rem; }
.pos-qty { display: flex; align-items: stretch; }
.pos-qty .btn { width: 32px; padding: 0; font-weight: 700; flex: none; }
.pos-qty .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pos-qty .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.pos-qty .form-control { border-radius: 0; text-align: center; min-width: 0; font-weight: 600; }
.pos-sub { margin-top: .2rem; white-space: nowrap; }
.pos-bags { width: 56px; padding: 0 .25rem; border: 1px solid var(--rm-line); border-radius: 4px; background: var(--bs-body-bg); color: var(--bs-body-color); font-size: .78rem; }
.pos-cart tr.pos-over td { background: color-mix(in srgb, var(--bs-danger) 7%, transparent); }
.pos-cart tr.scan-hit td { animation: scanHit .9s ease-out; }
.pos-empty i { font-size: 2.4rem; opacity: .35; }
.pos-t { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .32rem 0; }
.pos-t > :first-child { color: var(--rm-ink-2); font-size: .88rem; margin: 0; }
.pos-t .form-control, .pos-t .form-select { max-width: 170px; text-align: right; }
.pos-t .form-select { text-align: left; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; margin: .5rem 0; padding: .65rem .8rem; border-radius: var(--rm-radius, 10px); background: var(--rm-primary-050); color: var(--rm-primary-600); }
.pos-total span { font-weight: 600; }
.pos-total b { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pos-change b { font-size: 1.15rem; }
.pos-quick { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.pos-quick:empty { display: none; }
.pos-done { border-color: color-mix(in srgb, var(--bs-success) 45%, var(--rm-line)); background: color-mix(in srgb, var(--bs-success) 6%, var(--rm-surface)); }
.pos-done-ic { font-size: 2rem; color: var(--bs-success); line-height: 1; }
.pos-print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
[data-bs-theme="dark"] .pos-total { background: color-mix(in srgb, var(--rm-primary) 18%, transparent); color: var(--bs-body-color); }
@media (max-width: 1199.98px) { .pos-grid { grid-template-columns: minmax(0, 1fr) 320px; } .pos-c-qty { width: 160px; } }
@media (max-width: 991.98px) {
  .pos-grid { grid-template-columns: minmax(0, 1fr); }
  .pos-side { position: static; }
}
@media (max-width: 767.98px) {
  .pos-cart thead { display: none; }
  .pos-cart, .pos-cart tbody, .pos-cart tr, .pos-cart td { display: block; width: 100% !important; }
  .pos-cart tr { position: relative; padding: .65rem .75rem; border-bottom: 1px solid var(--rm-line); display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; }
  .pos-cart td { border: 0; padding: 0; }
  .pos-cart td.pos-c-item { grid-column: 1 / -1; padding-right: 2.4rem; }
  .pos-cart td.pos-c-amt { grid-column: 1 / -1; text-align: right !important; font-size: 1.05rem; }
  .pos-cart td.pos-c-amt::before { content: attr(data-label); float: left; font-weight: 400; color: var(--rm-ink-2); font-size: .82rem; }
  .pos-cart td.pos-c-x { position: absolute; top: .55rem; right: .6rem; width: auto !important; }
  .pos-cart td.pos-c-qty::before, .pos-cart td.pos-c-rate::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--rm-ink-2); margin-bottom: .1rem; }
  .pos-scan-input .form-control { font-size: 1.05rem; }
}

/* ---------- barcode stock check ---------- */
.scan-hero { display: flex; gap: .5rem; }
.scan-card { border-left: 4px solid var(--tc, var(--rm-primary)); }
.scan-card.fresh { animation: scanIn .5s ease-out; }
@keyframes scanIn { from { opacity: .2; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.scan-card .type-dot { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.scan-total { font-size: 1.8rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.scan-bc svg { max-width: 190px; height: auto; background: #fff; border-radius: 6px; padding: 4px; }
.scan-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.scan-facts > div { background: var(--rm-bg); border: 1px solid var(--rm-line); border-radius: 8px; padding: .45rem .6rem; min-width: 0; }
.scan-facts span { display: block; font-size: .72rem; color: var(--rm-ink-2); }
.scan-facts b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.scan-wh li { padding: .4rem 0; border-bottom: 1px dashed var(--rm-line); }
.scan-wh li:last-child { border-bottom: 0; }
.scan-bar { height: 5px; border-radius: 3px; background: var(--rm-bg); margin-top: .3rem; overflow: hidden; }
.scan-bar span { display: block; height: 100%; background: var(--tc, var(--rm-primary)); border-radius: 3px; }
.scan-moves td { padding: .3rem .25rem; }
.scan-history .list-group-item { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.count-table td, .count-table th { vertical-align: middle; }
.count-table .diff-pos { color: var(--bs-success); font-weight: 600; }
.count-table .diff-neg { color: var(--bs-danger); font-weight: 600; }
.count-table input { width: 90px; text-align: right; }
.cam-view { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; }
.cam-aim { position: absolute; inset: 28% 12%; border: 2px solid rgba(255,255,255,.85); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.scan-jump { max-width: 210px; flex: 0 1 210px; }
@media (max-width: 379.98px) { .tb-scan { display: none !important; } }
/* barcode scanner status */
.scan-dot { position: absolute; right: 5px; bottom: 5px; width: 9px; height: 9px; border-radius: 50%; background: #a8a7a0; box-shadow: 0 0 0 2px var(--rm-surface); }
[data-scan-status][data-level="on"] .scan-dot { background: #1baf7a; }
[data-scan-status][data-level="idle"] .scan-dot { background: #eda100; }
.scan-menu { width: min(330px, calc(100vw - 24px)); }
.scn-head { display: flex; align-items: center; gap: .45rem; }
.scn-dot { width: 10px; height: 10px; border-radius: 50%; background: #a8a7a0; flex: 0 0 auto; }
.scn-on .scn-dot { background: #1baf7a; box-shadow: 0 0 0 3px rgba(27,175,122,.2); } .scn-idle .scn-dot { background: #eda100; }
.scn-sub { font-size: .8rem; color: var(--rm-ink-2); margin-top: .2rem; overflow-wrap: anywhere; }
.scan-toast { position: fixed; z-index: 1090; right: 16px; bottom: 16px; max-width: min(380px, calc(100vw - 32px)); background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 12px; padding: .75rem .9rem; font-size: .9rem; }
.scan-toast[hidden] { display: none; }
.scan-test-box { font-size: 1.25rem; height: 56px; }
.scan-steps li { margin-bottom: .35rem; }
.scan-dev { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--rm-line); flex-wrap: wrap; }
.scan-dev:last-child { border-bottom: 0; }
.scan-dev .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--rm-primary-050); color: var(--rm-primary); font-size: 1.15rem; flex: 0 0 auto; }

/* ---------- mill store: issue & return ---------- */
.btn-xs { padding: .08rem .45rem; font-size: .72rem; border-radius: 6px; }
.page-tabs { gap: .35rem; flex-wrap: wrap; }
.page-tabs .nav-link { white-space: nowrap; border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink); padding: .4rem .8rem; font-size: .86rem; }
.page-tabs .nav-link.active { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }
.page-tabs .nav-link.active .badge.text-bg-light { background: rgba(255,255,255,.22) !important; color: #fff !important; border-color: transparent !important; }
.issue-avatar { width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: 1.2rem;
  background: var(--rm-primary-050); color: var(--rm-primary-600); border: 1px solid color-mix(in srgb, var(--rm-primary) 25%, transparent); }
.issue-avatar.sm { width: 36px; height: 36px; font-size: .95rem; }
[data-bs-theme="dark"] .issue-avatar { background: color-mix(in srgb, var(--rm-primary) 22%, transparent); color: var(--bs-body-color); }
.stat-grid-1 { grid-template-columns: 1fr !important; }
.staff-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.staff-card.is-overdue { border-color: color-mix(in srgb, var(--bs-danger) 50%, var(--rm-line)); }
.staff-items li { padding: .35rem 0; border-bottom: 1px dashed var(--rm-line); }
.staff-items li:last-child { border-bottom: 0; }
.staff-items a { color: inherit; text-decoration: none; }
.staff-items a:hover b { text-decoration: underline; }
tr.row-overdue > td:first-child { box-shadow: inset 3px 0 0 var(--bs-danger); }
a.where-chip { text-decoration: none; color: inherit; }
.where-chip.chip-danger { border-color: color-mix(in srgb, var(--bs-danger) 50%, transparent); color: var(--bs-danger); }
.where-chip.chip-danger i { background: var(--bs-danger); }
.return-table input.form-control { min-width: 72px; }
.tool-tag { display: inline-block; font-size: .66rem; font-weight: 600; letter-spacing: .02em; padding: .05rem .4rem; border-radius: 4px; vertical-align: middle;
  background: color-mix(in srgb, #eda100 18%, transparent); color: #9a6a00; }
[data-bs-theme="dark"] .tool-tag { color: #f3cd6d; }
.out-chip { display: inline-flex; align-items: center; white-space: nowrap; gap: .3rem; font-size: .72rem; border-radius: 999px; padding: .12rem .5rem; margin: .1rem .15rem .1rem 0;
  background: color-mix(in srgb, #eda100 14%, transparent); color: inherit; text-decoration: none; border: 1px solid color-mix(in srgb, #eda100 40%, transparent); }
.out-chip.od { background: color-mix(in srgb, var(--bs-danger) 12%, transparent); border-color: color-mix(in srgb, var(--bs-danger) 45%, transparent); color: var(--bs-danger); }
.chip-sep { width: 1px; align-self: stretch; background: var(--rm-line); margin: 0 .15rem; }
/* due list: new / old split */
.age-split { display: grid; gap: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.age-card { display: flex; gap: .75rem; align-items: center; padding: .8rem .95rem; border-radius: 12px; border: 1px solid var(--rm-line); background: var(--rm-surface); color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.age-card:hover { border-color: color-mix(in srgb, var(--rm-primary) 45%, var(--rm-line)); }
.age-card.active { border-color: var(--rm-primary); box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--rm-primary) 18%, transparent); }
.age-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; flex: none; background: var(--rm-bg); }
.age-new .age-ic { background: color-mix(in srgb, #2a78d6 14%, transparent); color: #2a78d6; }
.age-old .age-ic { background: color-mix(in srgb, #6a5bd0 14%, transparent); color: #6a5bd0; }
.age-all .age-ic { background: color-mix(in srgb, #d03b3b 12%, transparent); color: #d03b3b; }
.age-l { display: block; font-size: .78rem; color: var(--rm-ink-2); }
.age-n { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.age-a { display: block; font-size: .8rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.age-note { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .age-split { grid-template-columns: 1fr; gap: .5rem; } .age-card { padding: .6rem .75rem; } .age-n { font-size: 1.25rem; } }
@media (max-width: 575.98px) { .page-tabs { flex-wrap: wrap; overflow: visible; } .page-tabs .nav-item { flex: 1 1 calc(50% - .35rem); } .page-tabs .nav-link { text-align: center; padding: .4rem .5rem; } }
.flex-none { flex: none; }
/* payment details (bank / mobile banking) */
.pay-details { margin-top: .75rem; }
.pay-box { border: 1px dashed color-mix(in srgb, var(--rm-primary) 35%, var(--rm-line)); border-radius: 10px; padding: .65rem .75rem; background: color-mix(in srgb, var(--rm-primary) 4%, var(--rm-surface)); }
.pay-box-title { font-size: .8rem; font-weight: 600; margin-bottom: .45rem; }
.pay-box .form-label { font-size: .72rem; margin-bottom: .15rem; }
.pos-pay .pay-details { margin: .35rem 0 .2rem; }
/* notification bell */
.alert-item .alert-hide { border: 0; background: transparent; color: var(--rm-ink-2); padding: 0 .6rem; border-radius: 0; }
.alert-item .alert-hide:hover { color: var(--bs-danger); background: color-mix(in srgb, var(--bs-danger) 8%, transparent); }
.alert-item.hiding { opacity: .4; pointer-events: none; }
.alerts-menu .dropdown-item { white-space: normal; }

/* =========================================================
   Interface languages: script fonts, right-to-left tweaks
   ========================================================= */
html[lang="hi"], html[lang="mr"], html[lang="ne"], html[lang="kok"], html[lang="mai"], html[lang="brx"], html[lang="doi"], html[lang="sa"] { --bs-body-font-family: "Noto Sans Devanagari", "Nirmala UI", "Mangal", "Kohinoor Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ta"] { --bs-body-font-family: "Noto Sans Tamil", "Nirmala UI", "Latha", "Tamil Sangam MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="te"] { --bs-body-font-family: "Noto Sans Telugu", "Nirmala UI", "Gautami", "Telugu Sangam MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="kn"] { --bs-body-font-family: "Noto Sans Kannada", "Nirmala UI", "Tunga", "Kannada Sangam MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ml"] { --bs-body-font-family: "Noto Sans Malayalam", "Nirmala UI", "Kartika", "Malayalam Sangam MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="gu"] { --bs-body-font-family: "Noto Sans Gujarati", "Nirmala UI", "Shruti", "Gujarati Sangam MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="pa"] { --bs-body-font-family: "Noto Sans Gurmukhi", "Nirmala UI", "Raavi", "Gurmukhi MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="or"] { --bs-body-font-family: "Noto Sans Oriya", "Nirmala UI", "Kalinga", "Oriya Sangam MN", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="as"] { --bs-body-font-family: "Hind Siliguri", "Nirmala UI", "Vrinda", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="mni"] { --bs-body-font-family: "Noto Sans Meetei Mayek", "Nirmala UI", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="sat"] { --bs-body-font-family: "Noto Sans Ol Chiki", "Nirmala UI", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ur"] { --bs-body-font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ks"], html[lang="sd"], html[lang="ug"] { --bs-body-font-family: "Noto Naskh Arabic", "Microsoft Uighur", "Segoe UI", Tahoma, "Arial Unicode MS", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="bo"] { --bs-body-font-family: "Noto Serif Tibetan", "Microsoft Himalaya", "Jomolhari", "Kailasa", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="zh-CN"] { --bs-body-font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="zh-TW"] { --bs-body-font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="yue"] { --bs-body-font-family: "PingFang HK", "Microsoft JhengHei", "Noto Sans HK", "Noto Sans CJK HK", "Noto Sans CJK TC", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ja"] { --bs-body-font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ko"] { --bs-body-font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
html[lang="ur"] body { line-height: 1.85; }
html[lang="ur"] .btn, html[lang="ur"] .form-control, html[lang="ur"] .form-select, html[lang="ur"] .badge, html[lang="ur"] .nav-link { line-height: 1.6; }
html[lang="bo"] body { line-height: 1.7; }
html[lang="ks"] body, html[lang="sd"] body, html[lang="ug"] body { line-height: 1.7; }
/* scripts with tall glyphs: keep the uppercase micro-labels readable */
html:not([lang="en"]):not([lang="ru"]):not([lang="mn"]) .form-label, html:not([lang="en"]):not([lang="ru"]):not([lang="mn"]) .kpi-label, html:not([lang="en"]):not([lang="ru"]):not([lang="mn"]) th { text-transform: none; letter-spacing: 0; }
[dir="rtl"] .bi-arrow-right, [dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-chevron-right, [dir="rtl"] .bi-chevron-left, [dir="rtl"] .bi-arrow-return-left, [dir="rtl"] .bi-box-arrow-right, [dir="rtl"] .bi-arrow-right-circle { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .num, [dir="rtl"] input[type="number"], [dir="rtl"] input[type="tel"], [dir="rtl"] .ltr { direction: ltr; unicode-bidi: plaintext; }
/* language picker */
.lang-menu { width: min(340px, calc(100vw - 24px)); max-height: min(75vh, 620px); overflow-y: auto; padding: .35rem 0; }
.lang-menu .lang-find { position: sticky; top: -.35rem; background: var(--bs-dropdown-bg, var(--bs-body-bg)); padding: .35rem .75rem .4rem; z-index: 1; }
.lang-menu .lang-group { padding: .5rem .9rem .15rem; font-size: .7rem; font-weight: 600; color: var(--rm-ink-2); letter-spacing: .03em; }
.lang-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; padding: .35rem .9rem; white-space: normal; }
.lang-menu .dropdown-item .ln { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.lang-menu .dropdown-item .le { font-size: .74rem; color: var(--rm-ink-2); text-align: end; }
.lang-menu .dropdown-item.active .le { color: inherit; opacity: .85; }
.lang-menu .lang-beta { font-size: .62rem; padding: .05rem .3rem; border-radius: 4px; background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.lang-btn span { font-weight: 700; font-size: .78rem; }

/* =========================================================
   Profile photos / avatars
   ========================================================= */
.ava { --s: 32px; width: var(--s); height: var(--s); flex: 0 0 var(--s); border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; vertical-align: middle;
  font-weight: 700; font-size: calc(var(--s) * .38); line-height: 1; color: #fff; background: var(--rm-primary); user-select: none; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava-xs { --s: 22px; } .ava-sm { --s: 32px; } .ava-md { --s: 44px; } .ava-lg { --s: 72px; } .ava-xl { --s: 104px; }
.ava-c0 { background: #1d6b47; } .ava-c1 { background: #2a78d6; } .ava-c2 { background: #c26a12; } .ava-c3 { background: #7a4fc4; }
.ava-c4 { background: #b23a5b; } .ava-c5 { background: #0f8a8a; } .ava-c6 { background: #5d6b2e; } .ava-c7 { background: #6b5a4a; }
.btn-user .ava { --s: 30px; border-radius: 9px; }
.ava-ring { box-shadow: 0 0 0 3px var(--rm-surface), 0 0 0 4px var(--rm-line); }
.person-cell { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.person-cell > div { min-width: 0; }
.photo-pick { display: flex; gap: 1rem; align-items: center; }
.photo-pick-img .ava { box-shadow: 0 0 0 3px var(--rm-surface), 0 0 0 4px var(--rm-line); }
.photo-pick-body { flex: 1 1 auto; min-width: 0; }
@media (max-width: 420px) { .photo-pick { flex-direction: column; align-items: flex-start; } }
.emp-hero { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.emp-hero .ava-xl { --s: 120px; }
.emp-hero h2 { margin: 0; font-size: 1.45rem; font-weight: 700; }
.emp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem 1.25rem; }
.emp-facts .k { font-size: .72rem; color: var(--rm-ink-2); font-weight: 600; }
.emp-facts .v { font-weight: 600; overflow-wrap: anywhere; }
.tr-table textarea { field-sizing: content; min-height: 31px; resize: vertical; }
.tr-table tr.tr-missing td:first-child { box-shadow: inset 3px 0 0 var(--bs-warning); }

/* ---- v1.14 machines & sections, brand service life, devices, messages ---- */
.type-dot { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; flex: none; vertical-align: baseline; }
.insight-card { border-left: 4px solid var(--rm-accent); }
.insight-list { list-style: none; padding: 0; display: grid; gap: .45rem; }
.insight-list li { display: flex; gap: .6rem; align-items: flex-start; line-height: 1.45; }
.insight-list li > i { color: var(--rm-accent); font-size: 1.05rem; margin-top: .05rem; flex: none; }
.share-bar { height: .45rem; border-radius: 999px; background: var(--rm-line); overflow: hidden; margin-bottom: .15rem; }
.share-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--rm-primary); }
.legend-list { display: grid; gap: .3rem; font-size: .82rem; }
.legend-list > div { display: flex; align-items: center; gap: .45rem; }
.legend-list b { margin-inline-start: auto; }
.brand-card .table td.num, .brand-card .table th { white-space: nowrap; }
.brand-card .brand-tag { margin: .1rem 0; white-space: nowrap; }
.brand-tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; }
.brand-tag.best { background: var(--rm-primary-050); color: var(--rm-primary); }
.brand-tag.longest { background: #e5efff; color: #1f5fbf; }
.brand-tag.short { background: #fdecec; color: #b42323; }
[data-bs-theme=dark] .brand-tag.longest { background: #172540; color: #8fb6ff; }
[data-bs-theme=dark] .brand-tag.short { background: #3a1919; color: #ff9b9b; }
.life-bar { position: relative; height: .55rem; border-radius: 999px; background: var(--rm-line); min-width: 90px; }
.life-bar > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: #2a78d6; }
.life-bar > span.best { background: var(--rm-primary); }
.life-bar > span.short { background: #d03b3b; }
.pick-box { border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: .75rem 1rem; background: var(--rm-primary-050); }
.pick-box strong { color: var(--rm-primary); }
.dev-ico { width: 2.2rem; height: 2.2rem; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center; background: var(--rm-primary-050); color: var(--rm-primary); font-size: 1.1rem; flex: none; }
.dev-ico.pending { background: var(--rm-accent-050); color: var(--rm-accent); }
.dev-ico.blocked { background: #fdecec; color: #b42323; }
[data-bs-theme=dark] .dev-ico.blocked { background: #3a1919; color: #ff9b9b; }
.dev-meta { font-size: .78rem; color: var(--rm-ink-2); }
.dev-meta code { font-size: .75rem; }
.pending-req { border: 1px solid var(--rm-accent); border-radius: var(--rm-radius); padding: .75rem 1rem; background: var(--rm-accent-050); }
.otp-input { font-size: 1.6rem; letter-spacing: .5rem; text-align: center; font-variant-numeric: tabular-nums; }
.otp-wait { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--rm-ink-2); }
.msg-body { white-space: pre-wrap; font-size: .82rem; max-width: 420px; }
.tpl-vars code { cursor: pointer; }
.time-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.time-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--rm-line); border-radius: 999px; padding: .2rem .25rem .2rem .7rem; background: var(--rm-surface); font-weight: 600; font-variant-numeric: tabular-nums; }
.time-chip button { border: 0; background: transparent; color: var(--rm-ink-2); padding: 0 .3rem; line-height: 1; }
.cmd-box { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; background: var(--rm-bg); border: 1px solid var(--rm-line); border-radius: .5rem; padding: .5rem .65rem; word-break: break-all; }
.ext-ok { color: var(--rm-primary); }
.ext-no { color: #b42323; }

/* v1.15 — customer due widget, reminders */
.due-widget { border-left: 4px solid #e34948; }
.due-w-grid { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.6fr); align-items: stretch; }
.due-w-total { display: flex; gap: .85rem; align-items: center; color: inherit; text-decoration: none; padding: .35rem .25rem; border-radius: 10px; min-width: 0; }
.due-w-total:hover .due-w-v { text-decoration: underline; }
.due-w-ic { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.55rem; color: #e34948; background: color-mix(in srgb, #e34948 13%, transparent); }
.due-w-l { display: block; font-size: .78rem; color: var(--rm-ink-2, #6b6a65); text-transform: uppercase; letter-spacing: .03em; }
.due-w-v { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.15; color: #c9302c; word-break: break-word; }
.due-w-v2 { display: block; font-size: 1.2rem; font-weight: 700; line-height: 1.2; margin: .15rem 0; }
.due-w-s { display: block; font-size: .82rem; color: var(--rm-ink-2, #6b6a65); }
.due-w-box { display: block; padding: .6rem .8rem; border: 1px solid var(--rm-line); border-radius: 10px; color: inherit; text-decoration: none; min-width: 0; }
a.due-w-box:hover { border-color: color-mix(in srgb, #eda100 55%, var(--rm-line)); }
.due-w-box.warn .due-w-v2 { color: #b87700; }
.due-w-top { min-width: 0; }
.due-w-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .5rem; font-size: .84rem; color: var(--rm-ink); text-decoration: none; padding: .12rem 0; }
.due-w-row .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--rm-line); overflow: hidden; }
.due-w-row .bar span { display: block; height: 100%; background: #e34948; opacity: .7; border-radius: 4px; }
.due-w-row:hover span:first-child { color: var(--rm-primary); text-decoration: underline; }
@media (max-width: 1199.98px) { .due-w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .due-w-total, .due-w-top { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .due-w-v { font-size: 1.4rem; } .due-w-ic { width: 44px; height: 44px; font-size: 1.3rem; } .due-w-grid { gap: .5rem; } }
.took-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 0; }
.took-chips .tc-l { font-size: .85rem; font-weight: 600; color: var(--bs-secondary-color, #5f6b63); margin-inline-end: .25rem; }
.took-chips .btn { border-radius: 999px; --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .8rem; }
.due-table .c-took { color: var(--bs-info-text-emphasis, #055160); white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
@media (max-width: 575.98px) { .took-chips .tc-l { flex-basis: 100%; } }
.remind-bar { position: sticky; top: calc(var(--rm-topbar-h, 56px) + .25rem); z-index: 5; }
.sms-preview { white-space: pre-wrap; background: color-mix(in srgb, var(--rm-primary) 7%, var(--rm-surface)); border: 1px dashed var(--rm-line); border-radius: 10px; padding: .5rem .7rem; max-width: 46rem; }
@media (max-width: 575.98px) { .remind-bar { position: static; } .remind-bar .btn { flex: 1 1 auto; } }

/* v1.15 — old & new stock */
.age-stock-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.age-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--rm-line); }
.age-bar.sm { height: 7px; }
.age-bar span { display: block; height: 100%; }
.ab-b30 { background: #1baf7a; } .ab-b90 { background: #7cc35a; } .ab-b180 { background: #eda100; } .ab-b365 { background: #eb6834; } .ab-old { background: #c9302c; }
.ab-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; vertical-align: -1px; }
.wh-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.wh-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; line-height: 1.2; padding: .18rem .45rem; border-radius: 999px; border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink); cursor: pointer; max-width: 100%; }
.wh-chip:hover { border-color: var(--rm-primary); }
.wh-chip.on { border-color: var(--rm-primary); background: color-mix(in srgb, var(--rm-primary) 12%, var(--rm-surface)); font-weight: 600; }
.wh-chip .old { color: #c9302c; font-weight: 600; }
.wh-chip.empty { opacity: .55; cursor: default; }
.wh-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.wh-age-list { display: grid; gap: .6rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wh-age-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rm-line); }
.wh-age-row .age-bar { grid-column: 1 / -1; }
.wh-age { display: flex; flex-wrap: wrap; gap: .15rem .9rem; margin: -.15rem 0 .45rem; }
.tpl-lang-sel { width: auto; max-width: 100%; min-width: 0; flex: 0 1 auto; }
/* v1.15.1 — big amounts always fit their box (font shrinks, digits never break across lines) */
.due-w-total > .min-w-0 { flex: 1 1 auto; container-type: inline-size; }
.due-w-v { font-size: 1.75rem; font-size: clamp(1.05rem, 12cqi, 2.1rem); white-space: nowrap; word-break: normal; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.due-w-box { container-type: inline-size; }
.due-w-v2 { font-size: clamp(.95rem, 10cqi, 1.3rem); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-value, .stat-value, .age-a, .due-total-v { white-space: nowrap; overflow-wrap: normal; }
[data-fit-done] { overflow: hidden; text-overflow: clip; }

/* v1.15.1 — due list: compact cards on phones and tablets (2 per row on tablets) */
@media (max-width: 1199.98px) {
  .due-table { --c0: 1; }
  .due-table.has-chk { --c0: 2; }
  .due-table thead { display: none; }
  .table-responsive > .due-table { min-width: 0 !important; }
  .due-table, .due-table tbody, .due-table tfoot { display: block; width: 100%; }
  .due-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: .45rem; row-gap: .2rem; margin: .55rem; padding: .65rem .75rem; border: 1px solid var(--rm-line); border-radius: 12px; background: var(--rm-surface); }
  .due-table.has-chk tr { grid-template-columns: 1.5rem minmax(0, 1fr) minmax(0, 1fr); }
  .due-table > :not(caption) > * > * { border: 0; padding: 0; background: transparent; box-shadow: none; }
  .due-table td { min-width: 0; }
  .due-table .c-chk { grid-column: 1; grid-row: 1 / span 2; padding-top: .15rem; }
  .due-table .c-chk .form-check-input { width: 1.2rem; height: 1.2rem; }
  .due-table .c-name { grid-column: var(--c0) / -1; grid-row: 1; }
  .due-table .c-sub { white-space: normal; overflow-wrap: anywhere; }
  .due-table .c-mob { grid-column: var(--c0) / -1; grid-row: 2; font-size: .88rem; }
  .due-table .c-total { grid-column: var(--c0) / -1; grid-row: 3; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-top: .35rem; padding: .4rem .6rem !important; border-radius: 9px; background: color-mix(in srgb, #e34948 9%, var(--rm-surface)) !important; color: #c9302c; text-align: right; }
  .due-table .c-total::before { content: attr(data-label); font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rm-ink-2); font-weight: 600; flex: 0 0 auto; }
  .due-table .c-total .due-total-v { display: block; min-width: 0; flex: 1 1 auto; font-size: 1.2rem; white-space: nowrap; text-align: right; }
  .due-table .c-age { text-align: left !important; font-size: .82rem; padding: .3rem .45rem !important; border-radius: 8px; background: color-mix(in srgb, var(--rm-bg) 70%, var(--rm-surface)) !important; }
  .due-table .c-age::before { content: attr(data-label) " " attr(data-days); display: block; font-size: .64rem; color: var(--rm-ink-2); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
  .due-table .c-age .age-v { display: block; white-space: nowrap; }
  .due-table .c-age:nth-child(1 of .c-age), .due-table .c-age:nth-child(3 of .c-age) { grid-column: var(--c0); }
  .due-table .c-age:nth-child(2 of .c-age), .due-table .c-age:nth-child(4 of .c-age) { grid-column: calc(var(--c0) + 1); }
  .due-table .c-age:nth-child(-n+2 of .c-age) { grid-row: 4; }
  .due-table .c-age:nth-child(n+3 of .c-age) { grid-row: 5; }
  .due-table .c-last { grid-column: var(--c0) / -1; grid-row: 6; font-size: .8rem; white-space: normal; margin-top: .3rem; }
  .due-table .c-last .small { display: inline; margin-left: .5rem; }
  .due-table .c-act { grid-column: 1 / -1; grid-row: 7; display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; margin-top: .45rem; white-space: normal; }
  .due-table .c-act:empty { display: none; }
  .due-table .c-act .btn { flex: 1 1 auto; }
  .due-table tr:has(.empty-row) { display: block; }
  .due-table tfoot tr { background: color-mix(in srgb, var(--rm-primary) 6%, var(--rm-surface)); font-weight: 700; }
  .due-table tfoot .c-chk, .due-table tfoot .c-act { display: none; }
  .due-table.has-chk tfoot tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .due-table.has-chk tfoot { --c0: 1; }
  .due-table tfoot .c-total { grid-row: 2; }
  .due-table tfoot .c-age:nth-child(-n+2 of .c-age) { grid-row: 3; }
  .due-table tfoot .c-age:nth-child(n+3 of .c-age) { grid-row: 4; }
}
@media (min-width: 576px) and (max-width: 1199.98px) {
  .due-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .25rem; }
  .due-table tbody tr { margin: .3rem; align-content: start; }
  .due-table tbody tr:has(.empty-row) { grid-column: 1 / -1; }
  .due-table tfoot tr { max-width: calc(50% - .6rem); margin-left: auto; }
}
@media (min-width: 1200px) and (max-width: 1499.98px) {
  .due-table { font-size: .84rem; }
  .due-table > :not(caption) > * > * { padding-left: .4rem; padding-right: .4rem; }
  .due-table .c-sub { max-width: 16rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.due-table .c-total .due-total-v { font-variant-numeric: tabular-nums; }
.age-v { font-variant-numeric: tabular-nums; }
.stat-body { flex: 1 1 auto; max-width: 100%; align-self: stretch; }
.stat-value { display: block; max-width: 100%; }

/* v1.16 — bags (bosta): size & kind on line forms, bag chips in godowns */
.line-items .col-bags { min-width: 140px; }
.line-items .col-wh { min-width: 150px; }
.li-bagpack { display: flex; gap: .25rem; margin-top: .25rem; }
.li-bagpack[hidden] { display: none; }
.li-bagpack .li-bagkg { min-width: 0 !important; width: 4.4rem; flex: 0 0 4.4rem; }
.li-bagpack .li-bagtype { min-width: 0 !important; flex: 1 1 auto; padding-right: 1.6rem; }
@media (max-width: 767.98px) { .line-items td.col-bags { grid-column: 1 / -1; } .li-bagpack .li-bagkg { width: 6rem; flex-basis: 6rem; } }
.bag-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.bag-chip { display: inline-flex; align-items: baseline; gap: .2rem; font-size: .74rem; line-height: 1.25; padding: .14rem .45rem; border-radius: 999px; border: 1px solid var(--rm-line); background: var(--rm-surface); white-space: nowrap; }
.bag-chip b { font-variant-numeric: tabular-nums; }
.bag-chip.bag-jute { border-color: color-mix(in srgb, #b07a2a 45%, var(--rm-line)); background: color-mix(in srgb, #b07a2a 9%, var(--rm-surface)); }
.bag-chip.bag-poly { border-color: color-mix(in srgb, #2a78d6 40%, var(--rm-line)); background: color-mix(in srgb, #2a78d6 8%, var(--rm-surface)); }
.bag-chip.bag-loose { border-style: dashed; }
.bagw-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bagw-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.bagw-nums > div { min-width: 0; container-type: inline-size; }
.bagw-l { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rm-ink-2); font-weight: 600; }
.bagw-v { display: block; font-size: 1.3rem; font-size: clamp(.9rem, 16cqi, 1.45rem); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wh-bag-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.wh-bag-row { padding: .5rem 0; border-bottom: 1px solid var(--rm-line); }
.wh-bag-row:last-child { border-bottom: 0; }
.wh-bags-line { display: flex; flex-wrap: wrap; gap: .2rem .6rem; font-size: .78rem; margin: -.1rem 0 .4rem; }
.bagw-age { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .82rem; }
.wh-places summary { cursor: pointer; color: var(--rm-ink-2); }
.wh-place-list { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.wh-place { border: 1px solid var(--rm-line); border-left: 4px solid var(--zc, #2a78d6); border-radius: 10px; padding: .45rem .6rem; min-width: 0; }
.wh-place-h { margin-bottom: .2rem; font-size: .86rem; }
.wh-place .zone-code { display: inline-block; font-size: .68rem; font-weight: 700; padding: 0 .35rem; border-radius: 5px; background: color-mix(in srgb, var(--zc, #2a78d6) 15%, var(--rm-surface)); }
.wh-place-it{display:flex;flex-wrap:wrap;justify-content:space-between;column-gap:.5rem}
.wh-place-it .wh-place-n{min-width:0;overflow-wrap:anywhere;font-weight:500}
.line-items[data-wh-stock] .col-wh { min-width: 190px; }
@media (min-width: 1600px) { .line-items[data-wh-stock] .col-wh { min-width: 260px; } }
.line-items .li-wh-stock option.wh-none { color: #8a8f98; }
.li-short { margin-top: .2rem; line-height: 1.2; }
@media (max-width: 1399.98px) { .line-items[data-wh-stock] .col-wh { min-width: 0; } }

/* ---------- Side menu v1.16.1: coloured categories, icon tiles, sub-menu icons, shortcuts ---------- */
.nav-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; padding: .55rem .7rem .1rem; }
.nav-q { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-width: 0; padding: .4rem .2rem .35rem;
  border-radius: 10px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06); color: #c9d8cf; text-decoration: none; font-size: .64rem; line-height: 1.15; text-align: center; }
.nav-q i { font-size: 1.02rem; color: #e6b43a; }
.nav-q span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-q:hover, .nav-q.on { background: rgba(230,180,58,.14); border-color: rgba(230,180,58,.3); color: #fff; }
.nav-heading { display: flex; align-items: center; gap: .45rem; font-weight: 600; color: #7f9a8a; padding: 1.05rem .75rem .4rem; }
.nav-heading::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--cat, #8fb3a0); flex: 0 0 auto; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat, #8fb3a0) 22%, transparent); }
.nav-heading::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.06); }
.sidebar .nav-item > .nav-link:not(.sub) > i.bi:first-child { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; font-size: .98rem; opacity: 1;
  color: var(--cat, #c9d8cf); background: rgba(255,255,255,.06); background: color-mix(in srgb, var(--cat, #8fb3a0) 15%, transparent); transition: background .15s, color .15s; }
.sidebar .nav-item > .nav-link:not(.sub) { padding: .36rem .6rem; gap: .65rem; }
.sidebar .nav-item > .nav-link:not(.sub):hover > i.bi:first-child, .sidebar .nav-item.current > .nav-group > i.bi:first-child { background: var(--cat, #8fb3a0); color: #0e261b; }
.sidebar .nav-item > .nav-link.active > i.bi:first-child { background: rgba(255,255,255,.18); color: #fff; }
.sidebar .nav-item.current > .nav-group::before, .sidebar .nav-link.active:not(.sub)::before { background: var(--cat, #e6b43a); }
.nav-sub { margin: .15rem 0 .45rem 1.55rem; padding-left: .55rem; border-left: 1px dashed color-mix(in srgb, var(--cat, #8fb3a0) 35%, transparent); }
.sidebar .nav-link.sub { gap: .55rem; padding: .34rem .55rem; }
.sidebar .nav-link.sub > i { font-size: .82rem; width: 1rem; flex: 0 0 1rem; opacity: .65; color: var(--cat, #a9bdb1); }
.sidebar .nav-link.sub:hover > i, .sidebar .nav-link.sub.active > i { opacity: 1; }
.sidebar .nav-link.sub > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.sidebar .nav-link.sub.active::before { background: var(--cat, #e6b43a); }
.nav-subhead { color: color-mix(in srgb, var(--cat, #6f8c7c) 55%, #6f8c7c); }
@media (min-width: 992px) {
  html.nav-rail .nav-quick { grid-template-columns: 1fr; padding: .5rem .55rem 0; }
  html.nav-rail .nav-q span { display: none; }
  html.nav-rail .nav-q { padding: .45rem 0; }
  html.nav-rail .nav-heading::before, html.nav-rail .nav-heading::after { display: none; }
  html.nav-rail .sidebar .nav-item > .nav-link:not(.sub) { padding: .3rem 0; }
  html.nav-rail .sidebar .nav-item > .nav-link:not(.sub) > i.bi:first-child { width: 38px; height: 38px; flex-basis: 38px; font-size: 1.1rem; }
  html.nav-rail .sidebar .nav-item.current > .nav-group { background: transparent; }
  html.nav-rail .nav-item.fly .nav-link.sub > i { display: inline-block; font-size: .85rem; width: 1rem; }
  html.nav-rail .nav-item.fly .nav-fly-title > i { color: var(--cat, #fff); }
}
/* serial number of each line on sale / purchase forms */
.line-items th.col-sl, .line-items td.col-sl { width: 46px; text-align: center; }
.li-sl { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 .4rem; border-radius: 999px; background: var(--rm-primary-050); color: var(--rm-primary); font-weight: 700; font-size: .8rem; margin-top: .15rem; }
[data-bs-theme="dark"] .li-sl { background: rgba(80,190,130,.16); color: #8fd9b0; }

/* sale / purchase line cards: number + remove button on top, roomy grid on laptops (cards up to 1600px) */
@media (min-width: 1400px) and (max-width: 1599.98px) {
  .line-items.li-cards thead { display: none; }
  .line-items.li-cards, .line-items.li-cards tbody, .line-items.li-cards tfoot { display: block; }
  .line-items.li-cards tr { display: grid; gap: .5rem; padding: .75rem; border: 1px solid var(--rm-line); border-radius: 10px; margin-bottom: .6rem; background: var(--rm-surface); }
  .line-items.li-cards td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
  .line-items.li-cards td::before { content: attr(data-label); display: block; font-size: .68rem; text-transform: uppercase; color: var(--rm-ink-2); font-weight: 600; margin-bottom: .15rem; }
  .line-items.li-cards td[data-label=""]::before { content: none; }
  .line-items.li-cards .form-control, .line-items.li-cards .form-select, .line-items.li-cards .col-product, .line-items.li-cards .col-wh { min-width: 0 !important; }
}
@media (max-width: 1599.98px) {
  .line-items.li-cards tbody tr { position: relative; }
  .line-items.li-cards td.col-sl { grid-column: 1 / -1; display: flex !important; align-items: center; gap: .5rem; text-align: left; width: auto; padding-right: 3rem !important; }
  .line-items.li-cards td.col-sl::before { content: none !important; }
  .line-items.li-cards td.col-sl .li-sl { margin: 0; }
  .line-items.li-cards td.col-sl::after { content: ""; flex: 1; height: 1px; background: var(--rm-line); }
  .line-items.li-cards td.col-rm { position: absolute; top: .55rem; right: .7rem; width: auto; }
  .line-items.li-cards td.col-rm .li-remove { padding: .1rem .45rem; }
  .line-items .col-qty .input-group { flex-wrap: nowrap; }
}
@media (min-width: 992px) and (max-width: 1599.98px) {
  .line-items.li-cards tbody tr { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .line-items.li-cards td.col-product, .line-items.li-cards td.col-wh { grid-column: span 3; }
  .line-items.li-cards td.col-bags { grid-column: span 2; }
  .line-items.li-cards td.col-qty { grid-column: span 2; }
  .line-items.li-cards td.col-rate, .line-items.li-cards td.col-amt, .line-items.li-cards td.col-moist { grid-column: span 1; }
  .line-items.li-cards td.col-moist ~ td.col-amt { grid-column: 5 / -1; }
}
@media (min-width: 1600px) {
  .line-items .col-bags { min-width: 220px; }
  .line-items .col-wh { min-width: 210px; }
  .line-items .col-qty { min-width: 150px; }
  .line-items .col-qty .input-group { flex-wrap: nowrap; }
}
/* searchable select inside an input group (customer / supplier + add button) */
.input-group > .ss-wrap { flex: 1 1 auto; width: 1%; }
.input-group > .ss-wrap:not(:last-child) .ss-toggle { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .ss-wrap + .btn, .input-group > .ss-wrap + a.btn { margin-left: -1px; }
@media (max-width: 767.98px) { .line-items.li-cards tbody { padding: 0 .5rem; } }
/* bag (bosta) & transport costs of a purchase */
.pcost-box { height: 100%; border: 1px dashed var(--rm-line); border-radius: 12px; padding: .75rem .85rem .6rem; background: color-mix(in srgb, var(--pc, #c98a00) 5%, var(--rm-surface)); }
.pcost-box.pc-bag { --pc: #c98a00; } .pcost-box.pc-tr { --pc: #2a78d6; }
.pcost-title { display: flex; align-items: center; gap: .45rem; font-weight: 700; margin-bottom: .5rem; color: var(--pc); }
.pcost-title i { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--pc) 15%, transparent); }
.pcost-box .form-label { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.pcost-foot { display: flex; justify-content: flex-end; gap: .5rem; align-items: baseline; border-top: 1px dashed var(--rm-line); margin-top: .6rem; padding-top: .45rem; font-size: .85rem; color: var(--rm-ink-2); }
.pcost-foot strong { color: var(--rm-ink); font-size: .95rem; }
.pcost-hint { font-size: .7rem; line-height: 1.25; }
.pcost-sum { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; justify-content: flex-end; height: 100%; padding: .55rem .75rem; border-radius: 10px; background: var(--rm-primary-050); font-size: .82rem; color: var(--rm-ink-2); }
.pcost-sum strong { color: var(--rm-ink); white-space: nowrap; }
.pcost-sum .op { color: var(--rm-ink-2); font-weight: 700; }
.pcost-sum .all strong { color: var(--rm-primary); font-size: 1rem; }
[data-bs-theme="dark"] .pcost-sum { background: rgba(80,190,130,.1); }
@media (max-width: 575.98px) { .pcost-sum { justify-content: flex-start; } .pcost-sum .all { flex-basis: 100%; } }
/* purchase view: cost panel and report */
.pcost-panel .pc-row { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--rm-line); }
.pcost-panel .pc-row:last-child { border-bottom: 0; }
.pcost-panel .pc-k { display: flex; align-items: center; gap: .5rem; font-weight: 600; min-width: 0; }
.pcost-panel .pc-k i { color: var(--pc, #c98a00); }
.pcost-panel .pc-nums { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .86rem; }
.pcost-panel .pc-nums span { white-space: nowrap; }
.table-stack td > .tc { min-width: 0; }
@media (max-width: 767.98px) { .table-stack td > .tc { text-align: right; } }
.sms-status ul li { overflow-wrap: anywhere; }
.sms-help ol li + li { margin-top: .2rem; }
/* purchase: where to store each line (godown + place) */
.li-place-row { display: flex; gap: .25rem; margin-top: .25rem; }
.li-place-row .li-zone { flex: 1 1 auto; min-width: 0 !important; }
.li-place-row .li-wh-map { flex: 0 0 auto; white-space: nowrap; }
.li-place-info { margin-top: .2rem; line-height: 1.3; overflow-wrap: anywhere; }
.li-place-info:empty { display: none; }
.pm-find { max-width: 280px; }
.pm-grid { display: grid; gap: .85rem; }
.pm-wh { border: 1px solid var(--rm-line); border-radius: 12px; padding: .6rem; background: var(--rm-surface); }
.pm-wh.on { border-color: var(--rm-primary); box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--rm-primary) 18%, transparent); }
.pm-wh-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; width: 100%; border: 0; background: transparent; text-align: left; padding: .2rem .25rem .4rem; border-radius: 8px; color: inherit; }
.pm-wh-h:hover { background: var(--rm-primary-050); }
.pm-bar { display: block; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--rm-line) 70%, transparent); overflow: hidden; margin: .25rem 0; }
.pm-bar.big { height: 6px; margin: 0 .25rem .5rem; }
.pm-bar > span { display: block; height: 100%; background: var(--zc, var(--rm-primary)); border-radius: 3px; }
.pm-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.pm-zone { display: flex; flex-direction: column; gap: .1rem; text-align: left; border: 1px solid var(--rm-line); border-left: 4px solid var(--zc, #2a78d6); border-radius: 10px; padding: .45rem .55rem; background: var(--rm-bg); color: inherit; min-width: 0; }
.pm-zone:hover { border-color: var(--zc, #2a78d6); background: color-mix(in srgb, var(--zc, #2a78d6) 8%, var(--rm-surface)); }
.pm-zone.on { outline: 2px solid var(--zc, #2a78d6); }
.pm-zone.has { box-shadow: inset 0 0 0 1px color-mix(in srgb, #2e9e5b 60%, transparent); }
.pm-zh { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-width: 0; }
.pm-zh .zone-code { font-size: .68rem; font-weight: 700; padding: .05rem .35rem; border-radius: 5px; background: color-mix(in srgb, var(--zc, #2a78d6) 18%, transparent); color: var(--zc, #2a78d6); }
.pm-items { display: flex; flex-direction: column; gap: .05rem; font-size: .78rem; margin-top: .15rem; min-width: 0; }
.pm-items > span { overflow-wrap: anywhere; }
.pm-items > span.me { color: #2e9e5b; font-weight: 600; }
@media (max-width: 575.98px) { .pm-zones { grid-template-columns: 1fr; } .pm-find { max-width: none; order: 3; } }
.enter-hint kbd { font-size: .7rem; padding: .05rem .3rem; background: var(--rm-bg); color: var(--rm-ink); border: 1px solid var(--rm-line); }
.sms-countries > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.sms-countries > summary::-webkit-details-marker { display: none; }
/* yearly bill report */
.br-table .br-peak td { background: rgba(237, 161, 0, .07); }
@media (max-width: 575.98px) { .br-table td, .br-table th { padding-left: .4rem; padding-right: .4rem; } .br-table .badge { font-size: .62rem; } }
/* instant list search: a thin progress line while the list refreshes */
.filter-bar { position: relative; }
.filter-bar.is-searching::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--bs-primary, #1a7f5a), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: rm-live 0.9s linear infinite; border-radius: 0 0 6px 6px; }
@keyframes rm-live { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* =========================================================
   Quick add customer / supplier — animated popup
   ========================================================= */
.pq-modal { --pq-a: var(--rm-primary); --pq-b: #2f9a68; --pq-glow: rgba(29, 107, 71, .35); --pq-tint: var(--rm-primary-050); }
.pq-modal.pq-supplier { --pq-a: #a86a00; --pq-b: #d9a21b; --pq-glow: rgba(201, 138, 0, .35); --pq-tint: var(--rm-accent-050); }
.pq-modal .modal-dialog { max-width: 560px; }
.pq-modal.fade .modal-dialog { transform: translateY(34px) scale(.92); opacity: 0; transition: transform .5s cubic-bezier(.18, 1.25, .4, 1), opacity .28s ease; }
.pq-modal.show .modal-dialog { transform: none; opacity: 1; }
body:has(.pq-modal.show) .modal-backdrop.show { opacity: .42; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.pq-card { overflow: hidden; border-radius: 20px !important; box-shadow: 0 28px 70px -18px rgba(10, 30, 20, .45), 0 0 0 1px rgba(0, 0, 0, .04); background: var(--rm-surface); }
.pq-head { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 22px 22px 20px; color: #fff; isolation: isolate;
  background: linear-gradient(135deg, var(--pq-a), var(--pq-b)); }
.pq-head::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .12); z-index: -1; animation: pq-float 7s ease-in-out infinite; }
.pq-head::before { content: ""; position: absolute; inset: -50px auto auto 30%; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .08); z-index: -1; animation: pq-float 9s ease-in-out infinite reverse; }
.pq-grain { position: absolute; inset: 0; z-index: -1; opacity: .18; background-image: radial-gradient(rgba(255, 255, 255, .9) 1px, transparent 1.4px); background-size: 14px 14px; mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
@keyframes pq-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, 10px); } }
.pq-avatar { position: relative; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 1.55rem; font-weight: 700; letter-spacing: .5px;
  background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), background .3s, border-radius .35s; }
.pq-avatar > * { grid-area: 1 / 1; transition: opacity .2s, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.pq-avatar .pq-ini { opacity: 0; transform: scale(.5); }
.pq-avatar.has-ini .pq-ini { opacity: 1; transform: none; }
.pq-avatar.has-ini .pq-ic { opacity: 0; transform: scale(.5) rotate(-20deg); }
.pq-avatar .pq-ok { opacity: 0; transform: scale(.3); font-size: 1.9rem; }
.pq-modal.show .pq-avatar { animation: pq-pop .6s .12s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes pq-pop { from { transform: scale(.4) rotate(-12deg); } to { transform: none; } }
.pq-titles { min-width: 0; flex: 1; }
.pq-title { margin: 0; font-size: 1.22rem; font-weight: 700; color: #fff; }
.pq-sub { font-size: .82rem; opacity: .88; line-height: 1.35; margin-top: 2px; }
.pq-x { align-self: flex-start; border: 0; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .16); display: grid; place-items: center; transition: background .2s, transform .3s; }
.pq-x:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }
.pq-body { padding: 18px 22px 6px; }
.pq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pq-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--rm-line); font-size: .85rem; font-weight: 500; cursor: pointer; user-select: none;
  color: var(--rm-ink-2); background: var(--rm-surface); transition: all .22s cubic-bezier(.2, 1.3, .4, 1); }
.pq-chip:hover { border-color: var(--pq-a); color: var(--pq-a); transform: translateY(-1px); }
.btn-check:checked + .pq-chip { background: var(--pq-a); border-color: var(--pq-a); color: #fff; box-shadow: 0 6px 16px -6px var(--pq-glow); transform: translateY(-1px); }
.btn-check:focus-visible + .pq-chip { outline: 2px solid var(--pq-a); outline-offset: 2px; }
.pq-f .form-label { font-size: .78rem; font-weight: 600; color: var(--rm-ink-2); margin-bottom: 4px; }
.pq-input { position: relative; }
.pq-input > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--rm-ink-2); opacity: .7; pointer-events: none; transition: color .2s, opacity .2s; }
.pq-input .form-control { padding-inline-start: 36px; height: 44px; border-radius: 12px; border-width: 1.5px; background: var(--bs-tertiary-bg, #f8f9f6); transition: border-color .2s, box-shadow .2s, background .2s; }
.pq-input .form-control:focus { background: var(--rm-surface); border-color: var(--pq-a); box-shadow: 0 0 0 4px var(--pq-glow); }
.pq-input:focus-within > i { color: var(--pq-a); opacity: 1; }
.pq-f:first-child .form-control { height: 50px; font-size: 1.08rem; font-weight: 600; }
.pq-modal.show .pq-body .row > * { animation: pq-in .45s cubic-bezier(.2, 1.1, .4, 1) both; }
.pq-modal.show .pq-body .row > *:nth-child(1) { animation-delay: .08s; }
.pq-modal.show .pq-body .row > *:nth-child(2) { animation-delay: .12s; }
.pq-modal.show .pq-body .row > *:nth-child(3) { animation-delay: .16s; }
.pq-modal.show .pq-body .row > *:nth-child(5) { animation-delay: .2s; }
.pq-modal.show .pq-body .row > *:nth-child(n+6) { animation-delay: .24s; }
.pq-modal.show .pq-chips { animation: pq-in .45s .04s cubic-bezier(.2, 1.1, .4, 1) both; }
@keyframes pq-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pq-more { border: 0; background: none; padding: 0; font-size: .85rem; font-weight: 600; color: var(--pq-a); }
.pq-more i { display: inline-block; transition: transform .25s; }
.pq-more[aria-expanded="true"] i { transform: rotate(180deg); }
.pq-extra:not([hidden]) { animation: pq-in .3s ease both; }
.pq-dup { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 12px; border-radius: 12px; background: #fff6dc; color: #7a5200; font-size: .85rem; animation: pq-in .3s ease both; }
[data-bs-theme="dark"] .pq-dup { background: #3a2e10; color: #f1cf7a; }
.pq-dup .pq-dup-t { flex: 1; min-width: 160px; }
.pq-err { margin-top: 12px; padding: 9px 12px; border-radius: 12px; background: rgba(208, 59, 59, .1); color: #c03434; font-size: .88rem; font-weight: 500; }
.pq-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
.pq-hint { margin-inline-end: auto; font-size: .75rem; color: var(--rm-ink-2); }
.pq-hint kbd { font-size: .68rem; padding: 1px 5px; background: var(--rm-line); color: var(--rm-ink); border-radius: 4px; }
.pq-save { min-width: 150px; height: 44px; border-radius: 12px; font-weight: 600; border: 0; background: linear-gradient(135deg, var(--pq-a), var(--pq-b)); box-shadow: 0 10px 22px -10px var(--pq-glow); transition: transform .2s, box-shadow .2s, filter .2s; }
.pq-save:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -10px var(--pq-glow); filter: brightness(1.05); }
.pq-save:active { transform: translateY(1px) scale(.98); }
.pq-foot .btn-light { height: 44px; border-radius: 12px; }
.pq-busy .pq-save i { display: none; }
/* shake on a mistake */
.pq-shake .pq-card { animation: pq-shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes pq-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
/* saved: the avatar turns into a tick with rings */
.pq-done .pq-avatar { background: #fff; color: var(--pq-a); border-radius: 50%; transform: scale(1.08); }
.pq-done .pq-avatar .pq-ini, .pq-done .pq-avatar .pq-ic { opacity: 0 !important; transform: scale(.4); }
.pq-done .pq-avatar .pq-ok { opacity: 1; transform: none; }
.pq-done .pq-avatar::before, .pq-done .pq-avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff; animation: pq-ring .8s ease-out forwards; }
.pq-done .pq-avatar::after { animation-delay: .18s; }
@keyframes pq-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
.pq-done .pq-body, .pq-done .pq-foot { opacity: .45; pointer-events: none; transition: opacity .3s; }
/* the party list on the form flashes when the new party is chosen */
.pq-flash .ss-toggle, select.pq-flash { animation: pq-flash 1.4s ease; }
@keyframes pq-flash { 0% { box-shadow: 0 0 0 0 var(--pq-glow, rgba(29, 107, 71, .45)); border-color: var(--rm-primary); } 40% { box-shadow: 0 0 0 6px rgba(29, 107, 71, .18); border-color: var(--rm-primary); } 100% { box-shadow: 0 0 0 0 transparent; } }
.pq-open { transition: transform .2s; }
.pq-open:hover i { display: inline-block; animation: pq-wiggle .5s ease; }
@keyframes pq-wiggle { 30% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(8deg) scale(1.1); } }
/* phones: a bottom sheet */
@media (max-width: 575.98px) {
  .pq-modal .modal-dialog { margin: 0; min-height: 100%; display: flex; align-items: flex-end; max-width: none; }
  .pq-modal.fade .modal-dialog { transform: translateY(100%); transition: transform .45s cubic-bezier(.2, 1, .3, 1), opacity .2s; }
  .pq-modal.show .modal-dialog { transform: none; }
  .pq-card { width: 100%; border-radius: 22px 22px 0 0 !important; max-height: 94vh; display: flex; flex-direction: column; }
  .pq-body { overflow-y: auto; padding: 16px 16px 4px; }
  .pq-head { padding: 22px 16px 16px; }
  .pq-head .pq-grain::before { content: ""; position: absolute; top: 8px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: rgba(255, 255, 255, .5); }
  .pq-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .pq-foot .btn { flex: 1; }
  .pq-avatar { width: 50px; height: 50px; font-size: 1.3rem; border-radius: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .pq-modal *, .pq-modal .modal-dialog { animation: none !important; transition: none !important; }
}
/* purchase line: bags given by the supplier, quantity that came short */
.li-bagsrc { margin-top: 4px; }
.li-bagsup-l { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; cursor: pointer; color: var(--rm-ink-2); user-select: none; }
.li-bagsup-l .form-check-input { margin: 0; }
.li-bagsup-l:has(:checked) { color: var(--rm-primary); font-weight: 600; }
.li-bagprice { margin-top: 4px; }
.li-bagprice .input-group-text, .li-short .input-group-text { font-size: .72rem; padding: 0 .45rem; }
.li-bagamt { color: var(--rm-primary); font-weight: 600; margin-top: 2px; }
.li-short-btn { font-size: .76rem; text-decoration: none; color: var(--rm-ink-2); margin-top: 2px; }
.li-short-btn.on, .li-short-btn:hover { color: #c03434; }
.li-short { margin-top: 4px; padding: 6px; border-radius: 8px; background: rgba(208, 59, 59, .06); border: 1px dashed rgba(208, 59, 59, .35); }
.li-shortamt { margin-top: 3px; font-weight: 600; }
.li-amtnote { margin-top: 2px; line-height: 1.25; }
.inv-short { border-left: 3px solid #c98a00; }
.table td .inv-note { white-space: normal; line-height: 1.3; }
/* New Purchase: numbered steps, "Store in godown" bar, where each line is stored, bottom bar with total and Save */
.pf-head { gap: .5rem; }
.pf-head-plain { display: flex; align-items: center; flex-wrap: wrap; font-weight: 600; padding: 0 .15rem; }
.pf-step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--rm-primary); color: #fff; font-size: .8rem; font-weight: 800; flex: 0 0 auto; }
[data-bs-theme="dark"] .pf-step { color: #0b1a12; }
.pf-store { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; margin: .75rem .75rem .25rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--rm-primary) 30%, var(--rm-line)); background: color-mix(in srgb, var(--rm-primary) 6%, var(--rm-surface)); }
.pf-store-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--rm-primary); color: #fff; font-size: 1.15rem; flex: 0 0 auto; }
[data-bs-theme="dark"] .pf-store-ic { color: #0b1a12; }
.pf-store-t { flex: 1 1 220px; min-width: 0; line-height: 1.3; }
.pf-store-l { font-weight: 700; margin: 0; color: var(--rm-primary); }
.pf-store-f { display: flex; gap: .5rem; flex-wrap: wrap; flex: 2 1 460px; min-width: 0; }
.pf-store-f #putAll { flex: 2 1 240px; min-width: 0; font-weight: 600; }
.pf-store-f #putAllZone { flex: 1 1 170px; min-width: 0; }
.pf-store-f .btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 575.98px) { .pf-store { margin: .5rem; } .pf-store-ic { display: none; } .pf-store-f .btn { flex: 1 1 100%; min-width: 0; white-space: normal; } }
.li-dest { margin-top: .3rem; display: inline-flex; align-items: flex-start; gap: .35rem; max-width: 100%; padding: .2rem .55rem; border-radius: 8px; font-size: .76rem; font-weight: 600; line-height: 1.3; color: var(--rm-primary); background: var(--rm-primary-050); overflow-wrap: anywhere; }
.li-dest i { margin-top: .05rem; }
.line-items .li-wh.is-invalid { border-color: #d03b3b; }
.li-short-t { font-size: .72rem; color: #a33; margin-bottom: 4px; line-height: 1.25; }
[data-bs-theme="dark"] .li-short-t { color: #f0a0a0; }
.li-short-btn { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .45rem !important; border: 1px dashed var(--rm-line); border-radius: 999px; margin-top: 4px; }
.li-short-btn.on { border-color: rgba(208, 59, 59, .45); background: rgba(208, 59, 59, .06); }
.pf-recv { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: flex-end; }
.pf-recv:empty { display: none; }
.pf-chip { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--rm-primary-050); color: var(--rm-primary); font-weight: 600; }
.pf-bar { position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .6rem .85rem; border: 1px solid var(--rm-line); border-radius: 14px 14px 0 0; background: color-mix(in srgb, var(--rm-surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); }
.pf-bar-sum { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; align-items: baseline; min-width: 0; }
.pf-k { display: inline-flex; flex-direction: column; line-height: 1.15; }
.pf-k > span { font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rm-ink-2); font-weight: 600; }
.pf-k strong { font-variant-numeric: tabular-nums; }
.pf-k-total strong { font-size: 1.2rem; color: var(--rm-primary); }
.pf-bar.has-due .pf-k-due strong { color: #c03434; }
.pf-bar-act { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; margin-left: auto; }
@media (max-width: 575.98px) {
  .pf-bar { margin-left: -.5rem; margin-right: -.5rem; padding: .5rem .65rem; }
  .pf-bar-sum { gap: .25rem .9rem; width: 100%; }
  .pf-bar-act { width: 100%; }
  .pf-bar-act .btn-lg { flex: 1 1 auto; }
  .line-items.li-cards td.col-qty { grid-column: 1 / -1; }
}

/* ---------- v1.20 New Purchase: easy entry (step tracker, supplier snapshot, quick add, last rate, pay buttons) */
.pe-track { position: sticky; top: 62px; z-index: 7; display: flex; gap: .4rem; margin: 0 0 .9rem; padding: .4rem; border: 1px solid var(--rm-line); border-radius: 14px; background: color-mix(in srgb, var(--rm-surface) 90%, transparent); backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0, 0, 0, .05); overflow-x: auto; scrollbar-width: none; }
.pe-track::-webkit-scrollbar { display: none; }
.pe-st { flex: 1 1 0; min-width: 150px; display: flex; align-items: center; gap: .55rem; padding: .4rem .6rem; border-radius: 10px; color: var(--rm-ink); text-decoration: none; position: relative; transition: background .15s; }
.pe-st:hover { background: var(--rm-primary-050); color: var(--rm-ink); }
.pe-st.cur { background: var(--rm-primary-050); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rm-primary) 35%, transparent); }
.pe-n { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--rm-bg); color: var(--rm-ink-2); border: 2px solid var(--rm-line); transition: all .2s; }
.pe-n i { display: none; font-size: 1rem; }
.pe-st.done .pe-n { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }
.pe-st.done .pe-n span { display: none; } .pe-st.done .pe-n i { display: inline; }
.pe-st.warn .pe-n { border-color: var(--rm-accent); color: var(--rm-accent); background: var(--rm-accent-050); }
.pe-st.opt .pe-n { border-style: dashed; }
[data-bs-theme="dark"] .pe-st.done .pe-n { color: #0b1a12; }
.pe-tx { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pe-tx b { font-size: .86rem; }
.pe-tx small { color: var(--rm-ink-2); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; font-variant-numeric: tabular-nums; }
.pe-st.done .pe-tx small { color: var(--rm-primary); font-weight: 600; }
.pe-st.warn .pe-tx small { color: var(--rm-accent); font-weight: 600; }
@media (max-width: 767.98px) { .pe-track { top: 61px; margin-inline: -.25rem; } .pe-st { min-width: 128px; padding: .3rem .45rem; } .pe-n { width: 1.7rem; height: 1.7rem; } .pe-tx small { max-width: 14ch; } }

.pe-sup { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .75rem .9rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rm-primary) 25%, var(--rm-line)); background: linear-gradient(135deg, color-mix(in srgb, var(--rm-primary) 9%, var(--rm-surface)), var(--rm-surface) 70%); animation: peIn .25s ease-out; }
.pe-sup-av { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, var(--rm-primary), color-mix(in srgb, var(--rm-primary) 55%, var(--rm-accent))); flex: 0 0 auto; }
[data-bs-theme="dark"] .pe-sup-av { color: #0b1a12; }
.pe-sup-main { flex: 1 1 200px; min-width: 0; }
.pe-sup-name { font-weight: 700; font-size: 1rem; }
.pe-sup-facts { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font-size: .84rem; color: var(--rm-ink-2); margin-top: .15rem; }
.pe-sup-facts b { color: var(--rm-ink); font-variant-numeric: tabular-nums; }
.pe-sup-facts b.text-danger { color: #c03434 !important; } .pe-sup-facts b.text-success { color: var(--rm-primary) !important; }
.pe-sup-act { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: 0 1 auto; max-width: 100%; }
.pe-sup-act .small { max-width: 300px; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) { .pe-sup-act { align-items: stretch; width: 100%; } .pe-sup-act .small { text-align: start; } }
@keyframes peIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.pe-more { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.pe-tog { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--rm-primary) 45%, var(--rm-line)); background: var(--rm-surface); color: var(--rm-ink); font-size: .86rem; font-weight: 600; transition: all .15s; }
.pe-tog:hover { background: var(--rm-primary-050); }
.pe-tog.on { border-style: solid; background: var(--rm-primary-050); color: var(--rm-primary); }
.pe-tog-i { font-size: .8rem; transition: transform .2s; } .pe-tog.on .pe-tog-i { transform: rotate(45deg); }

.pe-quick { margin: .5rem .75rem .25rem; padding: .65rem .8rem; border-radius: 12px; border: 1px solid var(--rm-line); background: color-mix(in srgb, var(--rm-accent) 5%, var(--rm-surface)); }
.pe-quick-h { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin-bottom: .5rem; }
.pe-quick-l { font-weight: 700; color: var(--rm-accent); display: inline-flex; gap: .3rem; align-items: center; }
.pe-quick-s { flex: 1 1 220px; }
.pe-unit { display: inline-flex; align-items: center; gap: .15rem; padding: .15rem; border-radius: 10px; background: var(--rm-bg); border: 1px solid var(--rm-line); margin-inline-start: auto; }
.pe-unit > span { padding: 0 .45rem; }
.pe-unit button { border: 0; background: transparent; padding: .25rem .8rem; border-radius: 8px; font-weight: 700; font-size: .85rem; color: var(--rm-ink-2); }
.pe-unit button.on { background: var(--rm-primary); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
[data-bs-theme="dark"] .pe-unit button.on { color: #0b1a12; }
.pe-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pe-chips + .pe-chips { margin-top: .45rem; }
.pe-chips-l { font-size: .76rem; font-weight: 700; color: var(--rm-ink-2); text-transform: uppercase; letter-spacing: .03em; margin-inline-end: .2rem; }
.pe-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border-radius: 10px; border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink); font-size: .88rem; font-weight: 600; line-height: 1.2; transition: transform .12s, box-shadow .12s, border-color .12s; }
.pe-chip i { color: var(--rm-accent); }
.pe-chip:hover { transform: translateY(-1px); border-color: var(--rm-primary); box-shadow: 0 4px 10px rgba(0, 0, 0, .07); }
.pe-chip:active { transform: translateY(0); }
.pe-chip-sup { border-color: color-mix(in srgb, var(--rm-primary) 35%, var(--rm-line)); background: var(--rm-primary-050); }
.pe-chip-sup small { color: var(--rm-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.pe-chip-any { border-style: dashed; color: var(--rm-ink-2); }
.pe-chip-any i { color: var(--rm-ink-2); }
@media (max-width: 575.98px) { .pe-quick { margin: .5rem; } .pe-unit { margin-inline-start: 0; } .pe-quick-s { display: none; } }

.pe-last { display: inline-flex; align-items: center; gap: .25rem; margin-top: .25rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rm-primary) 30%, var(--rm-line)); background: var(--rm-primary-050); color: var(--rm-ink-2); font-size: .72rem; line-height: 1.4; max-width: 100%; white-space: nowrap; overflow: hidden; }
.pe-last b { color: var(--rm-ink); font-variant-numeric: tabular-nums; }
.pe-last .pe-use { color: var(--rm-primary); font-weight: 700; text-decoration: underline; }
.pe-last.same { opacity: .7; }

.pe-pay { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; padding: .1rem 0 .35rem; }
.pe-pay button { border: 1px solid var(--rm-line); background: var(--rm-surface); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; font-weight: 600; color: var(--rm-ink-2); }
.pe-pay button:hover { border-color: var(--rm-primary); color: var(--rm-primary); }
.pe-pay button.on { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }
[data-bs-theme="dark"] .pe-pay button.on { color: #0b1a12; }
.totals-box .pe-after { border-top: 1px dashed var(--rm-line); margin-top: .35rem; padding-top: .55rem; font-size: .9rem; }
.totals-box .pe-after > span { color: var(--rm-ink-2); }

.pe-msg { flex: 1 1 100%; order: -1; padding: .45rem .7rem; border-radius: 10px; background: #fdecec; color: #a12626; font-weight: 600; font-size: .88rem; }
[data-bs-theme="dark"] .pe-msg { background: rgba(220, 60, 60, .15); color: #ff9a9a; }
.pe-keys kbd { font-size: .68rem; padding: .05rem .3rem; }
.pe-bad { animation: peShake .35s; }
@keyframes peShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .pe-sup, .pe-bad { animation: none; } .pe-chip, .pe-n { transition: none; } }
@media print { .pe-track, .pe-quick, .pe-more, .pe-pay { display: none !important; } }

/* ---------- v1.21 SL numbers in lists, Re-number Documents */
th.sl-no, td.sl-no { width: 1%; white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; }
td.sl-no { color: var(--rm-ink-2); font-weight: 700; font-size: .85rem; }
.rn-intro { display: flex; gap: .9rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--rm-radius); border: 1px solid color-mix(in srgb, var(--rm-primary) 25%, var(--rm-line)); background: color-mix(in srgb, var(--rm-primary) 6%, var(--rm-surface)); }
.rn-intro-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--rm-primary); color: #fff; }
[data-bs-theme="dark"] .rn-intro-ic { color: #0b1a12; }
tr.rn-need > td { background: color-mix(in srgb, var(--rm-accent) 7%, transparent); }
.rn-go { border-color: color-mix(in srgb, var(--rm-accent) 45%, var(--rm-line)); background: var(--rm-accent-050); }
td.sl-no + td { white-space: nowrap; }

/* ---------- v1.22 SL everywhere */
.sl-chip { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.25rem; padding: 0 .3rem; margin-inline-end: .25rem; border-radius: 6px; background: var(--rm-bg); color: var(--rm-ink-2); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: .1em; }
@media (max-width: 1199.98px) { .due-table .sl-no { display: none; } }
@media (max-width: 767.98px) { .table-stack td.sl-no:empty { display: none; } }

/* ===================== v1.24: print language, text size, Invoice Register ===================== */
/* text that follows the screen: headings, card titles, big numbers and buttons grow and shrink with the width
   (all in rem, so the admin / user text size scales them too) */
h1, .h1 { font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); }
h2, .h2 { font-size: clamp(1.2rem, 1rem + .8vw, 1.7rem); }
h3, .h3 { font-size: clamp(1.1rem, .95rem + .6vw, 1.45rem); }
h4, .h4 { font-size: clamp(1rem, .9rem + .45vw, 1.25rem); }
h5, .h5 { font-size: clamp(.95rem, .88rem + .3vw, 1.1rem); }
.card-header { font-size: clamp(.86rem, .8rem + .25vw, 1rem); }
.totals-box .grand { font-size: clamp(1.05rem, .95rem + .45vw, 1.35rem); }
.dropdown-menu { font-size: clamp(.84rem, .8rem + .15vw, .94rem); }
.badge { font-size: .75em; }
@media (max-width: 575.98px) { .display-6 { font-size: 1.6rem; } .fs-4 { font-size: 1.15rem !important; } .fs-5 { font-size: 1.05rem !important; } }

/* print language in the language menu */
.plang-box { padding: .55rem .75rem .6rem; border-bottom: 1px solid var(--rm-line); margin-bottom: .25rem; }
.plang-t { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); margin-bottom: .35rem; }
.plang-sw { display: flex; border: 1px solid var(--rm-line); border-radius: 9px; overflow: hidden; }
.plang-sw a { flex: 1; text-align: center; padding: .35rem .5rem; text-decoration: none; color: var(--rm-ink); font-weight: 600; font-size: .85rem; }
.plang-sw a + a { border-inline-start: 1px solid var(--rm-line); }
.plang-sw a.on { background: var(--rm-primary); color: #fff; }
.plang-h { font-size: .7rem; color: var(--rm-ink-2); margin-top: .3rem; }

/* Invoice Register */
.ir-periods { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .15rem; scrollbar-width: thin; }
.ir-periods .btn { white-space: nowrap; flex: 0 0 auto; }
.ir-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .75rem; }
.ir-hero-main { display: flex; gap: 1rem; align-items: center; padding: clamp(.9rem, .7rem + .8vw, 1.4rem); border-radius: var(--rm-radius); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2f8f62 0%, var(--rm-primary) 45%, #0e3d27 100%); box-shadow: 0 10px 28px -16px rgba(14, 61, 39, .7); }
.ir-hero-ic { width: clamp(46px, 40px + 2vw, 64px); height: clamp(46px, 40px + 2vw, 64px); flex: 0 0 auto; border-radius: 16px; display: grid; place-items: center; font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem); background: rgba(255,255,255,.14); }
.ir-hero-l { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; opacity: .85; font-weight: 600; }
.ir-hero-v { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3.1rem); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ir-hero-s { font-size: .82rem; opacity: .9; margin-top: .2rem; }
.ir-users { background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: .7rem .85rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.ir-users-t { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); }
.ir-user { position: relative; display: flex; justify-content: space-between; gap: .5rem; padding: .22rem .45rem; border-radius: 7px; text-decoration: none; color: var(--rm-ink); font-size: .86rem; overflow: hidden; }
.ir-user i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--rm-primary-050); z-index: 0; border-radius: 7px; }
.ir-user span, .ir-user b { position: relative; z-index: 1; min-width: 0; }
.ir-user:hover { background: var(--rm-primary-050); }
.ir-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .55rem; }
.ir-cat { --c: var(--rm-primary); display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic v" "l l" "s s"; gap: .15rem .55rem; align-items: center; padding: .7rem .8rem;
  background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); text-decoration: none; color: var(--rm-ink); position: relative; transition: transform .12s, box-shadow .12s, border-color .12s; }
.ir-cat::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 10px; width: 3px; border-radius: 3px; background: var(--c); }
.ir-cat:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--c) 40%, var(--rm-line)); }
.ir-cat.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); background: color-mix(in srgb, var(--c) 7%, var(--rm-surface)); }
.ir-cat.zero { opacity: .62; }
.ir-cat-ic { grid-area: ic; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); font-size: 1.05rem; }
.ir-cat-v { grid-area: v; text-align: end; font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.ir-cat-l { grid-area: l; font-size: .8rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.ir-cat-s { grid-area: s; font-size: .72rem; color: var(--rm-ink-2); }
.ir-chip { --c: var(--rm-primary); display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
[data-bs-theme="dark"] .ir-chip, [data-bs-theme="dark"] .ir-cat-ic { color: color-mix(in srgb, var(--c) 55%, #fff); }
.ir-acts { display: inline-flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.ir-bulk { position: sticky; bottom: .75rem; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .75rem auto 0; width: fit-content; max-width: 100%;
  padding: .55rem .8rem; border-radius: 14px; background: #13261c; color: #fff; box-shadow: 0 14px 30px -14px rgba(0,0,0,.6); }
.ir-bulk[hidden] { display: none; }
@media (max-width: 991.98px) { .ir-hero { grid-template-columns: 1fr; } }
@media (max-width: 767.98px) {
  .ir-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ir-table td.no-print:first-child { display: block; }
  .ir-acts { justify-content: flex-start; }
}
@media print { .ir-filter, .ir-cats, .ir-bulk, .ir-users { display: none !important; } .ir-hero-main { color: #000; background: none; box-shadow: none; border: 1px solid #ccc; } }

/* dashboard widget */
.ir-w-grid { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.ir-w-total { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; padding: .8rem 1rem; border-radius: 12px; text-decoration: none; color: #fff;
  background: linear-gradient(140deg, #2f8f62, var(--rm-primary) 55%, #0e3d27); }
.ir-w-v { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ir-w-l { font-size: .8rem; opacity: .9; font-weight: 600; }
.ir-w-s { font-size: .76rem; opacity: .85; margin-top: .25rem; }
.ir-w-item { --c: var(--rm-primary); display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic n" "t t" "p p"; gap: .1rem .45rem; align-items: center; padding: .55rem .65rem;
  border: 1px solid var(--rm-line); border-radius: 11px; text-decoration: none; color: var(--rm-ink); background: var(--rm-surface); }
.ir-w-item:hover { border-color: var(--c); }
.ir-w-item.zero { opacity: .55; }
.ir-w-ic { grid-area: ic; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); font-size: .9rem; }
.ir-w-n { grid-area: n; text-align: end; font-weight: 800; font-size: clamp(1rem, .92rem + .4vw, 1.25rem); font-variant-numeric: tabular-nums; }
.ir-w-t { grid-area: t; font-size: .74rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ir-w-p { grid-area: p; font-size: .7rem; color: var(--rm-ink-2); }
@media (max-width: 575.98px) { .ir-w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ir-w-total { grid-row: auto; grid-column: 1 / -1; } }
.ir-table { font-size: .88rem; }
.ir-table td[data-label="Party"] { min-width: 9rem; }
.ir-table .ir-acts .btn { padding: .2rem .45rem; }
/* the top bar keeps its size on phones whatever text size is chosen, so its buttons always fit */
@media (max-width: 575.98px) {
  .topbar { font-size: 14px; }
  .topbar .btn-sm { font-size: 13px; padding: 5px 9px; }
  .topbar .btn-icon { width: 34px; height: 34px; }
  .topbar .btn-icon i { font-size: 17px; }
  .topbar > .ms-auto { gap: 4px !important; min-width: 0; }
  .topbar .lang-btn span { font-size: 12px; }
}
/* v1.24.1 Invoice Register: print a whole category from its card */
.ir-cat-w { position: relative; display: grid; }
.ir-cat-print { --c: var(--rm-primary); position: absolute; inset-block-end: .45rem; inset-inline-end: .45rem; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; background: var(--c); text-decoration: none; font-size: .85rem; box-shadow: 0 4px 10px -6px rgba(0,0,0,.5); transition: transform .12s; }
.ir-cat-print:hover { color: #fff; transform: scale(1.08); }
.ir-bulk-cats { font-size: .78rem; opacity: .8; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- v1.26: length of service, HR approvals */
.svc-wrap { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.svc-main { flex: 1 1 260px; min-width: 0; }
.svc-k { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); font-weight: 600; margin-bottom: .35rem; }
.svc-nums { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .25rem; }
.svc-nums > div { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-radius: .6rem; padding: .35rem .7rem; min-width: 4.4rem; text-align: center; }
.svc-left .svc-nums > div { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.svc-nums b { display: block; font-size: 1.6rem; line-height: 1.1; }
.svc-nums span { font-size: .78rem; }
.svc-dates { flex: 1 1 200px; display: grid; gap: .3rem; font-size: .9rem; min-width: 0; }
.svc-dates .k { color: var(--bs-secondary-color); margin-inline-end: .35rem; }
.svc-dates .v { font-weight: 600; overflow-wrap: anywhere; }
.svc-act { flex: 0 0 auto; }
.hr-chg li { overflow-wrap: anywhere; }
.hr-chg li + li { margin-top: .15rem; }
.hr-pend .hr-chg { font-size: .9rem; }
@media (max-width: 575.98px) {
  .svc-act, .svc-act .btn { width: 100%; }
  .svc-nums > div { flex: 1 1 0; min-width: 0; padding: .3rem .4rem; }
  .svc-nums b { font-size: 1.35rem; }
}
@media (max-width: 767.98px) {
  .table-stack td.hr-chg-td { flex-direction: column; align-items: stretch; gap: .25rem; }
  .table-stack td.hr-chg-td > .tc { text-align: start !important; }
}
[dir="rtl"] .hr-arrow { display: inline-block; transform: scaleX(-1); }
/* v1.26.1: the overtime rate box lights up when the department fills it */
@keyframes otFilled { 0% { background-color: var(--bs-success-bg-subtle); box-shadow: 0 0 0 .2rem rgba(25,135,84,.25); } 100% { background-color: var(--bs-body-bg); box-shadow: none; } }
.ot-filled { animation: otFilled 1.2s ease-out; }

/* ---------- v1.27: paddy & rice stock tile, rice stock & bag prices */
.kpi-grain { grid-column: 1 / -1; }
@media (min-width: 576px) { .kpi-grain { grid-column: span 2; } }
.grain-split { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.g-half { border-radius: 10px; padding: .45rem .6rem; min-width: 0; }
.g-paddy { background: color-mix(in srgb, #eda100 12%, transparent); }
.g-rice { background: color-mix(in srgb, #1baf7a 12%, transparent); }
.g-k { font-size: .74rem; font-weight: 700; color: var(--rm-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-paddy .g-k i { color: #b07a00; } .g-rice .g-k i { color: #128a5f; }
.g-kg { font-size: clamp(.95rem, .8rem + 1vw, 1.3rem); font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.g-mon { font-size: .82rem; font-weight: 600; color: var(--rm-ink-2); font-variant-numeric: tabular-nums; }
.kpi-grain .kpi-sub strong { color: var(--rm-ink); }
.rice-sum { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.rs-card { border: 1px solid var(--rm-line); border-radius: 14px; padding: .8rem 1rem; background: var(--rm-surface); min-width: 0; }
.rs-paddy { border-inline-start: 4px solid #eda100; } .rs-rice { border-inline-start: 4px solid #1baf7a; } .rs-value { border-inline-start: 4px solid #2a78d6; }
.rs-k { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); }
.rs-v { font-size: clamp(1.1rem, .9rem + 1vw, 1.55rem); font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rs-s { font-size: .82rem; color: var(--rm-ink-2); }
.rice-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.rice-title { min-width: 0; overflow-wrap: anywhere; }
.rice-title i { color: #1baf7a; }
.rice-tot { margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; font-variant-numeric: tabular-nums; }
.rice-val { font-weight: 800; font-size: 1.05rem; color: var(--bs-primary-text-emphasis); }
.rice-prices { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.rp-l { font-size: .8rem; font-weight: 700; color: var(--rm-ink-2); }
.rp-chip { display: inline-flex; align-items: baseline; gap: .3rem; border: 1px solid var(--rm-line); border-radius: 999px; padding: .15rem .6rem; font-size: .82rem; background: var(--rm-surface); white-space: nowrap; }
.rp-chip small { color: var(--rm-ink-2); }
.rp-kg { background: var(--bs-secondary-bg); }
.rice-tbl .rt-first td { border-top: 1px solid var(--rm-line); }
.rice-tbl .rt-sub td { background: var(--bs-tertiary-bg); font-weight: 600; }
.rice-card.rice-new { box-shadow: 0 0 0 .2rem rgba(27,175,122,.35); }
.rice-grand .card-body { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.rg-l { font-weight: 700; }
.rg-nums { margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; font-variant-numeric: tabular-nums; }
.rg-nums strong { font-size: 1.25rem; color: var(--bs-primary-text-emphasis); }
.rp-head, .rp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .9fr) auto; gap: .4rem; align-items: center; }
.rp-row { margin-bottom: .4rem; }
.rp-per { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) {
  .rp-head { display: none; }
  .rp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; }
  .rp-per { grid-column: 1 / -1; grid-row: 2; margin-top: -.2rem; }
  .rice-tot { margin-inline-start: 0; }
  .rg-nums { margin-inline-start: 0; }
}
.kpi-grain .kpi-top .small { font-size: .7rem; white-space: nowrap; }

/* ---------- v1.27.1: rice-only stock tile and page */
.grain-split.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-mon-b { background: color-mix(in srgb, #2a78d6 10%, transparent); }
.g-val { background: color-mix(in srgb, #6a5bd0 11%, transparent); }
.g-val .g-kg { font-size: clamp(.9rem, .75rem + .9vw, 1.2rem); }
.g-szs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .2rem; }
.g-sz { border: 1px solid var(--rm-line); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; background: var(--rm-surface); white-space: nowrap; }
@media (max-width: 420px) { .grain-split.g3 { grid-template-columns: 1fr 1fr; } .grain-split.g3 .g-val { grid-column: 1 / -1; } }
.rs-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.rs-kpi { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--rm-line); border-radius: 14px; padding: .85rem 1rem; background: var(--rm-surface); min-width: 0; }
.rk-i { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; color: #fff; }
.rk-kg .rk-i { background: #1baf7a; } .rk-bags .rk-i { background: #2a78d6; } .rk-val .rk-i { background: #6a5bd0; } .rk-age .rk-i { background: #eda100; }
.rk-b { min-width: 0; flex: 1; }
.rk-l { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); }
.rk-v { font-size: clamp(1.1rem, .9rem + 1vw, 1.5rem); font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rk-s { font-size: .8rem; color: var(--rm-ink-2); overflow-wrap: anywhere; }
.rk-s .bi-circle-fill { font-size: .5rem; vertical-align: middle; }
.rk-age-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--rm-line); margin: .45rem 0 .35rem; }
.rk-age-bar .ag-new { background: #1baf7a; } .rk-age-bar .ag-old { background: #e34948; }
.rs-sizes { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.rs-size, .rc-size { border: 1px solid var(--rm-line); border-top: 4px solid var(--sc, #898781); border-radius: 12px; padding: .6rem .75rem; background: var(--rm-surface); min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.sz-h { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.sz-kg { font-weight: 800; font-size: 1.15rem; color: var(--sc, var(--rm-ink)); }
.sz-kg small { font-size: .7rem; font-weight: 700; }
.sz-n b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sz-n span { color: var(--rm-ink-2); font-size: .82rem; }
.sz-bar { height: 6px; border-radius: 4px; background: var(--rm-line); overflow: hidden; }
.sz-bar span { display: block; height: 100%; background: var(--sc); }
.sz-s { font-size: .78rem; color: var(--rm-ink-2); overflow-wrap: anywhere; }
.sz-s strong { color: var(--rm-ink); }
.sz-price { display: flex; flex-wrap: wrap; gap: .1rem .6rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.sz-val { font-weight: 800; font-size: 1rem; color: var(--bs-primary-text-emphasis); font-variant-numeric: tabular-nums; }
.sz-wh { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.sz-wh span { font-size: .72rem; background: var(--bs-tertiary-bg); border-radius: 6px; padding: .05rem .4rem; overflow-wrap: anywhere; }
.sz-loose { border-top-color: #898781; border-style: dashed; border-top-style: solid; }
.hbar { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .35rem 0; color: var(--rm-ink); text-decoration: none; border-bottom: 1px dashed var(--rm-line); }
.hbar:last-child { border-bottom: 0; }
a.hbar:hover .hb-f { filter: brightness(1.08); }
.hb-l { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-l small { display: block; font-weight: 400; color: var(--rm-ink-2); font-size: .72rem; }
.hb-t { height: 12px; border-radius: 6px; background: var(--rm-line); overflow: hidden; }
.hb-f { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #1baf7a, #2a78d6); }
.hb-wh .hb-f { background: linear-gradient(90deg, #6a5bd0, #2a78d6); }
.hb-v { text-align: end; font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-v small { display: block; font-weight: 400; font-size: .72rem; color: var(--rm-ink-2); }
.hb-tot .hb-t { background: transparent; }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .85rem 1rem .5rem; }
.rc-name { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1 1 220px; }
.rc-name h3 { font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.rc-ico { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, #1baf7a 14%, transparent); color: #128a5f; font-size: 1.25rem; }
.rc-nums { display: flex; flex-wrap: wrap; gap: .4rem; }
.rc-nums > div { border: 1px solid var(--rm-line); border-radius: 10px; padding: .25rem .65rem; min-width: 4.5rem; text-align: center; }
.rc-nums b { display: block; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.rn-l { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); }
.rn-val { background: color-mix(in srgb, #6a5bd0 10%, transparent); border-color: transparent !important; }
.rn-val b { color: var(--bs-primary-text-emphasis); }
.rc-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--rm-line); }
.rc-stack span { display: block; height: 100%; min-width: 2px; }
.rc-stack .st-loose { background: repeating-linear-gradient(45deg, #b8b6b0, #b8b6b0 4px, #d6d4ce 4px, #d6d4ce 8px); }
.rc-age { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: .35rem 0 .7rem; }
.rc-sizes { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.rc-whs > summary { cursor: pointer; font-weight: 700; font-size: .9rem; list-style: none; display: flex; align-items: center; gap: .4rem; }
.rc-whs > summary::-webkit-details-marker { display: none; }
.rc-whs > summary::after { content: "\F282"; font-family: bootstrap-icons; margin-inline-start: auto; transition: transform .15s; }
.rc-whs[open] > summary::after { transform: rotate(180deg); }
.rc-wh-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin-top: .6rem; }
.rc-wh { border: 1px solid var(--rm-line); border-radius: 12px; padding: .6rem .75rem; min-width: 0; background: var(--bs-tertiary-bg); }
.rw-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .6rem; }
.rw-n { display: flex; flex-wrap: wrap; gap: .15rem .8rem; font-size: .82rem; margin: .25rem 0 .35rem; font-variant-numeric: tabular-nums; }
.rw-v { font-weight: 800; color: var(--bs-primary-text-emphasis); }
.rw-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem; padding: .2rem 0; font-size: .8rem; border-top: 1px dashed var(--rm-line); }
.rl-q { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.rl-v { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rw-places { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; align-items: center; }
.rw-place { font-size: .72rem; border-inline-start: 3px solid var(--zc); background: var(--rm-surface); border-radius: 6px; padding: .05rem .4rem; overflow-wrap: anywhere; }
.rc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; padding: .6rem 1rem; border-top: 1px solid var(--rm-line); background: var(--bs-tertiary-bg); font-size: .88rem; border-radius: 0 0 var(--bs-card-inner-border-radius, 12px) var(--bs-card-inner-border-radius, 12px); }
.rc-foot strong { margin-inline-start: auto; font-size: 1.08rem; color: var(--bs-primary-text-emphasis); }
@media (max-width: 575.98px) {
  .hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar .hb-t { grid-column: 1 / -1; grid-row: 2; }
  .rc-nums { width: 100%; }
  .rc-nums > div { flex: 1 1 0; min-width: 0; padding: .25rem .35rem; }
  .rc-nums b { font-size: .92rem; overflow-wrap: anywhere; }
  .rc-head { padding: .75rem .75rem .4rem; }
  .rw-line { grid-template-columns: minmax(0, 1fr) auto; }
  .rw-line .rl-q { grid-column: 1 / -1; grid-row: 2; }
}
@media print { .rc-whs > summary::after { display: none; } .rc-whs:not([open]) > *:not(summary) { display: block; } }
.rk-val .rk-v { font-size: clamp(1rem, .85rem + .8vw, 1.3rem); overflow-wrap: normal; word-break: keep-all; }
.hbar { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) auto; }
@media (max-width: 575.98px) { .rc-nums .rn-val { flex: 1 1 100%; } .rc-nums .rn-val b { font-size: 1.1rem; } }
@media (max-width: 575.98px) { .hbar { grid-template-columns: minmax(0, 1fr) minmax(0, auto); } .hb-v { white-space: normal; min-width: 0; } .hb-v small { overflow-wrap: anywhere; } }
.grain-split.g3 .g-val .g-kg { white-space: nowrap; font-size: clamp(.78rem, 3.3cqi, 1.2rem); }
@media (max-width: 420px) { .grain-split.g3 .g-val .g-kg { font-size: 1.2rem; } }

/* ---------- v1.27.2: bag stock report (size, kind, new / old, godown) */
a.rs-size { color: var(--rm-ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.rs-size:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,20,.08); }
a.rs-size.on { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--sc) 40%, transparent); }
.bagrep { border-top: 4px solid #2a78d6; }
.bagrep-h { font-weight: 700; }
.br-filters { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .8rem; }
.br-f { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.br-fl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); min-width: 6.5rem; }
.br-chip { display: inline-flex; align-items: center; border: 1px solid var(--rm-line); border-radius: 999px; padding: .2rem .7rem; font-size: .84rem; color: var(--rm-ink); text-decoration: none; background: var(--rm-surface); white-space: nowrap; }
.br-chip:hover { border-color: #2a78d6; color: #2a78d6; }
.br-chip.on { background: #2a78d6; border-color: #2a78d6; color: #fff; font-weight: 600; }
.br-chip.bk-poly.on { background: #0aa2c0; border-color: #0aa2c0; } .br-chip.bk-jute.on { background: #a0702a; border-color: #a0702a; }
.br-chip.ag-n.on { background: #1baf7a; border-color: #1baf7a; } .br-chip.ag-o.on { background: #e34948; border-color: #e34948; }
.br-reset { align-self: flex-start; }
.br-result { border-radius: 12px; background: var(--bs-tertiary-bg); padding: .7rem .8rem; margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.brr-what { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; flex: 1 1 260px; min-width: 0; }
.brr-tag { background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 8px; padding: .1rem .5rem; font-size: .8rem; font-weight: 600; overflow-wrap: anywhere; }
.brr-nums { display: flex; flex-wrap: wrap; gap: .4rem; }
.brr-nums > div { border: 1px solid var(--rm-line); background: var(--rm-surface); border-radius: 10px; padding: .25rem .7rem; min-width: 4.6rem; text-align: center; }
.brr-nums b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.brr-nums .rn-val { background: color-mix(in srgb, #6a5bd0 10%, var(--rm-surface)); }
.br-sub { font-size: .95rem; font-weight: 700; margin: .4rem 0 .5rem; display: flex; align-items: center; gap: .4rem; }
.br-mx th.br-col { white-space: normal; min-width: 6.5rem; }
.br-cell .tc { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.br-cell b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.br-cell small { font-size: .72rem; color: var(--rm-ink-2); white-space: nowrap; }
.br-cell small.text-danger { color: var(--bs-danger) !important; }
.br-detail > summary { cursor: pointer; font-weight: 700; font-size: .9rem; }
@media (max-width: 575.98px) {
  .br-fl { min-width: 100%; }
  .brr-nums { width: 100%; }
  .brr-nums > div { flex: 1 1 calc(33% - .4rem); min-width: 0; padding: .25rem .35rem; }
  .brr-nums .rn-val { flex-basis: 100%; }
  .br-cell .tc { align-items: flex-end; text-align: end; }
}

/* v1.29 — SMS / WhatsApp / e-mail choice on forms, invoice links */
.alert-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-inline-end: auto; min-width: 0; }
.alert-pick .ap-l { font-size: .85rem; font-weight: 600; color: var(--bs-secondary-color, #5f6b63); white-space: nowrap; }
.alert-pick .ap-c { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 0; }
.alert-pick .ap-c .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .55rem; --bs-btn-font-size: .8rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .3rem; }
.alert-pick .btn-check:not(:checked) + .btn { opacity: .75; }
.alert-pick .btn-check:checked + .btn::after { content: "\2713"; font-weight: 700; font-size: .75rem; }
.alert-pick.ap-none .ap-l { color: var(--bs-danger, #c0392b); }
.alert-pick .btn-check:disabled + .btn.ap-off { opacity: .45; border-style: dashed; cursor: not-allowed; pointer-events: auto; }
.alert-pick .btn-check:disabled + .btn.ap-off::after { content: none; }
.alert-pick .ap-sum { flex-basis: 100%; font-size: .8rem; color: var(--bs-success-text-emphasis, #146c43); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.alert-pick.ap-none .ap-sum { color: var(--bs-danger, #c0392b); }
.alert-pick .ap-warn { flex-basis: 100%; font-size: .78rem; color: var(--bs-danger-text-emphasis, #842029); background: var(--bs-danger-bg-subtle, #f8d7da); border-radius: 8px; padding: .35rem .55rem; min-width: 0; overflow-wrap: anywhere; }
.alert-pick .btn.ap-bad { border-color: var(--bs-danger, #dc3545); }
.alert-pick .btn.ap-bad .bi { color: var(--bs-danger, #dc3545); }
.alert-pick .btn-check:checked + .btn.ap-bad .bi { color: #fff; }
.alert-pick .ap-note { flex-basis: 100%; font-size: .75rem; color: var(--bs-secondary-color, #5f6b63); min-width: 0; overflow-wrap: anywhere; }
.alert-pick.stacked { flex-direction: column; align-items: flex-start; margin: 0; }
.alert-pick.stacked .ap-c .btn { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .8rem; --bs-btn-font-size: .9rem; }
.share-copy .form-control { font-size: .8rem; }
.share-links .tc { min-width: 0; }
@media (max-width: 575.98px) { .alert-pick { width: 100%; } .alert-pick .ap-l { white-space: normal; } }

/* v1.35: the login ended while the page was open */
.rm-loggedout { position: fixed; inset-inline: .75rem; bottom: .75rem; z-index: 2000; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; border-radius: 12px; background: var(--bs-danger, #c0392b); color: #fff; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.rm-loggedout span { min-width: 0; overflow-wrap: anywhere; }

/* v1.36: WhatsApp templates, Twilio SMS checklist */
.wa-tpl .wa-tpl-body { font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; max-height: 220px; overflow: auto; }
.wa-tpl .list-group-item form .btn { white-space: nowrap; }
.wa-tpl .wa-tpl-test { flex: 1 1 320px; min-width: 0; max-width: 100%; }
.wa-tpl .wa-tpl-test .form-select, .wa-tpl .wa-tpl-test .form-control { max-width: 100%; min-width: 0; flex: 1 1 140px; width: 1% !important; }
.sms-setup .list-group-item > i { flex: 0 0 auto; }

/* v1.37: loading bar at the top while the next page opens */
.rm-progress { position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0; background: var(--bs-primary, #1d6b47); z-index: 2100; opacity: 0; pointer-events: none; transition: width 6s cubic-bezier(.08, .8, .2, 1), opacity .2s; }
.rm-progress.on { width: 92%; opacity: 1; }
@media print { .rm-progress { display: none !important; } }

/* v1.39: photos of warehouses and places */
.pp-preview { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; align-items: center; }
.pp-pv { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--rm-line); }
.pp-pv img { width: 100%; height: 100%; object-fit: cover; }
.pp-pv-x { position: absolute; top: 2px; inset-inline-end: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; line-height: 22px; padding: 0; }
.pp-pv-n { flex-basis: 100%; }
.pp-existing { display: flex; flex-wrap: wrap; gap: .4rem; }
.pp-ex { position: relative; width: 78px; height: 78px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; margin: 0; }
.pp-ex img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-ex input { position: absolute; top: 4px; inset-inline-start: 4px; margin: 0; }
.pp-ex .pp-x { position: absolute; inset: 0; display: none; place-items: center; background: rgba(208,59,59,.55); color: #fff; font-size: 1.3rem; }
.pp-ex:has(input:checked) { border-color: #d03b3b; }
.pp-ex:has(input:checked) .pp-x { display: grid; }

/* v1.40: "View photos" button and the photo window */
.pp-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid color-mix(in srgb, var(--bs-primary, #1d6b47) 35%, transparent); background: color-mix(in srgb, var(--bs-primary, #1d6b47) 8%, var(--rm-surface, #fff)); color: var(--bs-primary, #1d6b47); border-radius: 999px; padding: .32rem .45rem .32rem .8rem; font-size: .85rem; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.pp-btn:hover, .pp-btn:focus-visible { background: var(--bs-primary, #1d6b47); color: #fff; border-color: var(--bs-primary, #1d6b47); }
.pp-btn .bi { font-size: 1rem; }
.pp-btn-n { min-width: 1.5rem; padding: .12rem .45rem; border-radius: 999px; background: var(--bs-primary, #1d6b47); color: #fff; font-size: .75rem; text-align: center; }
.pp-btn:hover .pp-btn-n, .pp-btn:focus-visible .pp-btn-n { background: #fff; color: var(--bs-primary, #1d6b47); }
.pp-btn-sm { padding: .2rem .35rem .2rem .6rem; font-size: .78rem; }
.pp-btn-sm .pp-btn-n { font-size: .7rem; min-width: 1.3rem; }
.pp-btn-card { position: relative; z-index: 2; }
.zone-photos { margin: .45rem 0 .1rem; }
.wh-photo-row { position: relative; z-index: 2; padding: 0 1rem .85rem; }
.wh-photos-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--bs-primary, #1d6b47) 12%, transparent); color: var(--bs-primary, #1d6b47); font-size: 1.1rem; flex: 0 0 auto; }
.pp-gal .modal-content { background: #0c100e; color: #eef2ef; border: 0; border-radius: 0; display: flex; flex-direction: column; }
.pp-top { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: linear-gradient(#0c100e, rgba(12,16,14,.6)); }
.pp-ttl { display: flex; align-items: center; gap: .5rem; font-weight: 700; min-width: 0; flex: 1 1 auto; }
.pp-ttl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-cnt { font-size: .85rem; color: #b8c4bc; background: rgba(255,255,255,.08); border-radius: 999px; padding: .15rem .6rem; white-space: nowrap; }
.pp-ic { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; font-size: 1.05rem; text-decoration: none; flex: 0 0 auto; }
.pp-ic:hover, .pp-ic:focus-visible { background: rgba(255,255,255,.2); color: #fff; }
.pp-stage { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: .5rem 3.6rem; overflow: hidden; }
.pp-stage img { max-width: 100%; max-height: calc(100vh - 200px); object-fit: contain; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); opacity: 0; transform: scale(.985); transition: opacity .25s ease, transform .25s ease; }
.pp-stage img.on { opacity: 1; transform: none; }
.pp-spin { position: absolute; width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: pp-spin .8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
.pp-gal .pp-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1.3rem; display: grid; place-items: center; backdrop-filter: blur(4px); }
.pp-gal .pp-nav:hover, .pp-gal .pp-nav:focus-visible { background: rgba(255,255,255,.28); }
.pp-gal .pp-nav.prev { inset-inline-start: .8rem; }
.pp-gal .pp-nav.next { inset-inline-end: .8rem; }
[dir="rtl"] .pp-gal .pp-nav i { display: inline-block; transform: scaleX(-1); }
.pp-cap { text-align: center; color: #cfd8d2; font-size: .9rem; padding: 0 1rem .3rem; }
.pp-film { display: flex; gap: .45rem; overflow-x: auto; padding: .6rem 1rem .9rem; justify-content: safe center; scrollbar-width: thin; }
.pp-film button { flex: 0 0 auto; width: 68px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: #222; opacity: .55; transition: opacity .15s, border-color .15s; }
.pp-film button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-film button:hover, .pp-film button.on { opacity: 1; }
.pp-film button.on { border-color: #fff; }
@media (max-width: 575.98px) {
  .pp-stage { padding: .3rem .4rem; }
  .pp-stage img { max-height: calc(100vh - 180px); border-radius: 6px; }
  .pp-gal .pp-nav { width: 40px; height: 40px; background: rgba(0,0,0,.45); }
  .pp-gal .pp-nav.prev { inset-inline-start: .3rem; } .pp-gal .pp-nav.next { inset-inline-end: .3rem; }
  .pp-film button { width: 56px; height: 44px; }
  .pp-btn-card .pp-btn-l { display: inline; }
}
@media print { .pp-btn, .wh-photos { display: none !important; } }

/* v1.41: Twilio SMS quick setup */
.tw-setup .card-header { gap: .6rem; align-items: center; }
.tw-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #f22f46, #b5172b); color: #fff; font-size: 1.15rem; flex: 0 0 auto; }
.tw-prog { display: inline-flex; gap: 4px; vertical-align: middle; }
.tw-prog span { width: 22px; height: 6px; border-radius: 3px; background: var(--rm-line, #dde3df); }
.tw-prog span.on { background: #1f8a4c; }
.tw-prog span.now { background: #f0a020; }
.tw-step { border: 1px solid var(--rm-line, #dde3df); border-radius: 14px; margin-bottom: .6rem; background: var(--rm-surface, #fff); overflow: hidden; }
.tw-step > summary { list-style: none; display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; cursor: pointer; font-weight: 600; }
.tw-step > summary::-webkit-details-marker { display: none; }
.tw-step > summary::after { content: "\F282"; font-family: bootstrap-icons; margin-inline-start: .3rem; color: #7a867f; transition: transform .2s; }
.tw-step[open] > summary::after { transform: rotate(180deg); }
.tw-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff3dc; color: #a76200; font-weight: 800; flex: 0 0 auto; border: 2px solid #f0a020; }
.tw-step.is-done .tw-num { background: #1f8a4c; color: #fff; border-color: #1f8a4c; }
.tw-step.is-later .tw-num { background: var(--rm-line, #eef1ef); color: #7a867f; border-color: transparent; }
.tw-st-t { flex: 1 1 auto; min-width: 0; }
.tw-st-s { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .15rem .55rem; background: #fff3dc; color: #a76200; white-space: nowrap; }
.tw-step.is-done .tw-st-s { background: #e3f4ea; color: #1f8a4c; }
.tw-step.is-later .tw-st-s { background: var(--rm-line, #eef1ef); color: #7a867f; }
.tw-body { padding: 0 .9rem .9rem; border-top: 1px dashed var(--rm-line, #dde3df); padding-top: .8rem; }
.tw-ok, .tw-bad, .tw-warn, .tw-rule { display: flex; gap: .5rem; align-items: flex-start; border-radius: 10px; padding: .55rem .75rem; margin-bottom: .7rem; font-size: .9rem; overflow-wrap: anywhere; }
.tw-ok { background: #e3f4ea; color: #145c33; }
.tw-bad { background: #fde8e8; color: #8a1c1c; }
.tw-warn { background: #fff5e0; color: #7a4a00; }
.tw-rule { background: #eaf2ff; color: #1b3f7a; }
.tw-ok i, .tw-bad i, .tw-warn i, .tw-rule i { margin-top: .15rem; flex: 0 0 auto; }
.tw-ext { font-weight: 600; overflow-wrap: anywhere; }
.tw-ok > span, .tw-bad > span, .tw-warn > span, .tw-rule > span { min-width: 0; }
.sms-advanced .card-tools { min-width: 0; flex-wrap: wrap; }
.sms-advanced .card-tools .badge { white-space: normal; text-align: start; max-width: 100%; }
.tw-help { background: var(--rm-bg, #f5f7f6); border-radius: 12px; padding: .75rem .9rem; font-size: .9rem; }
.tw-help li { margin-bottom: .35rem; }
.tw-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tw-chip { margin: 0; cursor: pointer; }
.tw-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tw-chip span { display: inline-block; border: 1px solid var(--rm-line, #dde3df); border-radius: 999px; padding: .3rem .75rem; font-size: .88rem; background: var(--rm-surface, #fff); }
.tw-chip span small { color: #7a867f; }
.tw-chip input:checked + span { background: var(--bs-primary, #1d6b47); color: #fff; border-color: var(--bs-primary, #1d6b47); }
.tw-chip input:checked + span small { color: #d9efe2; }
.tw-chip input:focus-visible + span { outline: 2px solid var(--bs-primary, #1d6b47); outline-offset: 2px; }
.tw-opts { display: grid; gap: .5rem; }
.tw-opt { display: flex; align-items: center; gap: .65rem; border: 1px solid var(--rm-line, #dde3df); border-radius: 12px; padding: .6rem .75rem; margin: 0; cursor: pointer; flex-wrap: wrap; }
.tw-opt:has(input:checked) { border-color: var(--bs-primary, #1d6b47); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary, #1d6b47) 15%, transparent); }
.tw-opt input { flex: 0 0 auto; }
.tw-opt-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--rm-bg, #f1f4f2); flex: 0 0 auto; }
.tw-opt > .min-w-0 { flex: 1 1 160px; }
.tw-make { border-top: 1px dashed var(--rm-line, #dde3df); padding-top: .8rem; }
.tw-todo { padding-inline-start: 1.2rem; margin-bottom: .8rem; }
.tw-todo li { margin-bottom: .5rem; }
.sms-advanced > summary.sms-adv-sum { cursor: pointer; font-weight: 600; padding: .6rem .9rem; border: 1px solid var(--rm-line, #dde3df); border-radius: 12px; background: var(--rm-surface, #fff); list-style: none; display: flex; gap: .5rem; align-items: center; }
.sms-advanced > summary.sms-adv-sum::-webkit-details-marker { display: none; }
.sms-advanced > summary.sms-adv-sum::after { content: "\F282"; font-family: bootstrap-icons; margin-inline-start: auto; color: #7a867f; }
.sms-advanced[open] > summary.sms-adv-sum::after { transform: rotate(180deg); }
@media (max-width: 575.98px) { .tw-step > summary { padding: .65rem .7rem; gap: .5rem; } .tw-body { padding: .7rem .7rem .8rem; } .tw-st-s { display: none; } }
.sms-events .list-group-item > .flex-grow-1 { min-width: 0; overflow-wrap: anywhere; }
.sms-events .list-group-item > .badge { white-space: normal; text-align: start; flex: 0 1 auto; max-width: 45%; }

/* v1.42: SMS with a Bangladeshi gateway */
.bd-logo { background: linear-gradient(135deg, #1f8a4c, #0f5c33); }
.sms-way { border: 1px solid var(--rm-line, #dde3df); border-radius: 14px; padding: .75rem .9rem; background: var(--rm-surface, #fff); }
.sms-way-opts { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sms-way-opt { display: flex; gap: .65rem; align-items: center; border: 1px solid var(--rm-line, #dde3df); border-radius: 12px; padding: .65rem .75rem; color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.sms-way-opt:hover { border-color: var(--bs-primary, #1d6b47); color: inherit; }
.sms-way-opt.is-on { border-color: var(--bs-primary, #1d6b47); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary, #1d6b47) 15%, transparent); background: color-mix(in srgb, var(--bs-primary, #1d6b47) 5%, transparent); }
.sms-way-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, #1f8a4c, #0f5c33); }
.sms-way-ic.tw { background: linear-gradient(135deg, #f22f46, #b5172b); }
.sms-way-opt .min-w-0 { overflow-wrap: anywhere; }
.bd-ask { border: 1px dashed var(--bs-primary, #1d6b47); border-radius: 12px; padding: .75rem .9rem; background: color-mix(in srgb, var(--bs-primary, #1d6b47) 6%, transparent); }
.bd-trouble > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--bs-secondary-color, #5b6660); }
.bd-trouble li { margin-bottom: .3rem; }
.bd-gws .badge { white-space: normal; }

/* v1.43: WhatsApp from your own number */
.btn-wa { --bs-btn-color: #fff; --bs-btn-bg: #1fa855; --bs-btn-border-color: #1fa855; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #178a45; --bs-btn-hover-border-color: #178a45; --bs-btn-active-bg: #127338; --bs-btn-active-color: #fff; }
.wa-logo, .sms-way-ic.wa { background: linear-gradient(135deg, #25d366, #128c4a); }
.wa-free { border-top: 1px dashed var(--rm-line, #dde3df); padding-top: .65rem; }
.wa-free-ic { width: 32px; height: 32px; border-radius: 9px; background: #e3f7ea; color: #128c4a; font-size: 1rem; }
.wa-free .min-w-0 { overflow-wrap: anywhere; }
.wa-warn { display: flex; gap: .5rem; align-items: flex-start; background: #fff6e0; color: #6b4b00; border-radius: 10px; padding: .5rem .7rem; margin-top: .5rem; }
.wa-warn i { margin-top: .1rem; flex: 0 0 auto; }
[data-bs-theme=dark] .wa-warn { background: #3a2f12; color: #f3dca0; }
[data-bs-theme=dark] .wa-free-ic { background: #163b25; color: #6fe0a0; }

/* ---------- v1.45: every user's own side menu — colour, text colour, favourites (html.sb-custom / html.sb-light) ---------- */
html.sb-custom { --rm-sidebar: var(--sb-bg); --rm-sidebar-2: var(--sb-bg2); --rm-sidebar-ink: var(--sb-ink); }
html.sb-custom .sidebar, html.sb-custom .sidebar.offcanvas-lg { background: var(--sb-bg) !important; color: var(--sb-ink); }
html.sb-custom .sidebar-brand, html.sb-custom .sidebar-foot { border-color: var(--sb-line); }
html.sb-custom .brand, html.sb-custom .brand-text strong { color: var(--sb-strong); }
html.sb-custom .brand-text small, html.sb-custom .sidebar-foot { color: var(--sb-muted); }
html.sb-custom .sidebar-nav { scrollbar-color: color-mix(in srgb, var(--sb-ink) 30%, transparent) transparent; }
html.sb-custom .nav-heading { color: var(--sb-muted); }
html.sb-custom .nav-heading::after, html.sb-custom .nav-subhead::after { background: var(--sb-line); }
html.sb-custom .sidebar .nav-link { color: var(--sb-ink); }
html.sb-custom .sidebar .nav-link:hover { background: var(--sb-hover); color: var(--sb-strong); }
html.sb-custom .sidebar .nav-group.open, html.sb-custom .sidebar .nav-link.active { color: #fff; }
html.sb-custom .sidebar .nav-item.current > .nav-group { background: var(--sb-hover); color: var(--sb-strong); }
html.sb-custom .sidebar .nav-link.sub { color: var(--sb-sub); }
html.sb-custom .sidebar .nav-link.sub:hover { color: var(--sb-strong); }
html.sb-custom .sidebar .nav-link.sub.active { background: color-mix(in srgb, var(--sb-acc) 18%, transparent); color: var(--sb-acc-ink); }
html.sb-custom .nav-subhead { color: color-mix(in srgb, var(--cat, var(--sb-muted)) 50%, var(--sb-muted)); }
html.sb-custom .nav-find i, html.sb-custom .nav-find .form-control::placeholder, html.sb-custom .nav-empty { color: var(--sb-muted); }
html.sb-custom .nav-find .form-control { background: var(--sb-hover); border-color: var(--sb-line); color: var(--sb-strong); }
html.sb-custom .nav-find .form-control:focus { background: var(--sb-hover); border-color: var(--sb-acc); }
html.sb-custom .nav-q { background: var(--sb-hover); border-color: var(--sb-line); color: var(--sb-ink); }
html.sb-custom .nav-q i { color: var(--sb-acc); }
html.sb-custom .nav-q:hover, html.sb-custom .nav-q.on { background: color-mix(in srgb, var(--sb-acc) 15%, transparent); border-color: color-mix(in srgb, var(--sb-acc) 35%, transparent); color: var(--sb-strong); }
html.sb-custom .nav-pin { background: var(--sb-hover); border-color: var(--sb-line); color: var(--sb-sub); }
html.sb-custom .nav-pin:hover { color: var(--sb-strong); background: color-mix(in srgb, var(--sb-ink) 14%, transparent); }
html.sb-custom mark.nav-hit { background: color-mix(in srgb, var(--sb-acc) 35%, transparent); color: var(--sb-strong); }
@media (min-width: 992px) {
  html.sb-custom.nav-rail .nav-heading { background: var(--sb-line); }
  html.sb-custom.nav-rail .sidebar .nav-item.fly > .collapse, html.sb-custom.nav-rail .sidebar .nav-item.fly > .nav-fly { background: var(--sb-bg2); border-color: var(--sb-line); }
  html.sb-custom.nav-rail .nav-item.fly .nav-fly-title { color: var(--sb-strong); border-color: var(--sb-line); }
}
/* a light side menu: darker icons so they can be read */
html.sb-light .sidebar .nav-item > .nav-link:not(.sub) > i.bi:first-child { color: color-mix(in srgb, var(--cat, #3a5a48) 60%, #111); background: color-mix(in srgb, var(--cat, #8fb3a0) 20%, transparent); }
html.sb-light .sidebar .nav-item > .nav-link:not(.sub):hover > i.bi:first-child, html.sb-light .sidebar .nav-item.current > .nav-group > i.bi:first-child { color: #111; }
html.sb-light .sidebar .nav-item > .nav-link.active > i.bi:first-child { color: #fff; background: rgba(255,255,255,.2); }
html.sb-light .sidebar .nav-link.sub > i { color: color-mix(in srgb, var(--cat, #3a5a48) 60%, #111); opacity: .85; }
html.sb-light .sidebar .nav-group.open { color: var(--sb-strong); }
html.sb-light .sidebar .btn-close-white { filter: none; }
html.sb-light .sidebar { box-shadow: 1px 0 0 rgba(0,0,0,.08); }
html.sb-light .nav-fav-head > span > i { color: #b07a00; }
html.sb-light.nav-rail .sidebar .nav-item.fly > .collapse { box-shadow: 0 14px 34px rgba(0,0,0,.14); }

/* favourites at the top of the side menu */
.nav-fav-head { justify-content: space-between; }
.nav-fav-head > span { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; }
.nav-fav-head > span > i { color: #e6b43a; font-size: .72rem; }
.nav-fav-head::before { display: none; }
.nav-fav-head::after { display: none; }
.nav-fav-edit { margin-inline-start: auto; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: inherit; opacity: .75; text-decoration: none; font-size: .72rem; }
.nav-fav-edit:hover { opacity: 1; background: rgba(255,255,255,.08); color: #fff; }
html.sb-custom .nav-fav-edit:hover { background: var(--sb-hover); color: var(--sb-strong); }
#navFav:not(:empty) { padding-bottom: .35rem; margin-bottom: .1rem; border-bottom: 1px dashed rgba(255,255,255,.09); }
html.sb-custom #navFav:not(:empty) { border-color: var(--sb-line); }
@media (min-width: 992px) {
  html.nav-rail .nav-fav-head { font-size: 0; padding: .5rem 0 .2rem; height: auto; margin: 0; background: none !important; justify-content: center; }
  html.nav-rail .nav-fav-head > span > i { font-size: .8rem; }
  html.nav-rail .nav-fav-edit { display: none; }
}
/* the star of the top bar */
.btn.nav-fav-btn { color: var(--rm-ink-2); }
.nav-fav-btn.on, .nav-fav-btn.on:hover { color: #e0a800; }
.nav-pin.nav-fav-btn.on { border-color: rgba(230,180,58,.45); }
html.sb-light .nav-fav-btn.on, html.sb-light .nav-fav-btn.on:hover { color: #a46b00; }
.nav-fav-btn.busy { opacity: .55; pointer-events: none; }

/* "My menu & colours" page */
.mp-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .45rem; }
.mp-sw { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; cursor: pointer; min-width: 0; text-align: center; }
.mp-sw > input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mp-sw > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(0,0,0,.15); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); transition: transform .12s, box-shadow .12s; }
.mp-sw > small { font-size: .68rem; line-height: 1.15; color: var(--rm-ink-2); overflow-wrap: anywhere; max-width: 100%; }
.mp-sw:hover > span { transform: translateY(-1px); }
.mp-sw > input:checked + span { box-shadow: 0 0 0 3px var(--rm-surface, #fff), 0 0 0 5px var(--rm-primary, #1f6b46); }
.mp-sw > input:checked ~ small { color: var(--rm-ink, #212529); font-weight: 600; }
.mp-sw > input:focus-visible + span { outline: 2px dashed var(--rm-primary, #1f6b46); outline-offset: 4px; }
.mp-ink-auto > span { background: linear-gradient(135deg, #0e261b 50%, #fbf6ea 50%); color: #e6b43a; font-size: 1.05rem; }
.mp-pick { overflow: hidden; background: conic-gradient(#f44, #fd4, #4d4, #4dd, #44f, #d4d, #f44); padding: 0; }
.mp-pick input[type=color] { width: 70px; height: 70px; border: 0; padding: 0; cursor: pointer; opacity: 0; }
.mp-sw-custom > input:checked + .mp-pick input[type=color] { opacity: 1; }
.mp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.mp-row { display: flex; align-items: center; gap: .55rem; padding: .35rem .45rem; border: 1px solid var(--rm-line, #dee2e6); border-radius: 10px; background: var(--rm-surface, #fff); min-width: 0; }
.mp-row.dragging { opacity: .45; border-style: dashed; }
.mp-grip { color: var(--rm-ink-2); cursor: grab; flex: 0 0 auto; }
.mp-ic { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; color: color-mix(in srgb, var(--cat, #3a5a48) 70%, #111); background: color-mix(in srgb, var(--cat, #8fb3a0) 20%, transparent); }
.mp-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; font-weight: 500; }
.mp-btns { display: flex; gap: .25rem; flex: 0 0 auto; }
.mp-btns .btn { padding: .2rem .45rem; }
.mp-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; max-height: 560px; overflow-y: auto; padding-inline-end: .2rem; }
.mp-group { border: 1px solid var(--rm-line, #dee2e6); border-radius: 10px; padding: .4rem; min-width: 0; border-top: 3px solid var(--cat, #8fb3a0); }
.mp-gtitle { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rm-ink-2); padding: .1rem .3rem .3rem; overflow-wrap: anywhere; }
.mp-page { display: flex; align-items: center; gap: .45rem; width: 100%; border: 0; background: none; text-align: start; padding: .3rem .35rem; border-radius: 7px; color: var(--rm-ink, #212529); font-size: .86rem; min-width: 0; }
.mp-page:hover { background: var(--rm-primary-050, #eef6f1); }
.mp-page > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.mp-page .mp-st { color: #adb5bd; flex: 0 0 auto; }
.mp-page.on .mp-st { color: #e0a800; }
.mp-page .mp-pi { color: color-mix(in srgb, var(--cat, #3a5a48) 70%, #6c757d); flex: 0 0 auto; font-size: .82rem; }
.mp-page.on { font-weight: 600; }
.mp-save { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; padding: .75rem 0; margin-top: .5rem; background: linear-gradient(to top, var(--rm-bg, #f4f6f5) 70%, transparent); }
@media (max-width: 575.98px) {
  .mp-swatches { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: .35rem; }
  .mp-sw > span { width: 40px; height: 40px; }
  .mp-pages { grid-template-columns: 1fr; max-height: none; }
  .mp-save .btn { width: 100%; }
}
[data-bs-theme="dark"] .mp-ic, [data-bs-theme="dark"] .mp-page .mp-pi { color: color-mix(in srgb, var(--cat, #8fb3a0) 80%, #fff); }

/* ---------- v1.46: bag brands (own brands and brands of customers / suppliers), brand-wise stock ---------- */
.li-bagpack { flex-wrap: wrap; }
.li-bagpack .li-bagtype { flex: 1 1 0; }
.li-bagpack .li-bagbrand { flex: 1 1 100%; min-width: 0 !important; }
.brand-logo { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--rm-line); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-logo-xs { width: 20px; height: 20px; border-radius: 5px; font-size: .55rem; }
.brand-logo-sm { width: 30px; height: 30px; font-size: .7rem; }
.brand-logo-md { width: 48px; height: 48px; border-radius: 11px; font-size: 1rem; }
.brand-logo-lg { width: 96px; height: 96px; border-radius: 16px; font-size: 1.6rem; }
.brand-logo-ini { background: var(--bc, #1f6b46); color: #fff; font-weight: 700; border-color: transparent; letter-spacing: .02em; }
.brand-tag { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; max-width: 100%; }
.brand-tag-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-tag-n { font-weight: 600; overflow-wrap: anywhere; }
.brand-tag-t small { color: var(--rm-ink-2); font-size: .72rem; overflow-wrap: anywhere; }
.brand-cam { display: inline-flex; align-items: center; gap: .2rem; padding: .12rem .45rem; font-size: .78rem; line-height: 1.3; border-radius: 999px; border: 1px solid var(--rm-line); background: var(--rm-surface); color: var(--rm-ink-2); flex: 0 0 auto; }
.brand-cam:hover { color: var(--bc, var(--rm-primary)); border-color: var(--bc, var(--rm-primary)); }
.brand-cam-n { font-size: .68rem; font-weight: 700; }
.brand-chips { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.brand-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; padding: .12rem .5rem .12rem .2rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--bc, #8a8f98) 40%, transparent); background: color-mix(in srgb, var(--bc, #8a8f98) 9%, transparent); color: var(--rm-ink); text-decoration: none; max-width: 100%; }
.brand-chip > span { min-width: 0; overflow-wrap: anywhere; }
.brand-chip:not(:has(.brand-logo)) { padding-left: .5rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.brand-find { max-width: 260px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.brand-card { border-top: 4px solid var(--bc, var(--rm-primary)); min-width: 0; }
.brand-card.is-off { opacity: .72; }
.brand-card-h { display: flex; align-items: flex-start; gap: .7rem; min-width: 0; }
.brand-card-n { font-weight: 700; font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
.brand-card-o { font-size: .8rem; color: var(--rm-ink-2); margin-top: .15rem; overflow-wrap: anywhere; }
.brand-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .8rem; }
.brand-nums > div { background: color-mix(in srgb, var(--bc, var(--rm-primary)) 7%, var(--rm-surface)); border-radius: 10px; padding: .4rem .5rem; min-width: 0; }
.brand-nums span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rm-ink-2); overflow-wrap: anywhere; }
.brand-nums b { font-size: 1.02rem; overflow-wrap: anywhere; }
.brand-whs { display: flex; flex-wrap: wrap; align-items: center; }
.brand-owner-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem; }
.brand-owner-opt { position: relative; cursor: pointer; margin: 0; min-width: 0; }
.brand-owner-opt input { position: absolute; opacity: 0; pointer-events: none; }
.brand-owner-opt span { display: flex; align-items: center; gap: .45rem; padding: .5rem .7rem; border: 1px solid var(--rm-line); border-radius: 10px; font-size: .88rem; background: var(--rm-surface); overflow-wrap: anywhere; }
.brand-owner-opt input:checked + span { border-color: var(--rm-primary); background: var(--rm-primary-050); font-weight: 600; box-shadow: 0 0 0 2px color-mix(in srgb, var(--rm-primary) 25%, transparent); }
.brand-owner-opt input:focus-visible + span { outline: 2px dashed var(--rm-primary); outline-offset: 2px; }
.bs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.bs-stats .card-body { padding: .7rem .9rem; min-width: 0; }
.bs-stats .fs-4 { overflow-wrap: anywhere; }
.brand-bar-row { display: grid; grid-template-columns: minmax(0, 220px) auto minmax(60px, 1fr) auto; align-items: center; gap: .6rem; padding: .3rem 0; }
.brand-bar-row + .brand-bar-row { border-top: 1px dashed var(--rm-line); }
.brand-bar-n { color: inherit; text-decoration: none; min-width: 0; }
.brand-bar-t { height: 10px; border-radius: 999px; background: var(--rm-line); overflow: hidden; }
.brand-bar-t span { display: block; height: 100%; background: var(--bc, var(--rm-primary)); border-radius: 999px; }
.brand-bar-v { font-size: .82rem; white-space: nowrap; }
.brand-stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: .9rem; }
.brand-stock-card { border-top: 4px solid var(--bc, var(--rm-primary)); min-width: 0; }
.brand-stock-card .card-header { gap: .5rem; }
.bs-wh { border: 1px solid var(--rm-line); border-radius: 10px; padding: .5rem .65rem; margin-top: .5rem; }
.bs-wh-h { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bs-line { padding: .45rem 0 .2rem; border-top: 1px dashed var(--rm-line); margin-top: .4rem; min-width: 0; }
.bs-places { display: flex; flex-wrap: wrap; }
.bs-places .zone-code { font-size: .64rem; padding: 0 .3rem; }
.zone-item .brand-chip, .zone-brand { font-size: .68rem; }
.zone-item .nm .brand-logo { margin-right: .2rem; vertical-align: -5px; }
.zone-item .zb { display: block; font-size: .7rem; color: var(--rm-ink-2); overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .bs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-stock-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .brand-bar-t { grid-column: 1 / -1; }
  .brand-bar-v { grid-column: 1 / -1; white-space: normal; }
  .brand-find { max-width: none; }
}
@media (max-width: 400px) { .brand-grid { grid-template-columns: minmax(0, 1fr); } .brand-nums b { font-size: .92rem; } }
[data-bs-theme="dark"] .brand-logo { border-color: #2a312d; }

/* ---------- v1.46.1: full screen button and the full-screen frame ---------- */
.fs-btn { position: fixed; z-index: 1065; inset-inline-end: 12px; bottom: 12px; width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(127,127,127,.35); background: rgba(127,127,127,.14); color: var(--rm-ink, #222); font-size: .95rem; line-height: 1;
  opacity: .45; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: opacity .35s, transform .35s, visibility .35s; cursor: pointer; }
.fs-btn:hover, .fs-btn:focus-visible { opacity: 1; background: var(--rm-surface, #fff); border-color: var(--rm-primary, #1d6b47); color: var(--rm-primary, #1d6b47); }
.fs-btn.gone { opacity: 0; visibility: hidden; transform: translateY(8px); pointer-events: none; }
html.fs-shell, html.fs-shell body { overflow: hidden !important; }
html.fs-shell .fs-btn { display: none !important; }
.fs-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2147483000; background: var(--rm-bg, #f4f5f0); }
@media print { .fs-btn { display: none !important; } }

/* ---------- v1.46.2: Favourites as a group (dropdown) in the side menu ---------- */
.nav-fav-group:not(:hover):not(.fly) > .nav-group > i.bi:first-child { color: #e6b43a !important; }
html.sb-light .nav-fav-group:not(:hover):not(.fly) > .nav-group > i.bi:first-child { color: #a46b00 !important; }
.nav-fav-n { margin-inline-start: auto; min-width: 1.35rem; height: 1.15rem; padding: 0 .35rem; border-radius: 999px; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 700;
  background: rgba(230,180,58,.18); color: #e6b43a; }
html.sb-light .nav-fav-n { background: rgba(164,107,0,.12); color: #8a5a00; }
.nav-fav-n + .caret { margin-inline-start: .35rem !important; }
.sidebar .nav-fav-group .nav-link.sub > i { opacity: .9; }
@media (min-width: 992px) { html.nav-rail .nav-fav-n { display: none; } }
/* v1.47: office ID cards */
.idc-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; max-width: 560px; margin: 0 auto; }
.idc-img { display: block; width: 100%; aspect-ratio: 1276 / 2022; border-radius: 4.5% / 2.8%; box-shadow: 0 10px 28px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06); background: #fff; }
.idc-ph { aspect-ratio: 1276 / 2022; border-radius: 4.5% / 2.8%; background: linear-gradient(110deg, var(--rm-line) 8%, color-mix(in srgb, var(--rm-line) 40%, transparent) 18%, var(--rm-line) 33%); background-size: 200% 100%; animation: idcShine 1.2s linear infinite; }
@keyframes idcShine { to { background-position-x: -200%; } }
.idc-side { position: sticky; top: 76px; }
@media (max-width: 1199.98px) { .idc-side { position: static; } }
.idc-list { max-height: 70vh; overflow-y: auto; }
.idc-row { display: flex; align-items: center; gap: .65rem; }
.idc-row.on { background: color-mix(in srgb, var(--rm-primary, #1b7a52) 10%, transparent); }
.idc-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.idc-theme { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .5rem; border: 2px solid var(--rm-line); border-radius: 12px; cursor: pointer; text-align: center; font-size: .82rem; }
.idc-theme input { position: absolute; opacity: 0; pointer-events: none; }
.idc-theme:has(input:checked) { border-color: var(--rm-primary, #1b7a52); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rm-primary, #1b7a52) 20%, transparent); }
.idc-theme .sw { width: 54px; height: 80px; border-radius: 7px; position: relative; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.idc-theme .sw i { position: absolute; left: 0; right: 0; top: 36%; height: 5px; }
.idc-sign-prev { max-height: 56px; max-width: 200px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 6px; padding: 4px; }

/* v1.47.1: ID card view button, window and the ten designs */
.emp-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.emp-name-row h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.idc-mini { display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .75rem .3rem .3rem; border: 1px solid var(--rm-line); border-radius: 12px; background: var(--rm-card, #fff); color: inherit; font-size: .85rem; font-weight: 600; line-height: 1.2; text-align: start; max-width: 100%; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.idc-mini:hover, .idc-mini:focus-visible { border-color: var(--rm-primary, #1b7a52); box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-1px); }
.idc-mini-img { flex: 0 0 auto; width: 34px; display: block; }
.idc-mini-img img, .idc-mini-img .idc-ph { display: block; width: 34px; aspect-ratio: 1276 / 2022; border-radius: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.idc-mini-t { min-width: 0; color: var(--rm-primary, #1b7a52); }
.idc-mini-t .bi { margin-inline-end: .15rem; }
.idc-preview-lg { max-width: 780px; gap: 1.2rem; }
.idc-preview.loading .idc-img { opacity: .55; }
.idc-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; max-width: 780px; margin: .4rem auto 0; text-align: center; font-weight: 600; }
.idc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.idc-tools .idc-lang { width: auto; max-width: 100%; min-width: 0; flex: 0 1 260px; }
.idc-modal .modal-body .btn { white-space: normal; }
.idc-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .75rem; }
.idc-tpl { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .5rem; border: 2px solid var(--rm-line); border-radius: 14px; cursor: pointer; text-align: center; font-size: .85rem; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.idc-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.idc-tpl:hover { border-color: color-mix(in srgb, var(--rm-primary, #1b7a52) 50%, var(--rm-line)); }
.idc-tpl:has(input:checked) { border-color: var(--rm-primary, #1b7a52); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rm-primary, #1b7a52) 22%, transparent); }
.idc-tpl:has(input:checked)::after { content: "✓"; position: absolute; top: .3rem; inset-inline-end: .35rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--rm-primary, #1b7a52); color: #fff; font-size: .8rem; line-height: 1.4rem; text-align: center; }
.idc-tpl:has(input:focus-visible) { outline: 2px solid var(--rm-primary, #1b7a52); outline-offset: 2px; }
.idc-tpl-img { display: block; width: 100%; max-width: 120px; }
.idc-tpl-img img, .idc-tpl-img .idc-ph { display: block; width: 100%; aspect-ratio: 1276 / 2022; border-radius: 4.5% / 2.8%; box-shadow: 0 4px 12px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.05); }
@media (max-width: 575.98px) {
  .idc-tpls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .idc-tpl { padding: .35rem; font-size: .78rem; }
  .idc-preview-lg, .idc-sides { gap: .6rem; }
  .idc-mini { font-size: .8rem; }
}

/* v1.48: signatures on the ID card (upload or draw) */
.idc-sign { border: 1px dashed var(--rm-line); border-radius: 14px; padding: .75rem; background: color-mix(in srgb, var(--rm-primary, #1b7a52) 3%, transparent); min-width: 0; }
.idc-sign.busy { opacity: .6; pointer-events: none; }
.idc-sign-head { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.idc-sign-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.idc-sign-box { flex: 0 0 auto; width: 220px; max-width: 100%; height: 76px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff repeating-conic-gradient(#f1f3f2 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--rm-line); overflow: hidden; }
.idc-sign-box img { max-width: 92%; max-height: 86%; object-fit: contain; }
.idc-sign-none { color: var(--bs-secondary-color, #6c757d); font-size: .82rem; padding: 0 .5rem; text-align: center; }
.idc-sign-tools { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.idc-pad { margin-top: .6rem; }
.idc-pad canvas { display: block; width: 100%; max-width: 560px; aspect-ratio: 3 / 1; height: auto; background: #fff linear-gradient(to top, transparent 22%, #c9d2ce 22%, #c9d2ce calc(22% + 2px), transparent calc(22% + 2px)); border: 1px solid var(--rm-line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.idc-pad-hint { margin-top: .3rem; }
.idc-sign-grp + .idc-sign-grp { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rm-line); }
@media (max-width: 575.98px) { .idc-sign-box { width: 100%; } .idc-sign-tools .btn { flex: 1 1 auto; } }

/* v1.48.1: design gallery — front and back of every design, large preview */
.idc-tpls { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.idc-tpl-cell { display: flex; flex-direction: column; min-width: 0; }
.idc-tpl-cell .idc-tpl { flex: 1 1 auto; }
.idc-tpl-cell .btn { font-size: .78rem; white-space: normal; line-height: 1.2; }
.idc-tpl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; max-width: 200px; }
.idc-tpl-pair img, .idc-tpl-pair .idc-ph { display: block; width: 100%; aspect-ratio: 1276 / 2022; border-radius: 4.5% / 2.8%; box-shadow: 0 3px 10px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.05); }
[data-tpl-use].active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rm-primary, #1b7a52) 30%, transparent); }
@media (max-width: 575.98px) {
  .idc-tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v1.49: send the office ID card and profile to the employee */
.idc-send { border: 1px solid var(--rm-line); border-radius: 14px; padding: .75rem; background: color-mix(in srgb, #198754 4%, transparent); min-width: 0; }
.idc-send.busy, .idc-auto.busy { opacity: .7; }
.idc-send.busy [data-send-go] { pointer-events: none; }
.idc-send-head { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.idc-send .alert-pick, .idc-new-send .alert-pick { min-width: 0; }
.idc-send [data-send-status]:empty { display: none; }
.idc-auto { min-width: 0; }
.idc-auto > div { min-width: 0; overflow-wrap: anywhere; }
.idc-new-send { background: color-mix(in srgb, #198754 4%, transparent); }

/* v1.49.2: dashboard head — minimal, flat: greeting by the time of day, date range and location dropdowns (no animation) */
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.dash-hello { min-width: 0; flex: 1 1 240px; }
.dash-hello .page-title { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .3rem; }
.dash-comma { margin-inline-start: -.3rem; }
.dash-name { color: var(--rm-primary); overflow-wrap: anywhere; }
.dash-wave { font-size: .85em; }
.dash-head .page-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; }
.dash-clock { font-variant-numeric: tabular-nums; }
.dash-pickers { display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; max-width: 100%; }
.dash-dd-wrap { min-width: 0; max-width: 100%; }
/* the two buttons: flat, like the cards */
.dash-pick { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 40px; padding: .35rem .65rem; border: 1px solid var(--rm-line); border-radius: 10px; background: var(--rm-surface); color: var(--rm-ink); text-align: start; cursor: pointer; font-size: .875rem; line-height: 1.2; }
.dash-pick:hover { border-color: color-mix(in srgb, var(--rm-primary) 40%, var(--rm-line)); }
.dash-pick:focus-visible { outline: 2px solid var(--rm-primary); outline-offset: 1px; }
.dash-pick[aria-expanded="true"] { border-color: var(--rm-primary); }
.dp-ic { flex: 0 0 auto; color: var(--rm-primary); font-size: 1rem; line-height: 1; }
.dp-ic-loc { color: var(--rm-primary); }
.dp-tx { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .4rem; min-width: 0; }
.dp-cap { display: none; }
.dp-val { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.dp-sub { font-size: .75rem; color: var(--rm-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dp-chev { flex: 0 0 auto; margin-inline-start: auto; padding-inline-start: .2rem; font-size: .75rem; color: var(--rm-ink-2); }
/* the panels: plain, a thin line and a soft shadow */
.dash-dd { --bs-dropdown-padding-x: 0; --bs-dropdown-padding-y: 0; border: 1px solid var(--rm-line); border-radius: 12px; background: var(--rm-surface); box-shadow: 0 6px 20px rgba(16, 40, 28, .08); padding: .5rem; }
.dd-head { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--rm-ink-2); padding: .2rem .45rem .45rem; }
.dash-dd-range { width: 300px; max-width: calc(100vw - 24px); }
.dash-dd-loc { width: 250px; max-width: calc(100vw - 24px); }
.dd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem; }
.dd-chip, .dd-row { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: 8px; color: var(--rm-ink); text-decoration: none; font-size: .875rem; min-width: 0; }
.dd-chip > span, .dd-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dd-chip > .bi:first-child, .dd-dot { color: var(--rm-ink-2); font-size: .95rem; }
.dd-chip:hover, .dd-row:hover { background: var(--rm-bg); color: var(--rm-ink); }
.dd-chip.active, .dd-row.active { background: var(--rm-primary-050); color: var(--rm-primary); font-weight: 600; }
.dd-chip.active > .bi:first-child, .dd-row.active .dd-dot { color: var(--rm-primary); }
.dd-ok { margin-inline-start: auto; flex: 0 0 auto; }
.dd-custom { margin-top: .5rem; padding: .55rem .45rem .2rem; border-top: 1px solid var(--rm-line); }
.dd-sub { font-weight: 600; font-size: .8rem; margin-bottom: .4rem; color: var(--rm-ink); }
.dd-sub .bi { color: var(--rm-primary); }
.dd-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin-bottom: .5rem; }
.dd-dates label { display: flex; flex-direction: column; gap: .15rem; min-width: 0; margin: 0; }
.dd-dates label > span { font-size: .7rem; color: var(--rm-ink-2); }
.dd-dates .form-control { min-width: 0; }
.dd-list { display: flex; flex-direction: column; gap: .1rem; max-height: min(320px, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.dd-dot { flex: 0 0 auto; }
.dd-code { flex: 0 0 auto; font-size: .7rem; color: var(--rm-ink-2); }
@media (max-width: 575.98px) {
  .dash-pickers { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-pickers > .dash-dd-wrap:only-child { grid-column: 1 / -1; }
  .dp-tx { flex-direction: column; align-items: flex-start; gap: 0; }
  .dp-val { max-width: 100%; }
}
@media (max-width: 359.98px) {
  .dash-pick { padding-inline: .5rem; gap: .4rem; }
  .dp-sub { font-size: .7rem; }
}
.dd-chip.dd-wide { grid-column: 1 / -1; }   /* v1.49.3: "All time" across the panel */
/* v1.49.3: long names (Tamil, Malayalam, Russian …) wrap to two lines instead of being cut */
.dd-chip > span { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
@media (max-width: 575.98px) {
  .dp-val { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
  .dd-chip { padding: .45rem .4rem; gap: .35rem; font-size: .84rem; }
}

/* v1.50: summary cards — long amounts fit the card */
.stat-body { flex: 1 1 auto; }
.stat-card.is-long .stat-value { font-size: clamp(.8rem, 6.2cqi, 1.2rem); }
.stat-card.is-xlong .stat-value { font-size: clamp(.74rem, 5.2cqi, 1.05rem); }
.stat-card.is-long .stat-value, .stat-card.is-xlong .stat-value { white-space: normal; overflow-wrap: anywhere; }
/* v1.50: vehicle / driver book — earlier vehicles and drivers while typing */
.tb-wrap { position: relative; }
.tb-list { position: absolute; z-index: 1060; inset-inline-start: 0; top: calc(100% + 4px); width: max(100%, 240px); max-width: calc(100vw - 24px); max-height: 280px; overflow-y: auto; overscroll-behavior: contain; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 10px; box-shadow: 0 6px 20px rgba(16, 40, 28, .1); padding: .25rem; }
.tb-it { padding: .4rem .5rem; border-radius: 7px; cursor: pointer; min-width: 0; }
.tb-it:hover, .tb-it.on { background: var(--rm-primary-050); }
.tb-main { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.tb-nm { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tb-n { margin-inline-start: auto; flex: 0 0 auto; font-size: .72rem; font-weight: 600; color: var(--rm-primary); background: var(--rm-primary-050); border-radius: 6px; padding: 0 .35rem; }
.tb-sub { display: flex; gap: .5rem; font-size: .74rem; color: var(--rm-ink-2); min-width: 0; }
.tb-sub > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tb-d { margin-inline-start: auto; flex: 0 0 auto; }
.tb-info { font-size: .74rem; color: var(--rm-ink-2); margin-top: .25rem; line-height: 1.35; overflow-wrap: anywhere; }
.tb-info:empty { display: none; }
.tb-info b { color: var(--rm-ink); font-weight: 600; white-space: nowrap; }
.tb-info .bi { color: var(--rm-primary); }
.tb-new { color: var(--rm-ink-2); }
.tb-split { white-space: nowrap; }
.sale-veh { border-top: 1px dashed var(--rm-line); padding-top: .75rem; }
.sale-veh-t { font-weight: 600; font-size: .88rem; margin-bottom: .5rem; }
.sale-veh-t .bi { color: var(--rm-primary); }
/* v1.50: sales invoices — sales by category, sort by value, compact table */
.cat-sales-t { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.cat-sales-t .bi { color: var(--rm-primary); }
.cat-grid { display: grid; gap: clamp(.5rem, .3rem + .6vw, .85rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.cat-card { background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: .75rem .85rem; min-width: 0; container-type: inline-size; display: flex; flex-direction: column; gap: .3rem; }
.cat-top { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.cat-ic.stat-icon { width: 34px; height: 34px; flex: 0 0 34px; font-size: 1rem; border-radius: 9px; }
.cat-nm { display: flex; align-items: baseline; gap: .4rem; min-width: 0; flex: 1 1 auto; }
.cat-name { font-weight: 600; font-size: .86rem; overflow-wrap: anywhere; min-width: 0; }
.cat-pc { margin-inline-start: auto; font-size: .74rem; font-weight: 600; color: var(--rm-ink-2); flex: 0 0 auto; }
.cat-amt { font-weight: 700; font-size: clamp(.86rem, 7cqi, 1.2rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.cat-bar { height: 5px; border-radius: 5px; background: var(--rm-line); overflow: hidden; }
.cat-bar > span { display: block; height: 100%; border-radius: 5px; background: currentColor; }
.cat-card.tone-primary .cat-bar { color: var(--rm-primary); } .cat-card.tone-accent .cat-bar { color: var(--rm-accent); } .cat-card.tone-blue .cat-bar { color: #2a78d6; }
.cat-card.tone-orange .cat-bar { color: #eb6834; } .cat-card.tone-violet .cat-bar { color: #6a5bd0; } .cat-card.tone-red .cat-bar { color: #d03b3b; }
.cat-sub { display: flex; flex-direction: column; font-size: .74rem; color: var(--rm-ink-2); overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; } .cat-card { padding: .6rem; } }
.sort-val .btn { display: inline-flex; align-items: center; gap: .15rem; }
.val-mark { display: inline-flex; font-size: .8rem; vertical-align: 1px; }
.val-mark.up { color: #1f9254; } .val-mark.down { color: #d03b3b; }
@media (min-width: 768px) {
  .inv-tbl > :not(caption) > * > * { padding: .5rem .48rem; }
  .inv-tbl .sl-items { max-width: 240px; min-width: 120px; }
  .inv-tbl .sl-items > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .inv-tbl td.num, .inv-tbl th.num { white-space: nowrap; }
  .inv-tbl { font-size: .875rem; }
  .inv-tbl .sl-loc { white-space: normal; max-width: 9rem; }
  .inv-tbl .sl-pos { font-size: .62rem; vertical-align: 2px; }
  .inv-tbl .sl-items { max-width: 200px; min-width: 110px; }
}
@media (min-width: 768px) and (max-width: 1399.98px) { .inv-tbl .sl-pos { display: table; margin-top: .1rem; } }
@media (min-width: 1600px) { .inv-tbl { font-size: .92rem; } .inv-tbl .sl-items { max-width: 260px; } }
.inv-tbl td .btn-sm { padding: .2rem .4rem; }

.tb-list.to-end { inset-inline-start: auto; inset-inline-end: 0; }
/* v1.50: sales / purchase invoices on a phone — each invoice is a compact card of 6 short lines (label over value) */
@media (max-width: 767.98px) {
  .table-stack.inv-tbl tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: .5rem; padding: .45rem 0; margin: .5rem; }
  .table-stack.inv-tbl > :not(caption) > * > * { padding: .2rem .65rem; }
  .table-stack.inv-tbl tbody td { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 0; text-align: start !important; min-width: 0; font-size: .86rem; overflow-wrap: anywhere; }
  .table-stack.inv-tbl tbody td::before { font-size: .64rem; text-align: start; }
  .table-stack.inv-tbl tbody td.c-inv, .table-stack.inv-tbl tbody td.c-party { grid-column: span 2; }
  .table-stack.inv-tbl tbody td.c-items, .table-stack.inv-tbl tbody td.empty-row { grid-column: 1 / -1; }
  .table-stack.inv-tbl tbody td.c-act { grid-column: span 2; align-self: end; }
  .table-stack.inv-tbl tbody td.c-act { flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
  .table-stack.inv-tbl tbody td.c-act::before { display: none; }
  .table-stack.inv-tbl tbody td.empty-row { align-items: center; }
  .inv-tbl .sl-items > span { text-align: start; }
}
/* v1.50: sales / purchase invoices on a tablet / small laptop (768–1199 px): the same compact cards, two in a row */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .table-responsive > .inv-tbl { min-width: 0 !important; }
  .inv-tbl thead { display: none; }
  .inv-tbl, .inv-tbl tbody { display: block; width: 100%; }
  .inv-tbl tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; padding: .6rem; }
  .inv-tbl tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: .5rem; border: 1px solid var(--rm-line); border-radius: 10px; background: var(--rm-surface); padding: .45rem 0; }
  .inv-tbl > :not(caption) > * > * { border-bottom: 0; padding: .2rem .65rem; }
  .inv-tbl tbody td { display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: start !important; min-width: 0; font-size: .86rem; overflow-wrap: anywhere; }
  .inv-tbl tbody td::before { content: attr(data-label); font-size: .64rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rm-ink-2); font-weight: 600; }
  .inv-tbl tbody td[data-label=""]::before { display: none; }
  .inv-tbl tbody td.c-inv, .inv-tbl tbody td.c-party { grid-column: span 2; }
  .inv-tbl tbody td.c-items, .inv-tbl tbody td.empty-row { grid-column: 1 / -1; }
  .inv-tbl tbody td.c-act { grid-column: span 2; align-self: end; flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
  .inv-tbl tbody td.c-act::before { display: none; }
  .inv-tbl tbody tr:has(td.empty-row) { grid-column: 1 / -1; }
  .inv-tbl .sl-items { max-width: none; }
  .inv-tbl .sl-pos { display: inline-block; margin: 0; }
}
.inv-tbl .c-bill-sub { display: none; }
@media (max-width: 1599.98px) { .inv-tbl .c-bill { display: none !important; } .inv-tbl .c-bill-sub { display: block; font-size: .74rem; color: var(--rm-ink-2); white-space: normal; } }
/* v1.50.1: compact invoice cards — nothing runs into the next box */
@media (max-width: 1199.98px) {
  .inv-tbl tbody td.nowrap, .inv-tbl .sl-loc { white-space: normal; }
  .inv-tbl tbody td.num { white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
}
@media (max-width: 420px) {
  .table-stack.inv-tbl tbody tr { column-gap: .25rem; }
  .table-stack.inv-tbl > :not(caption) > * > * { padding-inline: .45rem; }
  .table-stack.inv-tbl tbody td.num { font-size: .76rem; letter-spacing: -.01em; }
}

/* v1.50.2: filter strip of the sales / purchase invoices — flat dropdowns like the dashboard, one line on a desktop */
.flt-strip { display: flex; align-items: stretch; gap: .45rem; flex-wrap: wrap; min-width: 0; }
.flt-strip > * { min-width: 0; }
.flt-search { position: relative; flex: 1 1 100%; order: -1; min-width: 130px; }
/* one line when it fits (app.js measures it: .flt-fit) */
.flt-strip.flt-fit { flex-wrap: nowrap; }
.flt-strip.flt-fit .flt-search { flex: 1 1 140px; order: 0; min-width: 110px; }
.flt-strip.flt-fit .flt-reset .btn span { display: none; }
.flt-strip.flt-fit .flt-dd { flex: 0 0 auto; }
.flt-search > .bi { position: absolute; inset-inline-start: .7rem; top: 50%; transform: translateY(-50%); color: var(--rm-ink-2); font-size: .9rem; pointer-events: none; }
.flt-search .form-control { height: 100%; min-height: 40px; padding-inline-start: 2rem; border-radius: 10px; font-size: .875rem; background: var(--rm-surface); }
.flt-dd { flex: 0 1 auto; min-width: 0; }
.flt-dd .flt-pick { min-height: 40px; height: 100%; max-width: 220px; }
.flt-dd .flt-pick .dp-tx { flex-wrap: nowrap; }
.flt-dd .flt-pick .dp-val { max-width: 11rem; }
.flt-date .flt-pick { max-width: 260px; }
.flt-date .flt-pick .dp-tx { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
.flt-date .flt-pick .dp-sub { font-size: .68rem; }
.flt-strip .flt-pick { padding: .3rem .5rem; gap: .4rem; }
.flt-strip .flt-pick .dp-chev { font-size: .65rem; padding-inline-start: .1rem; }
.flt-strip.flt-fit { gap: .35rem; }
.flt-pick.is-set { border-color: color-mix(in srgb, var(--rm-primary) 55%, var(--rm-line)); background: var(--rm-primary-050); }
.flt-pick.is-set .dp-val { color: var(--rm-primary); }
.flt-sort { flex: 0 0 auto; display: flex; }
.flt-sort .btn-group { height: 100%; }
.flt-sort .btn { min-height: 40px; padding-inline: .6rem; border-radius: 10px; }
.flt-sort .btn-group > .btn:not(:last-child) { border-start-end-radius: 0; border-end-end-radius: 0; }
.flt-sort .btn-group > .btn:not(:first-child) { border-start-start-radius: 0; border-end-start-radius: 0; }
.flt-reset { flex: 0 0 auto; display: flex; }
.flt-reset:empty { display: none; }
.flt-reset .btn { min-height: 40px; border-radius: 10px; display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; }
.flt-menu { width: 270px; }
.flt-menu .dd-find { margin: 0 .2rem .4rem; width: calc(100% - .4rem); }
.flt-menu .dd-list { max-height: min(300px, 55vh); }
.dash-dd button.dd-row, .dash-dd button.dd-chip { width: 100%; background: none; border: 0; text-align: start; font: inherit; color: inherit; }
.dash-dd button.dd-chip { border: 1px solid transparent; }
.dash-dd button.dd-row.active, .dash-dd button.dd-chip.active { background: var(--rm-primary-050); color: var(--rm-primary); font-weight: 600; }
.dash-dd button.dd-row:hover, .dash-dd button.dd-chip:hover { background: var(--rm-bg); }
.dash-dd button.dd-row.active:hover, .dash-dd button.dd-chip.active:hover { background: var(--rm-primary-050); }
.dd-head2 { margin-top: .4rem; border-top: 1px solid var(--rm-line); padding-top: .55rem; }
/* phones: search on top, the dropdowns two in a row, sort + reset below */
@media (max-width: 575.98px) {
  .flt-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .flt-strip.flt-fit { display: grid; }
  .flt-search, .flt-strip.flt-fit .flt-search { grid-column: 1 / -1; order: -1; }
  .flt-dd .flt-pick, .flt-date .flt-pick { max-width: none; width: 100%; }
  .flt-dd .flt-pick .dp-val { max-width: none; }
  .flt-date { grid-column: 1 / -1; }
  .flt-sort .btn-group { width: 100%; } .flt-sort .btn { flex: 1 1 0; }
  .flt-reset .btn { width: 100%; justify-content: center; }
  .flt-menu, .flt-strip .dash-dd-range { width: calc(100vw - 24px); }
}
.flt-strip.flt-tight .flt-dd:not(.flt-date) .flt-pick .dp-ic { display: none; }
.flt-strip.flt-tight .flt-pick { padding-inline: .45rem; gap: .3rem; }
.flt-strip.flt-tight .flt-dd .flt-pick .dp-val { max-width: 9rem; }


/* ---------- v1.51 Forgot password (v1.51.1: own page design) ---------- */
.login-forgot { font-size: .85rem; text-decoration: none; }
.login-forgot:hover { text-decoration: underline; }
.pwr-body { --pwr-soft: #f2f6f3; --pwr-line: #dfe7e2; --pwr-ring: rgba(29,107,71,.16); min-height: 100vh; margin: 0;
  background: radial-gradient(900px 520px at 0% 0%, rgba(29,107,71,.10), transparent 60%), radial-gradient(800px 480px at 100% 100%, rgba(230,180,58,.13), transparent 60%), var(--rm-bg);
  background-attachment: fixed; }
[data-bs-theme=dark] .pwr-body { --pwr-soft: #1b231f; --pwr-line: #2b3530; --pwr-ring: rgba(63,168,119,.22); }
.pwr-shell { max-width: 1000px; margin: 0 auto; padding: 1rem 1rem 1.25rem; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pwr-top { width: 100%; max-width: 470px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.pwr-brand { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; color: var(--bs-body-color); text-decoration: none; }
.pwr-logo { flex: none; width: 2.4rem; height: 2.4rem; border-radius: .75rem; display: grid; place-items: center; background: linear-gradient(145deg, #f0c24b, #d99b14); color: #123524; box-shadow: 0 4px 12px rgba(201,138,0,.25); }
.pwr-logo svg { width: 1.3rem; height: 1.3rem; }
.pwr-logo.has-img { background: #fff; padding: .25rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pwr-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pwr-co { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwr-lang { flex: none; display: flex; align-items: center; gap: .4rem; color: var(--rm-ink-2); }
.pwr-lang .form-select { width: auto; max-width: 11rem; border-radius: 999px; font-size: .82rem; background-color: var(--bs-body-bg); }
.pwr-card { width: 100%; max-width: 470px; margin: auto; display: grid; background: var(--bs-body-bg); border: 1px solid var(--pwr-line); border-radius: 1.4rem; overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(18,53,36,.35), 0 2px 6px rgba(0,0,0,.04); }
.pwr-side { display: none; }
.pwr-main { padding: 1.75rem 1.6rem 1.5rem; min-width: 0; }
@media (min-width: 992px) {
  .pwr-top { max-width: 940px; }
  .pwr-card { max-width: 940px; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
  .pwr-side { display: flex; position: relative; color: #eef5f0; padding: 2.5rem 2.25rem;
    background: radial-gradient(520px 320px at 0% 100%, rgba(230,180,58,.28), transparent 65%), repeating-linear-gradient(115deg, rgba(255,255,255,.03) 0 14px, transparent 14px 28px), linear-gradient(160deg, #17432e, #0b2117); }
  .pwr-main { padding: 2.4rem 2.5rem 2rem; }
}
.pwr-side-in { display: flex; flex-direction: column; width: 100%; }
.pwr-side-ic { width: 4rem; height: 4rem; border-radius: 1.1rem; display: grid; place-items: center; font-size: 1.85rem; color: #f0c24b; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.pwr-side h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin: 1.4rem 0 .5rem; }
.pwr-side p { color: #b9cdc1; margin: 0 0 1.5rem; line-height: 1.6; }
.pwr-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.pwr-side li { display: flex; align-items: center; gap: .75rem; color: #d8e5dd; line-height: 1.35; }
.pwr-side li i { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; background: rgba(230,180,58,.14); color: #f0c24b; }
.pwr-seal { margin-top: auto; padding-top: 2rem; display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; color: #b9cdc1; }
.pwr-seal i { color: #7fd1a5; font-size: 1rem; }
/* steps */
.pwr-steps { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; }
.pwr-steps li { flex: 1 1 0; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; color: var(--rm-ink-2); font-size: .74rem; line-height: 1.2; }
.pwr-steps li + li::before { content: ""; position: absolute; top: .9rem; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--pwr-line); }
.pwr-steps li.on::before, .pwr-steps li.done::before { background: var(--rm-primary); }
.pwr-dot { position: relative; z-index: 1; width: 1.85rem; height: 1.85rem; border-radius: 50%; display: grid; place-items: center; background: var(--bs-body-bg); border: 2px solid var(--pwr-line); font-size: .8rem; }
.pwr-dot b { font-weight: 700; }
.pwr-steps li.on { color: var(--rm-primary); font-weight: 700; }
.pwr-steps li.on .pwr-dot { border-color: var(--rm-primary); background: var(--rm-primary); color: #fff; box-shadow: 0 0 0 4px var(--pwr-ring); }
.pwr-steps li.done { color: var(--rm-primary); }
.pwr-steps li.done .pwr-dot { border-color: var(--rm-primary); background: var(--rm-primary-050); color: var(--rm-primary); }
.pwr-lb { max-width: 100%; padding: 0 .2rem; overflow-wrap: anywhere; }
/* heading of a step */
.pwr-head { text-align: center; margin-bottom: 1.35rem; }
.pwr-head h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: .95rem 0 .35rem; }
.pwr-head p { color: var(--rm-ink-2); font-size: .92rem; line-height: 1.55; margin: 0 auto; max-width: 26rem; }
.pwr-badge { width: 4rem; height: 4rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.65rem; background: var(--rm-primary-050); color: var(--rm-primary); box-shadow: 0 0 0 .5rem var(--pwr-soft); }
.pwr-badge.is-done { width: 4.75rem; height: 4.75rem; font-size: 2.3rem; background: var(--rm-primary); color: #fff; box-shadow: 0 0 0 .6rem var(--pwr-ring); }
.pwr-chip { display: inline-flex; align-items: center; gap: .4rem; margin-top: .65rem; padding: .35rem .85rem; border-radius: 999px; background: var(--pwr-soft); border: 1px solid var(--pwr-line); font-weight: 600; font-size: .9rem; max-width: 100%; overflow-wrap: anywhere; }
.pwr-chip.is-ok { background: var(--rm-primary-050); border-color: transparent; color: var(--rm-primary); }
.pwr-dl { margin-top: .55rem !important; font-size: .84rem !important; }
.pwr-dl b { color: var(--bs-body-color); font-variant-numeric: tabular-nums; }
.pwr-who { font-weight: 700; color: var(--bs-body-color) !important; margin-bottom: .2rem !important; }
.pwr-alert { display: flex; align-items: flex-start; gap: .55rem; border-radius: .85rem; padding: .65rem .85rem; font-size: .9rem; margin-bottom: 1.1rem; }
.pwr-alert > i { margin-top: .1rem; }
.pwr-empty { background: var(--rm-accent-050); border: 1px solid rgba(201,138,0,.25); border-radius: 1rem; padding: 1rem 1.1rem; font-size: .9rem; line-height: 1.55; }
/* e-mail / SMS choice */
.pwr-ways { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-bottom: 1.1rem; }
.pwr-way, .pwr-acct { position: relative; margin: 0; cursor: pointer; display: block; }
.pwr-way input, .pwr-acct input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.pwr-way-in { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1rem .6rem .9rem; border: 1.5px solid var(--pwr-line); border-radius: 1rem; background: var(--bs-body-bg); text-align: center; transition: border-color .15s, background-color .15s; }
.pwr-way:hover .pwr-way-in { border-color: var(--rm-primary); }
.pwr-way-ic { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--pwr-soft); color: var(--rm-ink-2); font-size: 1.25rem; transition: background-color .15s, color .15s; }
.pwr-way-tx { display: flex; flex-direction: column; gap: .1rem; min-width: 0; line-height: 1.25; }
.pwr-way-tx b { font-size: .95rem; overflow-wrap: anywhere; }
.pwr-way-tx small { font-size: .76rem; color: var(--rm-ink-2); overflow-wrap: anywhere; }
.pwr-way-ok { position: absolute; top: .5rem; inset-inline-end: .55rem; color: var(--rm-primary); font-size: 1rem; opacity: 0; }
.pwr-way input:checked + .pwr-way-in, .pwr-acct input:checked + span { border-color: var(--rm-primary); background: var(--rm-primary-050); }
.pwr-way input:checked + .pwr-way-in .pwr-way-ic { background: var(--rm-primary); color: #fff; }
.pwr-way input:checked + .pwr-way-in .pwr-way-ok, .pwr-acct input:checked + span .pwr-way-ok { opacity: 1; }
.pwr-way input:focus-visible + .pwr-way-in, .pwr-acct input:focus-visible + span { outline: 2px solid var(--rm-primary); outline-offset: 2px; }
/* fields */
.pwr-field { margin-bottom: 1rem; }
.pwr-field .form-label { font-weight: 600; font-size: .88rem; margin-bottom: .4rem; text-transform: none; letter-spacing: normal; color: var(--bs-body-color); }
.pwr-inp { position: relative; }
.pwr-inp > i { position: absolute; top: 50%; inset-inline-start: 1rem; transform: translateY(-50%); color: var(--rm-ink-2); pointer-events: none; z-index: 1; }
.pwr-inp .form-control { height: 3.25rem; border-radius: .85rem; padding-inline-start: 2.75rem; font-size: 1.02rem; border: 1.5px solid var(--pwr-line); background-color: var(--bs-body-bg); }
.pwr-inp .form-control:focus { border-color: var(--rm-primary); box-shadow: 0 0 0 .25rem var(--pwr-ring); }
.pwr-inp .form-control.is-invalid { border-color: #d64545; background-image: none; }
.pwr-inp:has(.pwr-eye) .form-control { padding-inline-end: 3.1rem; }
.pwr-eye { position: absolute; top: 50%; inset-inline-end: .4rem; transform: translateY(-50%); width: 2.5rem; height: 2.5rem; border: 0; border-radius: .65rem; background: transparent; color: var(--rm-ink-2); display: grid; place-items: center; }
.pwr-eye:hover, .pwr-eye:focus-visible { background: var(--pwr-soft); color: var(--rm-primary); }
.pwr-btn { width: 100%; min-height: 3.25rem; border-radius: .85rem; font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .35rem; box-shadow: 0 10px 22px -12px rgba(29,107,71,.7); }
.pwr-btn.btn-outline-primary { box-shadow: none; }
.pwr-btn .pwr-go { font-size: 1.5rem; line-height: 1; margin-inline-start: -.2rem; }
[dir=rtl] .pwr-go, [dir=rtl] .pwr-back i { transform: scaleX(-1); }
.pwr-note { display: flex; gap: .55rem; align-items: flex-start; margin-top: 1rem; padding: .65rem .8rem; border-radius: .75rem; background: var(--pwr-soft); font-size: .82rem; color: var(--rm-ink-2); line-height: 1.5; }
.pwr-note i { margin-top: .1rem; }
/* the 1-minute clock */
.pwr-ring { position: relative; width: 7rem; height: 7rem; margin: 0 auto; }
.pwr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pwr-ring circle { fill: none; stroke-width: 8; }
.pwr-ring-trk { stroke: var(--pwr-soft); }
.pwr-ring-val { stroke: var(--rm-primary); stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .25s linear, stroke .2s; }
.pwr-ring-tx { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; text-align: center; padding: 1rem; }
.pwr-ring-tx b { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: var(--rm-primary); }
.pwr-ring-tx small { font-size: .66rem; color: var(--rm-ink-2); line-height: 1.15; max-width: 5rem; overflow-wrap: anywhere; }
.pwr-ring.is-low .pwr-ring-val { stroke: #e0a100; }
.pwr-ring.is-low .pwr-ring-tx b { color: #b46b00; }
.pwr-ring.is-over .pwr-ring-trk { stroke: #fbe3e3; }
.pwr-ring.is-over .pwr-ring-val { stroke: transparent; }
.pwr-ring.is-over .pwr-ring-tx b { color: #c03030; }
.pwr-ring.is-over .pwr-ring-tx small { color: #c03030; font-weight: 600; }
[data-bs-theme=dark] .pwr-ring.is-over .pwr-ring-trk { stroke: #3a1d1d; }
[data-bs-theme=dark] .pwr-ring.is-over .pwr-ring-tx b, [data-bs-theme=dark] .pwr-ring.is-over .pwr-ring-tx small { color: #ff9b9b; }
.pwr-otp { display: flex; justify-content: center; gap: .5rem; margin-bottom: 1rem; }
.pwr-box { flex: 1 1 0; min-width: 0; max-width: 3.3rem; height: 3.7rem; padding: 0; text-align: center; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: .8rem; border: 1.5px solid var(--pwr-line); caret-color: var(--rm-primary); }
.pwr-box:focus { border-color: var(--rm-primary); box-shadow: 0 0 0 .25rem var(--pwr-ring); }
.pwr-box.has { border-color: var(--rm-primary); background: var(--rm-primary-050); color: var(--rm-primary); }
.pwr-box:disabled { background: var(--pwr-soft); opacity: .7; }
.pwr-in { font-variant-numeric: tabular-nums; font-weight: 400; }
[data-pwr-resend] .pwr-btn { margin-top: .6rem; }
.pwr-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 1.1rem; font-size: .84rem; color: var(--rm-ink-2); }
.pwr-links a, .pwr-links > span { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; }
.pwr-links a:hover { text-decoration: underline; }
/* accounts */
.pwr-accts { display: grid; gap: .5rem; }
.pwr-acct > span { position: relative; display: flex; align-items: center; gap: .65rem; padding: .6rem 2.2rem .6rem .75rem; padding-inline: .75rem 2.2rem; border: 1.5px solid var(--pwr-line); border-radius: .9rem; min-width: 0; }
.pwr-acct .pwr-way-ok { top: 50%; transform: translateY(-50%); }
.pwr-acct.one { cursor: default; margin-bottom: 1rem; }
.pwr-acct.one > span { background: var(--pwr-soft); border-color: transparent; }
.pwr-acct-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pwr-acct-tx b, .pwr-acct-tx small { overflow-wrap: anywhere; }
.pwr-acct-tx small { color: var(--rm-ink-2); }
/* password checks */
.pwr-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .55rem; }
.pwr-meter i { height: 5px; border-radius: 99px; background: var(--pwr-soft); transition: background-color .2s; }
.pwr-meter i.on.s1 { background: #d64545; } .pwr-meter i.on.s2 { background: #e0a100; }
.pwr-meter i.on.s3 { background: #4f9d5d; } .pwr-meter i.on.s4 { background: #1d7a3f; }
.pwr-strength { font-size: .8rem; color: var(--rm-ink-2); margin-top: .3rem; min-height: 1.2em; }
.pwr-rules { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.pwr-rules li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--pwr-soft); font-size: .78rem; color: var(--rm-ink-2); }
.pwr-rules li.ok { background: var(--rm-primary-050); color: var(--rm-primary); font-weight: 600; }
.pwr-done { margin: .75rem 0 1.5rem; }
.pwr-back { text-align: center; margin-top: 1.35rem; font-size: .88rem; }
.pwr-back a { display: inline-flex; align-items: center; gap: .15rem; text-decoration: none; font-weight: 600; }
.pwr-back a:hover { text-decoration: underline; }
.pwr-ver { text-align: center; font-size: .78rem; color: var(--rm-ink-2); margin: 1rem 0 0; }
@media (max-width: 420px) {
  .pwr-shell { padding: .75rem .75rem 1rem; }
  .pwr-main { padding: 1.35rem 1.05rem 1.2rem; }
  .pwr-card { border-radius: 1.15rem; }
  .pwr-co { font-size: .92rem; }
  .pwr-lang .form-select { max-width: 8.5rem; }
  .pwr-lang > i { display: none; }
  .pwr-head h2 { font-size: 1.28rem; }
  .pwr-ways { gap: .45rem; }
  .pwr-way-in { padding: .85rem .4rem .75rem; }
  .pwr-otp { gap: .32rem; }
  .pwr-box { height: 3.2rem; font-size: 1.4rem; border-radius: .65rem; }
  .pwr-ring { width: 6.25rem; height: 6.25rem; }
}

/* ---------- v1.51.2 Mobile number with a country code ---------- */
.ph-field { position: relative; }
.ph-group { display: flex; align-items: stretch; }
.ph-cc { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-width: 6.6rem; padding: 0 .6rem; border: var(--bs-border-width) solid var(--bs-border-color); border-right: 0;
  border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius); background: var(--bs-tertiary-bg); color: var(--bs-body-color); font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-cc:hover { background: var(--rm-primary-050); }
.ph-cc .ph-iso { font-size: .66rem; font-weight: 700; letter-spacing: .03em; padding: .1rem .3rem; border-radius: .3rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); }
.ph-cc .bi { margin-left: auto; font-size: .68rem; opacity: .6; }
.ph-group .ph-num { flex: 1 1 auto; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ph-field.is-open .ph-cc, .ph-cc:focus-visible { position: relative; z-index: 2; border-color: var(--rm-primary); border-right: var(--bs-border-width) solid var(--rm-primary); outline: none; box-shadow: 0 0 0 .2rem rgba(29,107,71,.15); }
.ph-field.is-bad .ph-num { border-color: #d64545; }
.ph-hint { font-size: .8rem; margin-top: .3rem; color: var(--rm-ink-2); line-height: 1.4; }
.ph-hint:empty { display: none; }
.ph-field.is-ok .ph-hint { color: var(--rm-primary); }
.ph-field.is-bad .ph-hint { color: #c03030; }
[data-bs-theme=dark] .ph-field.is-bad .ph-hint { color: #ff9b9b; }
.ph-menu { position: absolute; z-index: 1070; top: calc(100% + 4px); inset-inline-start: 0; width: min(22rem, 100%); padding: .4rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .8rem; box-shadow: 0 16px 36px -14px rgba(0,0,0,.35); }
.ph-menu.up { top: auto; bottom: calc(100% + 4px); }
.ph-find { position: relative; margin-bottom: .35rem; }
.ph-find i { position: absolute; top: 50%; inset-inline-start: .65rem; transform: translateY(-50%); font-size: .8rem; color: var(--rm-ink-2); pointer-events: none; }
.ph-find .form-control { padding-inline-start: 1.95rem; border-radius: .55rem; }
.ph-list { max-height: 15.5rem; overflow-y: auto; overscroll-behavior: contain; }
.ph-row { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .42rem .5rem; border: 0; border-radius: .5rem; background: transparent; color: var(--bs-body-color); text-align: start; font-size: .88rem; }
.ph-row:hover, .ph-row:focus { background: var(--rm-primary-050); outline: none; }
.ph-row.on { background: var(--rm-primary-050); color: var(--rm-primary); font-weight: 600; }
.ph-row .ph-iso { flex: none; width: 2.15rem; padding: .1rem 0; border-radius: .3rem; background: var(--bs-tertiary-bg); text-align: center; font-size: .66rem; font-weight: 700; }
.ph-row .ph-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-row .ph-dl { flex: none; color: var(--rm-ink-2); font-variant-numeric: tabular-nums; }
.ph-sep { height: 1px; margin: .3rem .25rem; background: var(--bs-border-color); }
.ph-none { padding: .7rem; text-align: center; font-size: .85rem; color: var(--rm-ink-2); }
/* the forgot password page: as big as its other fields */
.pwr-field .ph-cc { min-width: 7rem; min-height: 3.25rem; border: 1.5px solid var(--pwr-line); border-right: 0; border-radius: .85rem 0 0 .85rem; background: var(--pwr-soft); font-size: 1rem; }
.pwr-field .ph-num { height: 3.25rem; border: 1.5px solid var(--pwr-line); border-radius: 0 .85rem .85rem 0; font-size: 1.02rem; background-color: var(--bs-body-bg); }
.pwr-field .ph-num:focus { border-color: var(--rm-primary); box-shadow: 0 0 0 .25rem var(--pwr-ring); }
.pwr-field .ph-field.is-open .ph-cc { border-right: 1.5px solid var(--rm-primary); }
.pwr-field .ph-field.is-bad .ph-num { border-color: #d64545; }
.pwr-field .ph-menu { width: 100%; }
.ph-iso::before { content: attr(data-c); }

/* =========================================================
   v1.52 — Daily notes (sticky notes, steps, photos, reminders)
   ========================================================= */
.nc-red { --nc-bg: #faafa8; } .nc-orange { --nc-bg: #f39f76; } .nc-yellow { --nc-bg: #fff8b8; } .nc-green { --nc-bg: #e2f6d3; }
.nc-teal { --nc-bg: #b4ddd3; } .nc-lblue { --nc-bg: #d4e4ed; } .nc-blue { --nc-bg: #aeccdc; } .nc-purple { --nc-bg: #d3bfdb; }
.nc-pink { --nc-bg: #f6e2dd; } .nc-brown { --nc-bg: #e9e3d4; } .nc-grey { --nc-bg: #efeff1; }
[data-bs-theme="dark"] .nc-red { --nc-bg: #77172e; } [data-bs-theme="dark"] .nc-orange { --nc-bg: #692b17; } [data-bs-theme="dark"] .nc-yellow { --nc-bg: #7c4a03; }
[data-bs-theme="dark"] .nc-green { --nc-bg: #264d3b; } [data-bs-theme="dark"] .nc-teal { --nc-bg: #0c625d; } [data-bs-theme="dark"] .nc-lblue { --nc-bg: #256377; }
[data-bs-theme="dark"] .nc-blue { --nc-bg: #284255; } [data-bs-theme="dark"] .nc-purple { --nc-bg: #472e5b; } [data-bs-theme="dark"] .nc-pink { --nc-bg: #6c394f; }
[data-bs-theme="dark"] .nc-brown { --nc-bg: #4b443a; } [data-bs-theme="dark"] .nc-grey { --nc-bg: #3c3f43; }

.nk-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.nk-side { position: sticky; top: 76px; }
.nk-views { display: flex; flex-direction: column; gap: .15rem; }
.nk-viewlink, .nk-catlink { display: flex; align-items: center; gap: .65rem; padding: .5rem .85rem; border-radius: 999px; color: var(--rm-ink); text-decoration: none; border: 0; background: transparent; font-size: .9rem; text-align: start; width: 100%; }
.nk-viewlink:hover, .nk-catlink:hover { background: color-mix(in srgb, var(--rm-ink) 7%, transparent); color: var(--rm-ink); }
.nk-viewlink.on, .nk-catlink.on { background: var(--rm-accent-050); color: var(--rm-ink); font-weight: 600; }
.nk-viewlink.on i, .nk-catlink.on i { color: var(--rm-accent); }
.nk-viewlink b, .nk-catlink b { margin-inline-start: auto; font-weight: 500; font-size: .75rem; color: var(--rm-ink-2); }
.nk-viewlink > span, .nk-catlink > span:not(.nk-catdot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-side-h { display: flex; align-items: center; justify-content: space-between; margin: 1rem .85rem .25rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--rm-ink-2); }
.nk-side-h .btn { font-size: .75rem; text-transform: none; letter-spacing: 0; }
.nk-cats { display: flex; flex-direction: column; gap: .1rem; }
.nk-catdot { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; background: var(--nc-bg, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rm-ink) 30%, transparent); }
.nk-notify-btn { margin-top: 1rem; width: 100%; border: 1px dashed var(--rm-line); background: transparent; border-radius: 12px; padding: .5rem .75rem; font-size: .8rem; color: var(--rm-ink-2); text-align: start; }
.nk-notify-btn:hover { border-color: var(--rm-primary); color: var(--rm-primary); }
.nk-main { min-width: 0; }
.nk-composer { display: flex; align-items: center; gap: .25rem; max-width: 620px; margin: 0 auto 1rem; padding: .3rem .4rem .3rem .3rem; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06); }
.nk-composer .form-control { border: 0; box-shadow: none; background: transparent; font-weight: 500; }
.nk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.nk-search { position: relative; flex: 1 1 260px; min-width: 0; }
.nk-search > i { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); color: var(--rm-ink-2); pointer-events: none; }
.nk-search .form-control { padding-inline-start: 2.35rem; padding-inline-end: 2.2rem; border-radius: 999px; }
.nk-x { position: absolute; inset-inline-end: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--rm-ink-2); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.nk-x:hover { background: color-mix(in srgb, var(--rm-ink) 8%, transparent); }
.nk-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.nk-filters .form-select { width: auto; max-width: 190px; }
.nk-colorf { padding: .2rem .45rem; }
.nk-sec-h { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--rm-ink-2); margin: .25rem .25rem .5rem; }
.nk-sec + .nk-sec { margin-top: .75rem; }
.nk-grid { columns: 240px; column-gap: 1rem; }
.nk-card { break-inside: avoid; display: block; position: relative; margin-bottom: 1rem; background: var(--nc-bg, var(--rm-surface)); border: 1px solid var(--rm-line); border-radius: 10px; cursor: pointer; transition: box-shadow .15s; }
.nk-card:not(.nc-default) { border-color: transparent; }
.nk-card:hover, .nk-card:focus-visible { box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 4px 10px rgba(0,0,0,.08); outline: 0; }
.nk-card.flash { box-shadow: 0 0 0 3px var(--rm-accent); }
.nk-card[hidden] { display: none; }
.nk-pin { position: absolute; top: .3rem; inset-inline-end: .3rem; z-index: 2; border: 0; width: 32px; height: 32px; border-radius: 50%; background: transparent; color: var(--rm-ink-2); opacity: 0; transition: opacity .15s; }
.nk-card:hover .nk-pin, .nk-card:focus-within .nk-pin, .nk-card.is-pinned .nk-pin { opacity: 1; }
.nk-card.is-pinned .nk-pin { color: var(--rm-ink); }
.nk-pin:hover { background: color-mix(in srgb, var(--rm-ink) 9%, transparent); }
.nk-imgs { display: grid; gap: 2px; border-radius: 9px 9px 0 0; overflow: hidden; }
.nk-imgs.n2, .nk-imgs.n4 { grid-template-columns: 1fr 1fr; } .nk-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.nk-img { position: relative; display: block; background: color-mix(in srgb, var(--rm-ink) 6%, transparent); }
.nk-img img { width: 100%; display: block; object-fit: cover; aspect-ratio: 1; }
.nk-imgs.n1 .nk-img img { aspect-ratio: auto; max-height: 280px; }
.nk-img b { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 1.2rem; }
.nk-body { padding: .7rem .9rem .2rem; }
.nk-title { font-size: 1rem; font-weight: 600; margin: 0 0 .3rem; padding-inline-end: 1.7rem; overflow-wrap: anywhere; line-height: 1.35; }
.nk-imgs + .nk-body .nk-title { padding-inline-end: 0; }
.nk-text { font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 12; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .3rem; }
.nk-prog { display: flex; align-items: center; gap: .45rem; margin: .25rem 0 .2rem; font-size: .72rem; color: var(--rm-ink-2); }
.nk-bar { position: relative; }
.nk-prog .nk-bar { flex: 1 1 auto; height: 5px; border-radius: 9px; background: color-mix(in srgb, var(--rm-ink) 12%, transparent); overflow: hidden; margin: 0; display: block; }
.nk-prog .nk-bar i { display: block; height: 100%; background: var(--rm-primary); border-radius: 9px; }
.nk-prog.all .nk-bar i { background: #2e9e5b; }
.nk-alldone { color: #2e9e5b; font-weight: 600; white-space: nowrap; }
.nk-list { list-style: none; padding: 0; margin: .15rem 0 .2rem; }
.nk-it { display: flex; align-items: flex-start; gap: .3rem; font-size: .88rem; padding: .1rem 0; line-height: 1.4; }
.nk-chk { border: 0; background: transparent; padding: .05rem 0 0; line-height: 1; font-size: 1.02rem; color: var(--rm-ink-2); cursor: pointer; flex: 0 0 auto; }
.nk-chk:hover { color: var(--rm-ink); }
.nk-no { color: var(--rm-ink-2); font-size: .72rem; min-width: 1.15rem; padding-top: .12rem; flex: 0 0 auto; }
.nk-itx { min-width: 0; overflow-wrap: anywhere; }
.nk-it.done .nk-itx { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .6; }
.nk-it.done .nk-chk { color: var(--rm-primary); }
.nk-it.next .nk-itx { font-weight: 600; }
.nk-nexttag { margin-inline-start: auto; align-self: center; font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--rm-accent); color: #fff; border-radius: 999px; padding: .08rem .45rem; white-space: nowrap; }
.nk-more { font-size: .75rem; color: var(--rm-ink-2); padding-inline-start: 1.5rem; }
.nk-meta { display: flex; flex-wrap: wrap; gap: .3rem; padding: .2rem .9rem .35rem; font-size: .72rem; align-items: center; }
.nk-chip { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid color-mix(in srgb, var(--rm-ink) 16%, transparent); border-radius: 999px; padding: .05rem .5rem; background: color-mix(in srgb, var(--rm-surface) 40%, transparent); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-rem { cursor: pointer; }
.nk-rem.due { color: #b3261e; border-color: currentColor; font-weight: 600; }
[data-bs-theme="dark"] .nk-rem.due { color: #f2b8b5; }
.nk-time { color: var(--rm-ink-2); }
.nk-tools { display: flex; flex-wrap: wrap; gap: .05rem; padding: 0 .35rem .35rem; opacity: 0; transition: opacity .15s; }
.nk-card:hover .nk-tools, .nk-card:focus-within .nk-tools { opacity: 1; }
.nk-tb { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--rm-ink-2); padding: 0; cursor: pointer; }
.nk-tb:hover, .nk-tb:focus-visible { background: color-mix(in srgb, var(--rm-ink) 9%, transparent); color: var(--rm-ink); }
.nk-tb:has(> span) { width: auto; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .7rem; border-radius: 999px; font-size: .8rem; }
.nk-dd { display: inline-block; }
.nk-palette { min-width: 0; }
.nk-palette.show, .nk-palette:not(.dropdown-menu) { display: grid; grid-template-columns: repeat(6, 28px); gap: .4rem; }
.nk-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--nc-bg, var(--rm-surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rm-ink) 18%, transparent); padding: 0; display: inline-grid; place-items: center; color: var(--rm-ink-2); font-size: .8rem; cursor: pointer; }
.nk-dot.on { border-color: var(--rm-primary); box-shadow: inset 0 0 0 1px var(--rm-surface); }
.nk-dot:hover { border-color: var(--rm-ink-2); }
.nk-empty { text-align: center; color: var(--rm-ink-2); padding: 3rem 1rem; max-width: 520px; margin: 0 auto; }
.nk-empty > i { display: block; font-size: 3.2rem; opacity: .3; margin-bottom: .5rem; }
.nk-found { margin: -.25rem 0 .5rem; }
/* the editor */
.nk-editor { background: var(--nc-bg, var(--rm-surface)); border: 0; }
.nk-editor .modal-body { padding: 1rem 1.1rem .5rem; }
.nk-ed-top { display: flex; align-items: center; gap: .5rem; }
.nk-ed-title, .nk-ed-body { border: 0; background: transparent; width: 100%; outline: 0; color: inherit; }
.nk-ed-title { font-size: 1.15rem; font-weight: 600; padding: .25rem 0; }
.nk-ed-body { resize: none; font-size: .95rem; line-height: 1.55; padding: .35rem 0; min-height: 70px; }
.nk-ed-title::placeholder, .nk-ed-body::placeholder, .nk-ed-add input::placeholder { color: color-mix(in srgb, var(--rm-ink) 50%, transparent); }
.nk-ed-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .4rem; margin-bottom: .6rem; }
.nk-ed-img { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: color-mix(in srgb, var(--rm-ink) 7%, transparent); }
.nk-ed-img img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.nk-ed-img small { position: absolute; bottom: 4px; inset-inline-start: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: .62rem; border-radius: 6px; padding: 0 .3rem; }
.nk-mini { border: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--rm-ink) 7%, transparent); color: inherit; font-size: .72rem; padding: 0; cursor: pointer; }
.nk-mini:hover { background: color-mix(in srgb, var(--rm-ink) 15%, transparent); }
.nk-ed-img .nk-mini { position: absolute; top: 4px; inset-inline-end: 4px; background: rgba(0,0,0,.55); color: #fff; }
.nk-ed-steps { border-top: 1px solid color-mix(in srgb, var(--rm-ink) 12%, transparent); margin-top: .4rem; padding-top: .5rem; }
.nk-ed-steps-h { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .85rem; margin-bottom: .2rem; }
.nk-ed-steps-h .btn { font-weight: 400; font-size: .78rem; }
.nk-ed-prog { font-weight: 500; color: var(--rm-ink-2); font-size: .78rem; }
.nk-ed-items { list-style: none; padding: 0; margin: 0; }
.nk-ed-it { display: flex; align-items: center; gap: .3rem; padding: .1rem 0; border-radius: 6px; }
.nk-ed-it.drag { opacity: .45; }
.nk-ed-it.next .nk-ed-itx { font-weight: 600; }
.nk-ed-handle { cursor: grab; color: var(--rm-ink-2); opacity: .45; flex: 0 0 auto; }
.nk-ed-it:hover .nk-ed-handle { opacity: .9; }
.nk-ed-itx { flex: 1 1 auto; min-width: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: inherit; padding: .25rem .1rem; outline: 0; font-size: .93rem; }
.nk-ed-itx:focus { border-bottom-color: color-mix(in srgb, var(--rm-ink) 25%, transparent); }
.nk-ed-it.done .nk-ed-itx { text-decoration: line-through; opacity: .6; }
.nk-ed-it.done .nk-chk { color: var(--rm-primary); }
.nk-ed-itools { display: flex; gap: .15rem; opacity: 0; flex: 0 0 auto; }
.nk-ed-it:hover .nk-ed-itools, .nk-ed-it:focus-within .nk-ed-itools { opacity: 1; }
.nk-ed-add { display: flex; align-items: center; gap: .5rem; padding: .2rem 0 .2rem 1.35rem; color: var(--rm-ink-2); }
.nk-ed-add input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: inherit; outline: 0; padding: .3rem 0; }
.nk-ed-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.nk-ed-opts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.nk-ed-opt { display: flex; align-items: center; gap: .35rem; margin: 0; }
.nk-ed-opt .form-select, .nk-ed-opts .form-control { width: auto; max-width: 230px; }
.nk-ed-rembtn.on { background: var(--rm-accent-050); border-color: var(--rm-accent) !important; font-weight: 600; }
.nk-ed-rem { margin-top: .55rem; padding: .65rem; border-radius: 12px; background: color-mix(in srgb, var(--rm-ink) 5%, transparent); }
.nk-ed-rem-presets, .nk-ed-rem-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-ed-rem-row { margin-top: .5rem; }
.nk-ed-rem-row .form-control, .nk-ed-rem-row .form-select { width: auto; max-width: 100%; }
.nk-ed-meta { margin-top: .65rem; color: var(--rm-ink-2); }
.nk-ed-foot { justify-content: flex-start; gap: .1rem; flex-wrap: wrap; border-top: 0; background: transparent; padding: .4rem .6rem .7rem; }
.nk-ed-status { margin-inline-start: .4rem; color: var(--rm-ink-2); }
.nk-editor .dropdown-menu { background: var(--rm-surface); }
/* a photo in full, the small messages, the reminder pop-up */
.nk-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.nk-lightbox[hidden] { display: none; }
.nk-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 6px; }
.nk-lb-x { position: absolute; top: .75rem; inset-inline-end: .75rem; border: 0; background: rgba(255,255,255,.15); color: #fff; width: 40px; height: 40px; border-radius: 50%; }
.nk-toast { position: fixed; left: 50%; bottom: 1.25rem; z-index: 2100; transform: translate(-50%, 160%); transition: transform .2s; background: #323232; color: #fff; border-radius: 10px; padding: .55rem .9rem; display: flex; align-items: center; gap: .75rem; font-size: .88rem; max-width: calc(100vw - 2rem); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.nk-toast.on { transform: translate(-50%, 0); }
.nk-toast .btn-link { color: #8ab4f8; padding: 0; font-weight: 600; text-decoration: none; }
.rm-rem-pop { position: fixed; bottom: 1rem; inset-inline-end: 1rem; z-index: 2050; display: flex; flex-direction: column; gap: .5rem; width: min(360px, calc(100vw - 2rem)); }
.rm-rem { display: flex; align-items: center; gap: .65rem; background: var(--rm-surface); border: 1px solid var(--rm-line); border-inline-start: 4px solid var(--rm-accent); border-radius: 12px; padding: .65rem .75rem; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.rm-rem > .bi { font-size: 1.5rem; color: var(--rm-accent); }
.rm-rem-tx { flex: 1 1 auto; min-width: 0; }
.rm-rem-tx b, .rm-rem-tx span, .rm-rem-tx small { display: block; }
.rm-rem-tx b { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rm-accent); }
.rm-rem-tx span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-rem-tx small { color: var(--rm-ink-2); }
@media (hover: none) {
  .nk-tools { opacity: .9; }
  .nk-pin { opacity: .75; }
  .nk-ed-itools { opacity: .85; }
  .nk-ed-handle { display: none; }
}
@media (max-width: 991.98px) {
  .nk-wrap { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .nk-side { position: static; }
  .nk-views, .nk-cats { flex-direction: row; overflow-x: auto; gap: .35rem; padding-bottom: .3rem; scrollbar-width: thin; }
  .nk-viewlink, .nk-catlink { width: auto; flex: 0 0 auto; border: 1px solid var(--rm-line); background: var(--rm-surface); padding: .35rem .75rem; font-size: .84rem; }
  .nk-viewlink b, .nk-catlink b { margin-inline-start: .2rem; }
  .nk-side-h { margin: .4rem .2rem .2rem; }
  .nk-notify-btn { margin-top: .3rem; }
}
@media (max-width: 767.98px) {
  .nk-grid { columns: 2; column-gap: .6rem; }
  .nk-card { margin-bottom: .6rem; }
  .nk-body { padding: .6rem .7rem .15rem; }
  .nk-meta { padding: .15rem .7rem .3rem; }
  .nk-tb { width: 32px; height: 32px; }
  .nk-filters .form-select { max-width: none; flex: 1 1 130px; }
}
@media (max-width: 459.98px) {
  .nk-grid { columns: 1; }
  .nk-ed-foot .btn { padding-inline: .7rem; }
}
.nk-ed-foot .btn { white-space: nowrap; }
body.modal-open .fs-btn { display: none; }
@media (max-width: 459.98px) { .nk-ed-foot .nk-tb { width: 32px; } .nk-ed-foot { gap: 0; padding-inline: .35rem; } .nk-ed-status { display: none; } }


/* =========================================================
   v1.52 — Contact book (drivers, mistri, outside workers)
   ========================================================= */
.ct-groups { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: .75rem; scrollbar-width: thin; }
.ct-gchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--rm-line); background: var(--rm-surface); border-radius: 999px; padding: .4rem .85rem; font-size: .86rem; color: var(--rm-ink); }
.ct-gchip b { font-weight: 600; font-size: .72rem; background: color-mix(in srgb, var(--rm-ink) 8%, transparent); border-radius: 999px; padding: 0 .45rem; }
.ct-gchip:hover { border-color: var(--rm-primary); }
.ct-gchip.on { background: var(--rm-primary); border-color: var(--rm-primary); color: #fff; }
.ct-gchip.on b { background: rgba(255,255,255,.22); }
.ct-searchbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .45rem; }
.ct-search { position: relative; flex: 1 1 340px; min-width: 0; }
.ct-search > .bi-search { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); color: var(--rm-ink-2); pointer-events: none; font-size: 1.05rem; }
.ct-search .form-control { padding-inline-start: 2.7rem; padding-inline-end: 2.4rem; border-radius: 14px; font-size: 1rem; }
.ct-search .nk-x { inset-inline-end: .6rem; }
.ct-pop { position: absolute; top: calc(100% + 5px); inset-inline: 0; z-index: 1060; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 14px; max-height: min(62vh, 520px); overflow-y: auto; padding: .3rem; }
.ct-ph { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--rm-ink-2); padding: .45rem .6rem .2rem; }
.ct-pi { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 10px; cursor: pointer; }
.ct-pi:hover, .ct-pi.on { background: var(--rm-primary-050); }
.ct-pi-ava { position: relative; flex: 0 0 auto; }
.ct-pi-ava .ava { --s: 40px; }
.ct-pi-ava .ct-verified { font-size: .8rem; }
.ct-pi-tx { flex: 1 1 auto; min-width: 0; }
.ct-pi-tx b, .ct-pi-tx small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-pi-tx small { color: var(--rm-ink-2); }
.ct-pi-btns { display: flex; gap: .25rem; flex: 0 0 auto; }
.ct-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.ct-filters .form-select { width: auto; max-width: 200px; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: .8rem; }
.ct-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: start; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--rm-radius); padding: .8rem; transition: box-shadow .15s, border-color .15s; }
.ct-card:hover { border-color: color-mix(in srgb, var(--rm-primary) 40%, var(--rm-line)); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.ct-card[hidden] { display: none; }
.ct-card.is-off { opacity: .62; }
.ct-ava { position: relative; display: block; }
.ct-ava .ava { --s: 56px; }
.ct-verified { position: absolute; bottom: -2px; inset-inline-end: -3px; color: #1a73e8; background: var(--rm-surface); border-radius: 50%; line-height: 1; font-size: 1.05rem; }
.ct-name { display: block; font-weight: 600; color: var(--rm-ink); text-decoration: none; overflow-wrap: anywhere; line-height: 1.3; }
.ct-name:hover { color: var(--rm-primary); }
.ct-sub { display: flex; flex-wrap: wrap; gap: .15rem .55rem; font-size: .78rem; color: var(--rm-ink-2); margin-top: .1rem; }
.ct-grp { color: var(--rm-primary); font-weight: 500; }
.ct-phone, .ct-addr { font-size: .8rem; color: var(--rm-ink-2); margin-top: .15rem; overflow-wrap: anywhere; }
.ct-phone { text-align: start; }
.ct-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin-top: .4rem; font-size: .76rem; color: var(--rm-ink-2); }
.ct-btns { display: flex; flex-direction: column; gap: .35rem; }
.ct-btns .btn, .ct-pi-btns .btn, .ct-node-btns .btn { display: inline-grid; place-items: center; min-width: 36px; height: 34px; padding: 0 .45rem; }
.ct-wa, .ct-wa:hover, .ct-wa:focus { background: #25d366; border-color: #25d366; color: #fff; }
.ct-wa:hover { background: #1eb457; }
.ct-call2 { position: relative; }
.ct-call2 small { position: absolute; bottom: 1px; inset-inline-end: 3px; font-size: .58rem; font-weight: 700; }
.ct-stars { display: inline-flex; align-items: center; gap: 1px; color: #f4b400; white-space: nowrap; }
.ct-stars b { color: var(--rm-ink); margin-inline-start: .3rem; font-size: .85em; }
.ct-stars small { color: var(--rm-ink-2); margin-inline-start: .15rem; }
.ct-stars.sm { font-size: .75rem; }
.ct-starin { display: inline-flex; align-items: center; gap: .1rem; }
.ct-starin label { cursor: pointer; font-size: 1.55rem; color: color-mix(in srgb, var(--rm-ink) 22%, transparent); line-height: 1; padding: 0 .05rem; }
.ct-starin label.on { color: #f4b400; }
.ct-starin .ct-star0 { font-size: 1rem; margin-inline-start: .4rem; color: var(--rm-ink-2); }
.ct-starin input:focus-visible + label { outline: 2px solid var(--rm-primary); border-radius: 4px; }
.ct-fbform { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ct-fbform .form-control { flex: 1 1 220px; width: auto; }
.ct-profile .card-body { padding-bottom: .9rem; }
.ct-pava { position: relative; display: inline-block; }
.ct-pava .ct-verified { font-size: 1.6rem; bottom: 4px; inset-inline-end: 4px; }
.ct-verline { color: #1a73e8; font-size: .85rem; margin: .25rem 0; }
[data-bs-theme="dark"] .ct-verline, [data-bs-theme="dark"] .ct-verified { color: #8ab4f8; }
.ct-bigbtns { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .8rem; }
.ct-bigbtns .btn { padding: .5rem 1rem; font-size: .95rem; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.ct-bigbtns .ct-call2 { min-width: 0; }
.ct-facts .list-group-item { display: grid; grid-template-columns: 1.3rem minmax(90px, 8rem) minmax(0, 1fr); gap: .4rem; align-items: start; font-size: .86rem; }
.ct-facts .list-group-item > span { color: var(--rm-ink-2); }
.ct-facts .list-group-item > b { font-weight: 500; overflow-wrap: anywhere; }
.ct-grow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--rm-line); }
.ct-grow input[name=name] { flex: 1 1 180px; width: auto; }
.ct-grow .form-select { width: auto; }
.ct-grow .ct-sortin { width: 72px; }
.ct-grow-new { border-bottom: 0; }
.ct-icons.show { display: grid; grid-template-columns: repeat(6, 36px); gap: .25rem; }
.ct-icon { margin: 0; }
.ct-icon input { position: absolute; opacity: 0; pointer-events: none; }
.ct-icon i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; }
.ct-icon input:checked + i { border-color: var(--rm-primary); background: var(--rm-primary-050); color: var(--rm-primary); }
.ct-icon i:hover { background: color-mix(in srgb, var(--rm-ink) 7%, transparent); }
.ct-treebar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.ct-treesearch { flex: 1 1 240px; max-width: 420px; }
.ct-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.ct-tr, .ct-tr ul { list-style: none; margin: 0; padding: 0; }
.ct-tr ul { padding-inline-start: 1.35rem; margin-inline-start: .95rem; border-inline-start: 2px solid var(--rm-line); }
.ct-tr li { position: relative; padding: .3rem 0; }
.ct-tr ul > li::before { content: ""; position: absolute; inset-inline-start: -1.35rem; top: 1.5rem; width: 1.15rem; border-top: 2px solid var(--rm-line); }
.ct-node { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 12px; padding: .35rem .5rem; transition: opacity .15s, box-shadow .15s; }
.ct-node.hit { border-color: var(--rm-accent); box-shadow: 0 0 0 3px var(--rm-accent-050); }
.ct-tree.searching .ct-node:not(.hit) { opacity: .4; }
.ct-node.is-off { opacity: .6; }
.ct-node-a { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; min-width: 0; flex: 1 1 150px; }
.ct-node-tx { min-width: 0; }
.ct-node-tx b { overflow-wrap: anywhere; }
.ct-node-tx small { display: block; color: var(--rm-ink-2); font-size: .72rem; overflow-wrap: anywhere; }
.ct-node-btns { display: flex; gap: .25rem; margin-inline-start: auto; }
.ct-node-btns .btn { min-width: 32px; height: 30px; }
.ct-rel { color: var(--rm-ink-2); font-size: .85rem; }
.ct-team { display: flex; flex-direction: column; gap: .4rem; }
.ct-linkrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ct-linkrow .ct-node { flex: 1 1 260px; }
.ct-linkrel { font-size: .74rem; background: var(--rm-primary-050); color: var(--rm-primary); border-radius: 999px; padding: .1rem .6rem; }
@media (max-width: 575.98px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .ct-card { grid-template-columns: auto minmax(0, 1fr); gap: .6rem; padding: .7rem; }
  .ct-btns { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .ct-btns .btn { min-width: 44px; height: 38px; }
  .ct-ava .ava { --s: 50px; }
  .ct-filters .form-select { max-width: none; flex: 1 1 140px; }
  .ct-tr ul { padding-inline-start: .75rem; margin-inline-start: .55rem; }
  .ct-tr ul > li::before { inset-inline-start: -.75rem; width: .6rem; }
  .ct-facts .list-group-item { grid-template-columns: 1.3rem minmax(0, 1fr); }
  .ct-facts .list-group-item > b { grid-column: 2; }
  .ct-pi-btns .btn { min-width: 34px; }
}
.ct-facts b[dir=ltr] { white-space: nowrap; }
.ava > .bi-person-fill { color: #fff; font-size: calc(var(--s) * .5); }

/* =========================================================
   v1.53 — notes: masonry grid + drag, patterns, own colours, text colour, board background,
   formatting bar, style panel, drawing pad, version history, category icons
   ========================================================= */
.nk-grid { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-rows: 4px; column-gap: 14px; align-items: start; }
.nk-grid > .nk-card { margin-bottom: 0; }
.nk-grid:empty { min-height: 0; }
.nk-wrap.is-dragging .nk-grid { min-height: 90px; border-radius: 12px; outline: 2px dashed color-mix(in srgb, var(--rm-primary) 35%, transparent); outline-offset: 4px; }
.nk-wrap.is-dragging, .nk-wrap.is-dragging * { cursor: grabbing !important; user-select: none; }
.nk-card.nk-dragging { opacity: .3; }
.nk-ghost { position: fixed; left: 0; top: 0; z-index: 3000; pointer-events: none; margin: 0 !important; box-shadow: 0 16px 40px rgba(0,0,0,.28) !important; opacity: .95; }
@media (hover: hover) and (pointer: fine) { [data-drag="1"] .nk-card { cursor: grab; } }
/* own colour (one or two colours) */
.nc-custom { --nc-bg: #ffd27a; }
.nk-card.nc-custom, .nk-editor.nc-custom, .nk-vcard.nc-custom { background: var(--nc-bg); border-color: transparent; }
.nk-card[style*="--nc-bg"], .nk-editor[style*="--nc-bg"] { background: var(--nc-bg); }
/* text colour on the note */
.nt-dark, .nt-dark .nk-title, .nt-dark .nk-text, .nt-dark .nk-itx, .nt-dark .nk-ed-title, .nt-dark .nk-ed-body, .nt-dark .nk-ed-itx, .nt-dark .nk-ed-add input { color: #202124; }
.nt-dark .nk-time, .nt-dark .nk-no, .nt-dark .nk-tb, .nt-dark .nk-chk, .nt-dark .nk-pin, .nt-dark .nk-ed-meta, .nt-dark .nk-ed-prog, .nt-dark .nk-more { color: #4a4f55; }
.nt-light, .nt-light .nk-title, .nt-light .nk-text, .nt-light .nk-itx, .nt-light .nk-ed-title, .nt-light .nk-ed-body, .nt-light .nk-ed-itx, .nt-light .nk-ed-add input, .nt-light .nk-ed-steps-h { color: #ffffff; }
.nt-light .nk-time, .nt-light .nk-no, .nt-light .nk-tb, .nt-light .nk-chk, .nt-light .nk-pin, .nt-light .nk-ed-meta, .nt-light .nk-ed-prog, .nt-light .nk-more, .nt-light .nk-ed-steps-h .btn { color: rgba(255,255,255,.8); }
.nt-light .nk-chip { border-color: rgba(255,255,255,.4); background: rgba(0,0,0,.18); color: #fff; }
.nt-light .nk-prog .nk-bar { background: rgba(255,255,255,.25); }
.nt-light .nk-ed-title::placeholder, .nt-light .nk-ed-add input::placeholder { color: rgba(255,255,255,.65); }
.nt-light .nk-ed-body:empty::before { color: rgba(255,255,255,.65); }
.nt-light .nk-text a { color: #cde3ff; }
.nt-light .nk-tb:hover { background: rgba(255,255,255,.15); color: #fff; }
.nt-light .nk-fb { color: #fff; }
/* patterns over the colour */
.nk-card[class*=" np-"], .nk-editor[class*=" np-"], .nk-vcard[class*=" np-"] { position: relative; isolation: isolate; }
.nk-card[class*=" np-"]::before, .nk-editor[class*=" np-"]::before, .nk-vcard[class*=" np-"]::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: .55; }
.np-dots::before { background-image: radial-gradient(color-mix(in srgb, currentColor 45%, transparent) 1.2px, transparent 1.4px); background-size: 14px 14px; }
.np-grid::before { background-image: linear-gradient(color-mix(in srgb, currentColor 18%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, currentColor 18%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.np-lines::before { background-image: linear-gradient(transparent 23px, color-mix(in srgb, #3f7fd6 35%, transparent) 24px); background-size: 100% 24px; background-position: 0 8px; }
.np-diag::before { background-image: repeating-linear-gradient(45deg, color-mix(in srgb, currentColor 10%, transparent) 0 8px, transparent 8px 18px); }
.np-waves::before { background-image: radial-gradient(circle at 50% 120%, transparent 14px, color-mix(in srgb, currentColor 14%, transparent) 15px 16px, transparent 17px); background-size: 34px 18px; }
.np-check::before { background-image: linear-gradient(45deg, color-mix(in srgb, currentColor 8%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, currentColor 8%, transparent) 75%), linear-gradient(45deg, color-mix(in srgb, currentColor 8%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, currentColor 8%, transparent) 75%); background-size: 22px 22px; background-position: 0 0, 11px 11px; }
.np-confetti::before { background-image: radial-gradient(#ff6b6b 1.6px, transparent 2px), radial-gradient(#4dabf7 1.6px, transparent 2px), radial-gradient(#ffd43b 1.6px, transparent 2px), radial-gradient(#51cf66 1.6px, transparent 2px); background-size: 46px 46px, 38px 38px, 52px 52px, 30px 30px; background-position: 0 0, 12px 20px, 26px 8px, 7px 30px; opacity: .7; }
.np-stars::before { background-image: radial-gradient(circle, color-mix(in srgb, currentColor 40%, transparent) 1px, transparent 1.5px), radial-gradient(circle, color-mix(in srgb, currentColor 25%, transparent) .8px, transparent 1.2px); background-size: 40px 40px, 23px 23px; background-position: 3px 6px, 15px 18px; }
.nk-pat { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--rm-line); background: var(--rm-surface); position: relative; overflow: hidden; color: var(--rm-ink); padding: 0; display: inline-grid; place-items: center; }
.nk-pat::before { content: ""; position: absolute; inset: 0; opacity: .8; }
.nk-pat.on { border-color: var(--rm-primary); }
.nk-pat.np-none i { color: var(--rm-ink-2); }
/* the board's background */
.nkb { border-radius: 16px; transition: background-color .2s; }
.nkb:not(.nkb-plain) { padding: 1rem; }
.nkb-dots { background-color: #fbfaf5; background-image: radial-gradient(#d6d2c4 1.2px, transparent 1.4px); background-size: 18px 18px; }
.nkb-grid { background-color: #fbfdff; background-image: linear-gradient(#e3ebf3 1px, transparent 1px), linear-gradient(90deg, #e3ebf3 1px, transparent 1px); background-size: 22px 22px; }
.nkb-cork { background-color: #c8a27a; background-image: radial-gradient(rgba(90,55,25,.25) 1px, transparent 1.5px), radial-gradient(rgba(255,240,220,.25) 1px, transparent 1.5px); background-size: 9px 9px, 13px 13px; background-position: 0 0, 4px 6px; }
.nkb-mint { background: linear-gradient(160deg, #e6f7ef, #d4efe6); }
.nkb-sky { background: linear-gradient(160deg, #e3f0ff, #cfe3fb); }
.nkb-sunset { background: linear-gradient(160deg, #ffe7d1, #ffd6e0); }
.nkb-slate { background: #2b3138; }
.nkb-night { background: linear-gradient(160deg, #1a2238, #2b1d3a); }
.nkb-custom { background: var(--nkb-c, #f4efe1); }
.nkb-dark .nk-sec-h, .nkb-dark .nk-found, .nkb-dark .nk-hint, .nkb-dark .nk-empty { color: rgba(255,255,255,.78); }
.nk-hint { color: var(--rm-ink-2); }
.nk-found { color: var(--rm-ink-2); }
[data-bs-theme="dark"] .nkb-dots { background-color: #171b18; background-image: radial-gradient(#2f3631 1.2px, transparent 1.4px); }
[data-bs-theme="dark"] .nkb-grid { background-color: #151a17; background-image: linear-gradient(#232a25 1px, transparent 1px), linear-gradient(90deg, #232a25 1px, transparent 1px); }
[data-bs-theme="dark"] .nkb-mint { background: linear-gradient(160deg, #13261d, #10221d); }
[data-bs-theme="dark"] .nkb-sky { background: linear-gradient(160deg, #111d2b, #0f1a28); }
[data-bs-theme="dark"] .nkb-sunset { background: linear-gradient(160deg, #2b1d14, #2b151c); }
.nk-boardmenu { width: 260px; }
.nk-boardsw { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .5rem; }
.nk-bsw { height: 38px; border-radius: 9px; border: 2px solid var(--rm-line); padding: 0; }
.nk-bsw.nkb-plain { background: var(--rm-bg); }
.nk-bsw.on { border-color: var(--rm-primary); box-shadow: 0 0 0 2px var(--rm-primary-050); }
.nk-colorrow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; margin: 0; }
.nk-colorrow input[type=color] { width: 44px; height: 30px; border: 1px solid var(--rm-line); border-radius: 8px; padding: 2px; background: var(--rm-surface); }
/* card: drawings, category icons, full text */
.nk-img.is-draw { background: #fff; }
.nk-img.is-draw img { object-fit: contain; }
.nk-drawtag { position: absolute; bottom: 5px; inset-inline-end: 5px; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: .65rem; }
.nk-caticon { width: 18px; text-align: center; color: var(--rm-ink-2); }
.nk-caticon:not(.nc-default) { color: color-mix(in srgb, var(--nc-bg) 55%, var(--rm-ink)); }
.nk-text h1 { font-size: 1.15rem; font-weight: 700; margin: .2rem 0 .3rem; }
.nk-text h2 { font-size: 1.02rem; font-weight: 700; margin: .2rem 0 .25rem; }
.nk-text h3 { font-size: .95rem; font-weight: 700; margin: .2rem 0; }
.nk-text p, .nk-text div { margin: 0 0 .25rem; }
.nk-text ul, .nk-text ol { padding-inline-start: 1.25rem; margin: .1rem 0 .3rem; }
.nk-text .nk-sm, .nk-ed-body .nk-sm { font-size: .82em; }
.nk-text .nk-lg, .nk-ed-body .nk-lg { font-size: 1.25em; }
.nk-text.nk-full { display: block; -webkit-line-clamp: unset; max-height: none; }
/* formatting bar and the text box of the editor */
.nk-fmt { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; padding: .2rem; margin: .25rem 0 .2rem; border-radius: 10px; background: color-mix(in srgb, var(--rm-ink) 5%, transparent); }
.nk-fb { position: relative; border: 0; background: transparent; min-width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: inherit; font-size: .95rem; padding: 0 .35rem; }
.nk-fb b { font-size: .8rem; }
.nk-fb:hover { background: color-mix(in srgb, var(--rm-ink) 10%, transparent); }
.nk-fb.on { background: color-mix(in srgb, var(--rm-primary) 18%, transparent); color: var(--rm-primary); }
.nk-fa { font-weight: 700; line-height: 1; } .nk-fa.sm { font-size: .7rem; } .nk-fa.lg { font-size: 1.1rem; }
.nk-fsep { width: 1px; height: 20px; background: color-mix(in srgb, var(--rm-ink) 15%, transparent); margin: 0 .2rem; }
.nk-fcbar { position: absolute; left: 7px; right: 7px; bottom: 4px; height: 3px; border-radius: 2px; background: #d93025; }
.nk-fcolors.show { display: grid; grid-template-columns: repeat(6, 28px); gap: .35rem; }
.nk-dot-pick { position: relative; overflow: hidden; cursor: pointer; margin: 0; }
.nk-dot-pick input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.nk-ed-body { min-height: 90px; max-height: 50vh; overflow-y: auto; outline: 0; padding: .35rem 0; line-height: 1.55; font-size: .95rem; overflow-wrap: anywhere; }
.nk-ed-body:empty::before { content: attr(aria-label); color: color-mix(in srgb, var(--rm-ink) 50%, transparent); pointer-events: none; }
.nk-ed-body h1 { font-size: 1.35rem; font-weight: 700; margin: .3rem 0; }
.nk-ed-body h2 { font-size: 1.12rem; font-weight: 700; margin: .3rem 0; }
.nk-ed-body p, .nk-ed-body div { margin: 0 0 .2rem; }
.nk-ed-body ul, .nk-ed-body ol { padding-inline-start: 1.4rem; margin: .2rem 0; }
.nk-ed-body a { text-decoration: underline; }
/* the style panel */
.nk-ed-style { margin-top: .6rem; padding: .7rem; border-radius: 12px; background: color-mix(in srgb, var(--rm-surface) 70%, transparent); border: 1px solid color-mix(in srgb, var(--rm-ink) 10%, transparent); color: var(--rm-ink); display: grid; gap: .55rem; }
.nk-st-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.nk-st-l { min-width: 92px; font-size: .78rem; font-weight: 600; color: var(--rm-ink-2); }
.nk-st-dots { display: flex; flex-wrap: wrap; gap: .35rem; }
.nk-st-dots:empty { display: none; }
.nk-st-pats { display: flex; flex-wrap: wrap; gap: .35rem; }
.nk-ed-style .form-control-color { width: 46px; height: 34px; padding: 3px; }
.nk-ed-style .btn-group .btn.active { background: var(--rm-primary); color: #fff; border-color: var(--rm-primary) !important; }
/* drawings in the editor */
.nk-ed-img.is-draw { background: #fff; cursor: pointer; }
.nk-ed-img.is-draw img { object-fit: contain; cursor: pointer; }
/* the drawing pad */
.nk-draw { background: var(--rm-surface); overflow: hidden; }
.nk-dr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .7rem; border-bottom: 1px solid var(--rm-line); }
.nk-dr-bar .btn.on { background: var(--rm-primary); color: #fff; border-color: var(--rm-primary) !important; }
.nk-dr-colors { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.nk-dr-colors .nk-dot { width: 26px; height: 26px; }
.nk-dr-colors .nk-dot.on { box-shadow: 0 0 0 2px var(--rm-surface), 0 0 0 4px var(--rm-primary); }
.d-contents { display: contents; }
.nk-dr-size { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.nk-dr-size i { width: 26px; text-align: center; line-height: 1; }
.nk-dr-size input { width: 110px; }
.nk-dr-papers.show { display: grid; grid-template-columns: repeat(3, 48px); gap: .4rem; }
.nk-dr-paper { width: 48px; height: 36px; border-radius: 7px; border: 2px solid var(--rm-line); padding: 0; }
.pp-white { background: #fff; } .pp-cream { background: #fbf6e9; } .pp-black { background: #1e2124; }
.pp-lines { background: #fff linear-gradient(transparent 9px, #c9d8ef 10px) 0 0 / 100% 10px; }
.pp-grid { background-color: #fff; background-image: linear-gradient(#dfe6ee 1px, transparent 1px), linear-gradient(90deg, #dfe6ee 1px, transparent 1px); background-size: 8px 8px; }
.pp-dots { background: #fff radial-gradient(#b8c0cb 1px, transparent 1.3px) 0 0 / 8px 8px; }
.nk-dr-stage { padding: .75rem; background: color-mix(in srgb, var(--rm-ink) 6%, var(--rm-bg)); display: grid; place-items: center; }
.nk-dr-stage canvas { width: 100%; max-width: calc((100vh - 170px) * 4 / 3); aspect-ratio: 4 / 3; height: auto; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); touch-action: none; cursor: crosshair; display: block; }
/* version history */
.nk-histwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.nk-histwrap:has(.nk-histprev:not([hidden])) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.nk-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.nk-hv { border: 1px solid var(--rm-line); border-radius: 12px; padding: .55rem .7rem; background: var(--rm-surface); }
.nk-hv.on { border-color: var(--rm-primary); box-shadow: 0 0 0 3px var(--rm-primary-050); }
.nk-hv-h { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .85rem; }
.nk-hv-btns { margin-inline-start: auto; display: flex; gap: .3rem; }
.nk-hcs { list-style: none; margin: .35rem 0 0; padding: 0; font-size: .8rem; color: var(--rm-ink-2); display: flex; flex-direction: column; gap: .1rem; }
.nk-hc { overflow-wrap: anywhere; }
.nk-hc.add i { color: #2e9e5b; } .nk-hc.del i { color: #c5221f; }
.nk-hc b { color: var(--rm-ink); font-weight: 500; }
.nk-histprev { position: sticky; top: 0; align-self: start; }
.nk-vcard { cursor: default; }
.nk-vcard .nk-text { -webkit-line-clamp: unset; display: block; }
/* category icons */
.nk-icons.show { display: grid; grid-template-columns: repeat(8, 34px); gap: .2rem; max-height: 260px; overflow-y: auto; }
.nk-iconpick { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--rm-ink); display: grid; place-items: center; }
.nk-iconpick:hover { background: var(--rm-primary-050); color: var(--rm-primary); }
.nk-catrow { display: flex; gap: .4rem; align-items: center; padding: .35rem 0; }
.nk-catrow .form-control { flex: 1 1 auto; min-width: 0; }
.nk-catnew { padding-bottom: .6rem; border-bottom: 1px solid var(--rm-line); margin-bottom: .4rem; }
.nk-more-style { color: var(--rm-ink-2); }
@media (max-width: 767.98px) {
  .nk-grid { grid-template-columns: 1fr 1fr; column-gap: 10px; }
  .nk-histwrap:has(.nk-histprev:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .nkb:not(.nkb-plain) { padding: .6rem; }
  .nk-dr-size input { width: 80px; }
  .nk-st-l { min-width: 0; width: 100%; }
}
@media (max-width: 459.98px) {
  .nk-grid { grid-template-columns: minmax(0, 1fr); }
  .nk-icons.show { grid-template-columns: repeat(6, 34px); }
  .nk-fb { min-width: 30px; }
}
/* v1.53: import contacts from a phone */
.ct-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.4rem;min-height:9rem;padding:1rem;border:2px dashed var(--bs-border-color);border-radius:.75rem;text-align:center;cursor:pointer;color:var(--bs-secondary-color);position:relative;overflow:hidden}
.ct-drop:hover,.ct-drop:focus-within{border-color:var(--bs-primary);color:var(--bs-body-color)}
.ct-drop>i{font-size:2rem}
.ct-drop>span{overflow-wrap:anywhere;max-width:100%}
.ct-drop input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.ct-how{display:flex;flex-direction:column;gap:.15rem;padding:.5rem 0;border-bottom:1px solid var(--bs-border-color-translucent)}
.ct-how:last-of-type{border-bottom:0}
.ci-wrap{max-height:65vh;overflow:auto}
.ci-table thead th{position:sticky;top:0;background:var(--bs-body-bg);z-index:1}
.ci-table .ci-name{min-width:9rem}
.ci-table tr[hidden]{display:none}
@media (max-width:575.98px){.ci-table .ci-name{min-width:7rem}.ci-wrap{max-height:none}}
/* v1.53: long words (Tamil, Malayalam …) — the filters and the copy box stay inside a phone screen */
.ct-filters .form-select { min-width: 0; text-overflow: ellipsis; }
.ua-copy { min-width: 0; max-width: 100%; }
.ct-searchbar > .ct-filters { min-width: 0; max-width: 100%; }
.ua-copy .form-select { min-width: 0; flex: 1 1 auto; max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .ct-filters .form-select { flex: 1 1 120px; max-width: 100%; } .ua-copy { width: 100%; } }
.ua-acts { min-width: 0; max-width: 100%; }
