/* #region Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 14px/1.45 var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ab-hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* #endregion */

/* #region Shell: sidebar, top bar, content */
.ab-app { display: flex; min-height: 100vh; }
.ab-side { width: 232px; flex: none; background: var(--ink); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 0 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ab-side :focus-visible { outline-color: var(--accent); }
.ab-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .01em; padding: 0 20px 18px; }
.ab-logo i { width: 26px; height: 26px; border-radius: 4px; background: var(--accent); display: grid; place-items: center; font-style: normal; color: var(--accent-ink); font-weight: 800; font-size: 15px; }
.ab-group { font-size: 12px; color: var(--side-muted); padding: 18px 20px 6px; font-weight: 500; letter-spacing: .02em; }
.ab-nav { display: flex; align-items: center; gap: 11px; padding: 9px 20px; margin: 1px 0; color: inherit; text-decoration: none; border-left: 3px solid transparent; transition: background .15s; }
.ab-nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.ab-nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; }
.ab-nav.on { background: rgba(255, 255, 255, .08); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.ab-nav.on svg { stroke: var(--accent); }
.ab-company { margin-top: auto; border-top: 1px solid var(--side-line); padding: 14px 20px 0; display: flex; gap: 10px; align-items: center; color: #fff; }
.ab-company small { display: block; color: var(--side-muted); font-size: 12px; }
.ab-avatar { width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accent-ink); flex: none; background: var(--accent); }

.ab-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ab-top { height: 56px; flex: none; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 4; }
.ab-top-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ab-top-right { display: flex; align-items: center; gap: 14px; }
.ab-burger { display: none; width: 34px; height: 34px; border-radius: var(--radius-ctrl); place-items: center; border: 0; background: transparent; cursor: pointer; flex: none; }
.ab-burger:hover, .ab-icon-btn:hover { background: var(--page); }
.ab-burger svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 2; }
.ab-search { display: flex; align-items: center; gap: 8px; background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-ctrl); padding: 7px 12px; color: var(--muted); width: 280px; }
.ab-search:focus-within { border-color: var(--focus); background: var(--white); }
.ab-search svg, .ab-icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ab-search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); width: 100%; min-width: 0; }
.ab-search kbd { margin-left: auto; white-space: nowrap; font: 600 11px var(--font); border: 1px solid var(--line); background: var(--white); border-radius: 3px; padding: 1px 5px; }
.ab-icon-btn { position: relative; color: var(--muted); display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-ctrl); border: 0; background: transparent; cursor: pointer; }
.ab-icon-btn em { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; border: 2px solid var(--white); }
.ab-user { position: relative; }
.ab-user-btn { display: flex; align-items: center; gap: 9px; padding: 0 0 0 14px; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.ab-user-btn small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.ab-user-btn b { line-height: 1.2; display: block; font-weight: 600; }
.ab-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-ctrl); padding: 4px; box-shadow: 0 8px 24px rgba(16, 40, 31, .14); }
.ab-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; padding: 8px 10px; border-radius: 4px; cursor: pointer; color: var(--text); }
.ab-menu button:hover { background: var(--page); }
.ab-overlay { display: none; }

.ab-main { flex: 1; padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ab-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -.005em; line-height: 1.15; }
.ab-head p { margin-top: 4px; color: var(--muted); }
/* #endregion */

/* #region Components: buttons, panels, forms, badges */
.ab-btn { border-radius: var(--radius-ctrl); padding: 8px 15px; font: 600 14px var(--font); cursor: pointer; border: 1px solid var(--line-strong); background: var(--white); color: var(--text); display: inline-flex; gap: 6px; align-items: center; justify-content: center; text-decoration: none; }
.ab-btn:hover { background: var(--page); }
.ab-btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.ab-btn.primary:hover { background: var(--ink-2); }
.ab-btn:disabled { opacity: .6; cursor: not-allowed; }

.ab-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px 20px; }
.ab-panel > h3 { font-size: 15px; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.ab-panel > h3 span { color: var(--muted); font-weight: 400; font-size: 13px; }

.ab-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.ab-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ab-field.wide { grid-column: 1 / -1; }
.ab-field label { font-weight: 600; }
.ab-field label .req { color: var(--danger); }
.ab-input { width: 100%; font: inherit; color: var(--text); background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-ctrl); padding: 9px 11px; }
.ab-input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.ab-input:disabled { background: var(--page); color: var(--muted); }
textarea.ab-input { resize: vertical; min-height: 72px; }
.ab-input.invalid { border-color: var(--danger); background: var(--danger-tint); }
.ab-err { color: var(--danger); font-size: 13px; min-height: 0; }
.ab-hint { color: var(--muted); font-size: 13px; }
.ab-switch { display: flex; align-items: center; gap: 8px; }
.ab-switch input { accent-color: var(--ink); width: 16px; height: 16px; }
.ab-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

.ab-dot { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.ab-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.s-Draft { color: var(--st-draft); } .s-Confirmed { color: var(--st-confirmed); } .s-Shipped { color: var(--st-shipped); }
.s-Invoiced { color: var(--st-invoiced); } .s-Paid { color: var(--st-paid); } .s-Overdue { color: var(--st-overdue); } .s-Inactive { color: var(--st-draft); } .s-Active { color: var(--st-paid); }

.ab-tablewrap { overflow-x: auto; }
.ab-table { width: 100%; border-collapse: collapse; }
.ab-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--head-bg); white-space: nowrap; font-size: 13px; }
.ab-table td { padding: 11px 14px; border-bottom: 1px solid var(--row-line); white-space: nowrap; }
.ab-table tbody tr:hover { background: var(--head-bg); }
.ab-table tr:last-child td { border-bottom: 0; }
.ab-table .r { text-align: right; }
.ab-empty { text-align: center; padding: 28px; color: var(--muted); }
.ab-panel.flush { padding: 0; overflow: hidden; }
.ab-panel.flush > h3 { padding: 16px 20px 12px; margin-bottom: 0; }
/* #endregion */

/* #region Dashboard: summary strip, order belt, bar chart */
.ab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.ab-stat { padding: 18px 22px; border-left: 1px solid var(--line); }
.ab-stat:first-child { border-left: 0; }
.ab-stat .l { color: var(--muted); }
.ab-stat .n { font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 4px 0 2px; }
.ab-stat .d { font-size: 13px; color: var(--ok); font-weight: 600; }
.ab-stat .d.down { color: var(--danger); }

/* The belt: each stage is as wide as its order count and ends in an arrow, so the row reads as orders moving toward Paid. */
.ab-pipe { display: flex; gap: 6px; }
.ab-stage { flex: 1 1 0; min-width: 120px; padding: 0; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; transition: opacity .15s; }
.ab-stage .tk { height: 12px; margin-bottom: 12px; background: currentColor; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.ab-stage .n, .ab-stage .l, .ab-stage .v { color: var(--text); display: block; }
.ab-stage .n { font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.ab-stage .l { font-weight: 600; margin-top: 2px; }
.ab-stage .v { font-size: 13px; color: var(--muted); }
.ab-stage:hover .l { text-decoration: underline; text-underline-offset: 3px; }
.ab-pipe.has-on .ab-stage:not(.on) { opacity: .45; }
.ab-pipe.has-on .ab-stage:not(.on):hover { opacity: .8; }
.ab-stage.on .l { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.ab-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.ab-chart svg { width: 100%; height: auto; display: block; }
.ab-chart .bar { fill: var(--bar); transition: fill .15s; }
.ab-chart .bar:hover { fill: var(--ink-2); }
.ab-chart .bar.last { fill: var(--accent); }
.ab-chart text { font: 12px var(--font); fill: var(--muted); }
.ab-chart line { stroke: var(--line); }
/* #endregion */

/* #region Login page */
.ab-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.ab-login-art { background: var(--ink) repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(255, 255, 255, .06) 35px, rgba(255, 255, 255, .06) 36px); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.ab-login-art h2 { font-size: clamp(34px, 4.2vw, 52px); line-height: 1.08; font-weight: 600; letter-spacing: -.01em; max-width: 520px; }
.ab-login-art p { color: var(--side-text); margin-top: 16px; max-width: 400px; font-size: 16px; }
.ab-login-art .ab-logo { padding: 0; font-size: 20px; }
.ab-login-flow { display: flex; gap: 6px; max-width: 560px; }
.ab-login-flow span { flex: 1 1 0; font-size: 13px; color: var(--side-text); }
.ab-login-flow span::before { content: ""; display: block; height: 12px; margin-bottom: 10px; background: #fff; opacity: .22; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.ab-login-flow span:nth-child(2)::before { opacity: .35; }
.ab-login-flow span:nth-child(3)::before { opacity: .5; }
.ab-login-flow span:nth-child(4)::before { opacity: .7; }
.ab-login-flow span:last-child { color: #fff; font-weight: 700; }
.ab-login-flow span:last-child::before { background: var(--accent); opacity: 1; }
.ab-login-box { display: grid; place-items: center; padding: 32px 20px; }
.ab-login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.ab-login-card h1 { font-size: 30px; font-weight: 600; letter-spacing: -.005em; }
.ab-login-card .sub { color: var(--muted); margin-top: 4px; }
.ab-pass { position: relative; }
.ab-pass .ab-input { padding-right: 60px; }
.ab-pass button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font); cursor: pointer; padding: 6px 8px; }
.ab-login-card .ab-btn { width: 100%; padding: 12px; }
/* #endregion */

/* #region Messages (toast) */
.ab-toasts { position: fixed; top: 16px; right: 16px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.ab-toast { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius-ctrl); box-shadow: 0 8px 24px rgba(16, 40, 31, .16); padding: 12px 38px 14px 14px; position: relative; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.ab-toast.error { border-left-color: var(--danger); }
.ab-toast.warning { border-left-color: var(--accent); }
.ab-toast.info { border-left-color: var(--st-confirmed); }
.ab-toast .x { position: absolute; top: 6px; right: 6px; border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.ab-toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ink); width: 100%; transform-origin: left; }
.ab-toast.error .bar { background: var(--danger); }
.ab-toast.warning .bar { background: var(--accent); }
/* #endregion */

/* #region Responsive (1100px narrow desktop, 900px tablet, 640px phone) */
@media (max-width: 1100px) {
  .ab-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ab-side { position: fixed; z-index: 6; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s; }
  .ab-app.open .ab-side { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .3); }
  .ab-app.open .ab-overlay { display: block; position: fixed; inset: 0; background: rgba(16, 40, 31, .5); z-index: 5; }
  .ab-burger { display: grid; }
  .ab-user-btn small, .ab-user-btn b { display: none; }
  .ab-user-btn { padding-left: 10px; }
  .ab-main { padding: 22px 20px 32px; }
  .ab-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ab-stat:nth-child(3) { border-left: 0; }
  .ab-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ab-two { grid-template-columns: minmax(0, 1fr); }
  .ab-login { grid-template-columns: minmax(0, 1fr); }
  .ab-login-art { display: none; }
}
@media (max-width: 640px) {
  .ab-top { padding: 0 12px; gap: 8px; }
  .ab-search { width: auto; flex: 1; min-width: 0; }
  .ab-search kbd, .ab-gear { display: none; }
  .ab-main { padding: 16px 12px 28px; gap: 16px; }
  .ab-head h1 { font-size: 23px; }
  .ab-head p { display: none; }
  .ab-form-grid { grid-template-columns: minmax(0, 1fr); }
  .ab-pipe { overflow-x: auto; padding-bottom: 6px; }
  .ab-stage { flex: 0 0 128px !important; }
  .ab-panel { padding: 14px; }
  .ab-stat { padding: 14px; }
  .ab-stat .n { font-size: 24px; }
  .ab-hm { display: none; }
  .ab-form-actions .ab-btn { flex: 1; }
}
/* #endregion */

/* #region Icons (Lucide sprite, ISC licence) */
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; flex: none; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
/* #endregion */

/* #region Theme picker (top bar) */
.ab-theme { position: relative; }
.ab-menu .ab-theme-item { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ab-menu .ab-theme-item[aria-checked="true"] { font-weight: 700; background: var(--page); }
.ab-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line-strong); flex: none; }
/* #endregion */

/* #region Error pages (rule 29) */
.ab-errpage { min-height: 100vh; max-width: 520px; margin: 0 auto; padding: 48px 24px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.ab-errpage .ab-logo { color: var(--ink); padding: 0 0 28px; }
.ab-errcode { font-size: clamp(64px, 18vw, 112px); font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--accent); margin: 0; }
.ab-errpage h1 { font-size: 28px; font-weight: 600; line-height: 1.2; }
.ab-errtext { color: var(--muted); max-width: 44ch; }
.ab-errref { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-ctrl); padding: 8px 12px; width: fit-content; }
.ab-erractions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
/* #endregion */

/* #region Sidebar collapse (desktop only; the phone drawer always shows full names) */
.ab-nav .ab-t, .ab-logo .ab-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-burger { display: grid; }
@media (min-width: 901px) {
  .ab-side { transition: width .2s; }
  .ab-app.collapsed .ab-side { width: 68px; overflow-x: hidden; }
  .ab-app.collapsed .ab-t { display: none; }
  .ab-app.collapsed .ab-logo { padding: 0 0 18px; justify-content: center; }
  .ab-app.collapsed .ab-nav { justify-content: center; padding: 11px 0; gap: 0; }
  .ab-app.collapsed .ab-group { padding: 10px 0 4px; border-top: 1px solid var(--side-line); margin: 10px 14px 0; }
  .ab-app.collapsed .ab-company { padding: 14px 0 0; justify-content: center; }
}
/* #endregion */

/* #region Password strength meter and rule checklist */
.ab-pwmeter { display: flex; align-items: center; gap: 10px; margin-top: 6px; --pw: var(--line-strong); }
.ab-pwmeter[data-level="1"] { --pw: var(--danger); }
.ab-pwmeter[data-level="2"] { --pw: var(--accent); }
.ab-pwmeter[data-level="3"] { --pw: var(--ok); }
.ab-pwbar { display: flex; gap: 4px; flex: 1; max-width: 240px; }
.ab-pwbar i { height: 6px; flex: 1; border-radius: 3px; background: var(--line); transition: background .15s; }
.ab-pwmeter[data-level="1"] i:nth-child(-n+1), .ab-pwmeter[data-level="2"] i:nth-child(-n+2), .ab-pwmeter[data-level="3"] i { background: var(--pw); }
.ab-pwmeter b { font-size: 13px; color: var(--pw); min-width: 56px; }
.ab-pwrules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.ab-pwrules li::before { content: "\25CB\00a0"; }
.ab-pwrules li.ok { color: var(--ok); }
.ab-pwrules li.ok::before { content: "\2713\00a0"; }
/* #endregion */

/* #region Search suggestions (from the sidebar menu) */
.ab-search { position: relative; }
.ab-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 8; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-ctrl); padding: 4px; box-shadow: 0 8px 24px rgba(16, 40, 31, .14); min-width: 240px; }
.ab-suggest a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; color: var(--text); text-decoration: none; }
.ab-suggest a.on, .ab-suggest a:hover { background: var(--page); }
.ab-suggest svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; color: var(--muted); }
.ab-suggest p { margin: 0; padding: 8px 10px; color: var(--muted); }
/* #endregion */

/* #region Datatable (Abhyam.Table: rows and buttons left, search right; count left, pages right) */
.ab-dt { display: flex; flex-direction: column; }
.ab-dt-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ab-dt-left { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.ab-dt-size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.ab-dt-size .ab-input { width: auto; padding: 6px 28px 6px 10px; font-weight: 600; color: var(--text); }
.ab-dt-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.ab-dt-btn { padding: 6px 12px; font-size: 13px; gap: 7px; }
.ab-dt-btn .ab-ico { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ab-dt-search { position: relative; display: block; flex: 0 1 280px; min-width: 200px; }
.ab-dt-search .ab-ico { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.ab-dt-search .ab-input { padding-left: 34px; background: var(--head-bg); }
.ab-dt-search .ab-input:focus { background: var(--white); }
.ab-dt.loading tbody { opacity: .5; }
.ab-dt .ab-table th { background: var(--head-bg); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.ab-dt .ab-table tbody tr:nth-child(even) { background: rgba(248, 249, 245, .6); }
.ab-dt .ab-table tbody tr:hover { background: var(--accent-tint); }
.ab-dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.ab-dt-pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ab-pg { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-ctrl); font: 600 13px var(--font); color: var(--text); cursor: pointer; }
.ab-pg:hover:not(:disabled):not(.on) { background: var(--page); }
.ab-pg.on { background: var(--ink); border-color: var(--ink); color: #fff; cursor: default; }
.ab-pg:disabled:not(.on) { opacity: .45; cursor: not-allowed; }
.ab-pg-dots { min-width: 22px; text-align: center; color: var(--muted); }
.ab-dt td .ab-btn { padding: 4px 10px; font-size: 13px; }
.ab-dt td .ab-cell-actions { display: flex; gap: 6px; }
.s-Current { color: var(--ok); }
.s-Deactive { color: var(--muted); }
/* #endregion */

/* #region Date picker (Abhyam.DatePicker) */
.ab-dp { position: relative; }
.ab-dp .ab-input { padding-right: 40px; }
.ab-dp-btn { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 34px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 4px; cursor: pointer; color: var(--muted); }
.ab-dp-btn:hover { background: var(--page); color: var(--text); }
.ab-dp-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ab-cal { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 292px; max-width: calc(100vw - 24px); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 10px; box-shadow: 0 8px 24px rgba(16, 40, 31, .16); }
.ab-cal-head { display: grid; grid-template-columns: 32px 1fr 84px 32px; gap: 6px; margin-bottom: 8px; }
.ab-cal-head .ab-input { padding: 5px 6px; }
.ab-cal-nav { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-ctrl); cursor: pointer; font-size: 18px; line-height: 1; color: var(--text); }
.ab-cal-nav:hover { background: var(--page); }
.ab-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ab-cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.ab-cal-day { aspect-ratio: 1; border: 0; background: transparent; border-radius: 4px; cursor: pointer; font: inherit; color: var(--text); }
.ab-cal-day:hover:not(:disabled) { background: var(--page); }
.ab-cal-day.today { outline: 1px solid var(--accent); }
.ab-cal-day.focus { outline: 2px solid var(--focus); }
.ab-cal-day.sel { background: var(--ink); color: #fff; }
.ab-cal-day:disabled { color: var(--line-strong); cursor: not-allowed; }
.ab-cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.ab-cal-foot .ab-btn { padding: 5px 12px; font-size: 13px; }
/* #endregion */

/* #region Searchable select (Abhyam.Select) */
.ab-sel { position: relative; }
.ab-sel-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; bottom: 0; }
.ab-sel-btn { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.ab-sel-btn:disabled { cursor: not-allowed; }
.ab-sel-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-sel-text.placeholder { color: var(--muted); }
.ab-sel-arrow { color: var(--muted); flex: none; }
.ab-sel-pop { position: fixed; z-index: 60;   /* fixed, so a table or card with overflow never cuts it; select.js sets top, left and width */ background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-ctrl); box-shadow: 0 8px 24px rgba(16, 40, 31, .14); padding: 6px; }
.ab-sel-search { margin-bottom: 6px; padding: 6px 9px; }
.ab-sel-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.ab-sel-opt, .ab-sel-none { padding: 7px 10px; border-radius: 4px; }
.ab-sel-opt { cursor: pointer; }
.ab-sel-opt.hi, .ab-sel-opt:hover { background: var(--page); }
.ab-sel-opt[aria-selected="true"] { font-weight: 600; background: var(--accent-tint); }
.ab-sel-none { color: var(--muted); }
/* #endregion */

/* #region Print (the Print button of a table: everything else is hidden while the dialog is open) */
@media print {
  .ab-printing .ab-side, .ab-printing .ab-top, .ab-printing .ab-overlay, .ab-printing .ab-head, .ab-printing .ab-toast-host,
  .ab-printing .ab-panel:not(:has(.ab-print-this)), .ab-printing .ab-dt-bar, .ab-printing .ab-dt-foot { display: none !important; }
  .ab-printing .ab-main { padding: 0; }
  .ab-printing .ab-panel { border: 0; }
  .ab-printing .ab-tablewrap { overflow: visible; }
}
/* #endregion */

/* #region Confirmation popup (Abhyam.Msg.confirm) */
.ab-modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(16, 40, 31, .45); display: grid; place-items: center; padding: 16px; }
.ab-modal { background: var(--white); border-radius: var(--radius-panel); padding: 20px 22px; width: min(420px, 100%); box-shadow: 0 12px 40px rgba(16, 40, 31, .3); }
.ab-modal h3 { font-size: 17px; margin-bottom: 8px; }
.ab-modal p { color: var(--muted); }
.ab-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
/* #endregion */

/* #region Multi select (Abhyam.MultiSelect: chips in the box, a checklist in the popup) */
.ab-ms-box { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; height: auto; }
.ab-ms-box.disabled { background: var(--page); cursor: not-allowed; }
.ab-ms-box:focus { outline: 2px solid var(--focus); border-color: var(--focus); }
.ab-ms-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ab-ms-ph { color: var(--muted); }
.ab-ms-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-tint); border-radius: 4px; padding: 2px 4px 2px 8px; font-size: 13px; max-width: 100%; }
.ab-ms-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-ms-x { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 5px; border-radius: 3px; color: var(--text); }
.ab-ms-x:hover { background: rgba(16, 40, 31, .12); }
.ab-ms-tools { display: flex; gap: 6px; margin-bottom: 6px; }
.ab-ms-tools .ab-btn { padding: 4px 10px; font-size: 13px; }
.ab-ms-opt { display: flex; align-items: center; gap: 8px; }
.ab-ms-tick { width: 16px; height: 16px; flex: none; border: 1px solid var(--line-strong); border-radius: 3px; display: grid; place-items: center; font-size: 12px; line-height: 1; color: #fff; }
.ab-ms-opt[aria-selected="true"] { font-weight: 400; background: transparent; }
.ab-ms-opt[aria-selected="true"] .ab-ms-tick { background: var(--ink); border-color: var(--ink); }
.ab-ms-opt.hi { background: var(--page); }
/* #endregion */

/* #region Datatable header sort */
.ab-th-sort { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.ab-th-sort:hover { color: var(--text); }
.ab-th-arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--line-strong); }
th[aria-sort="ascending"] .ab-th-arrow { border-top: 0; border-bottom: 5px solid var(--text); }
th[aria-sort="descending"] .ab-th-arrow { border-top: 5px solid var(--text); }
th[aria-sort] .ab-th-sort { color: var(--text); }
/* #endregion */

/* #region Phone fixes for the datatable, calendar and forms (touch targets about 40px; the table's own columns fit without a side scroll) */
@media (max-width: 640px) {
  .ab-dt-bar { padding: 12px; flex-direction: column-reverse; align-items: stretch; }
  .ab-dt-search { flex-basis: auto; min-width: 0; }
  .ab-dt-search .ab-input { min-height: 42px; }
  .ab-dt-left { justify-content: space-between; }
  .ab-dt-actions { padding-left: 0; border-left: 0; flex: 1; justify-content: flex-end; }
  .ab-dt-btn { min-height: 40px; }
  .ab-dt-size .ab-input { min-height: 40px; }
  .ab-dt th, .ab-dt td { padding: 10px 8px; }
  .ab-dt th:first-child, .ab-dt td:first-child { padding-left: 12px; }
  .ab-dt td { white-space: normal; }
  .ab-dt td .ab-btn { min-height: 38px; padding: 6px 12px; }
  .ab-dt td .ab-cell-actions { flex-direction: column; align-items: stretch; }
  .ab-th-sort { min-height: 32px; }
  .ab-dt-foot { padding: 12px; flex-direction: column; align-items: flex-start; }
  .ab-pg { min-width: 40px; height: 40px; }
  .ab-dp-btn { width: 40px; }
  .ab-cal { width: min(320px, calc(100vw - 24px)); }
  .ab-cal-day { min-height: 38px; }
  .ab-cal-head { grid-template-columns: 40px 1fr 92px 40px; }
  .ab-cal-nav, .ab-cal-head .ab-input { min-height: 40px; }
  .ab-cal-foot .ab-btn { min-height: 40px; }
  .ab-input, .ab-sel-btn { min-height: 42px; }
  .ab-ms-opt, .ab-sel-opt { padding-top: 10px; padding-bottom: 10px; }
  .ab-ms-tools .ab-btn { min-height: 38px; }
  .ab-switch { min-height: 40px; }
  .ab-switch input { width: 20px; height: 20px; }
  .ab-form-actions { flex-wrap: wrap; }
  .ab-modal .ab-form-actions .ab-btn { min-height: 44px; }
}
/* #endregion */

/* #region Phone fixes, second pass */
@media (max-width: 640px) {
  .ab-dt th { white-space: normal; }
  .ab-form-actions .ab-btn { min-height: 44px; }
}
/* #endregion */

/* #region Page notes and action rows (user account actions) */
.ab-note { color: var(--muted); margin-bottom: 12px; }
.ab-action-row { flex-wrap: wrap; gap: 8px; }
/* #endregion */

/* #region Sidebar groups (v3: a heading opens to show its pages; collapsed, a heading is an icon with its name below and its pages open in a panel) */
.ab-side { padding-bottom: 0; }
.ab-nav.ab-single { margin: 6px 0 8px; padding-top: 12px; padding-bottom: 12px; border-top: 1px solid var(--side-line); border-bottom: 1px solid var(--side-line); font-weight: 600; }
.ab-grp { margin: 2px 0; }
.ab-parent { width: 100%; background: none; border: 0; border-left: 3px solid transparent; font: inherit; text-align: left; cursor: pointer; padding: 12px 20px; }
.ab-parent .ab-t { flex: 1; font-weight: 500; }
.ab-grp.has-on > .ab-parent { color: #fff; font-weight: 600; }
.ab-grp.has-on > .ab-parent svg { stroke: var(--accent); }
.ab-chev { width: 7px; height: 7px; flex: none; margin-right: 4px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); opacity: .7; transition: transform .15s; }
.ab-grp.open > .ab-parent .ab-chev { transform: rotate(135deg); }
.ab-sub { display: none; padding: 2px 0 6px; }
.ab-grp.open > .ab-sub { display: block; }
.ab-sub-title { display: none; }
.ab-child { padding: 8px 20px 8px 50px; font-size: 14px; }
.ab-child.on svg { stroke: var(--accent); }
@media (min-width: 901px) {
  .ab-app.collapsed .ab-side { width: 92px; }
  .ab-app.collapsed .ab-nav.ab-single .ab-t, .ab-app.collapsed .ab-nav.ab-parent .ab-t { display: block; flex: none; font-size: 11px; line-height: 1.25; max-width: 84px; font-weight: 600; }
  .ab-app.collapsed .ab-nav.ab-single, .ab-app.collapsed .ab-nav.ab-parent { flex-direction: column; gap: 5px; padding: 12px 4px; text-align: center; border-left-color: transparent; }
  .ab-app.collapsed .ab-nav.ab-single { border-top: 1px solid var(--side-line); border-bottom: 1px solid var(--side-line); }
  .ab-app.collapsed .ab-nav.ab-single svg, .ab-app.collapsed .ab-nav.ab-parent svg { width: 20px; height: 20px; }
  .ab-app.collapsed .ab-chev { display: none; }
  .ab-app.collapsed .ab-grp.open > .ab-sub { display: none; }
  .ab-app.collapsed .ab-grp.fly > .ab-sub { display: block; position: fixed; left: 94px; z-index: 8; width: 232px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--white); color: var(--text); border-radius: var(--radius-panel); box-shadow: 0 10px 34px rgba(0, 0, 0, .28); padding: 12px 0; }
  .ab-app.collapsed .ab-sub-title { display: block; padding: 4px 22px 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .ab-app.collapsed .ab-sub .ab-nav { color: var(--text); padding: 10px 22px; margin: 0; border-left: 0; font-size: 15px; justify-content: flex-start; text-align: left; }
  .ab-app.collapsed .ab-sub .ab-nav .ab-t { display: block; }
  .ab-app.collapsed .ab-sub .ab-nav:hover { background: var(--head-bg); color: var(--text); }
  .ab-app.collapsed .ab-sub .ab-nav.on { background: var(--accent-tint); color: var(--text); font-weight: 600; }
}
/* #endregion */

/* #region Tables and forms: serial number, check boxes, page url, form sections, UPI image */
.ab-table .ab-sno { width: 1%; color: var(--muted); text-align: right; }
.ab-table .ab-check { width: 1%; text-align: center; }
.ab-table .ab-url { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.ab-form-section { margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.ab-upi { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.ab-upi-preview { max-width: 160px; max-height: 160px; border: 1px solid var(--line); border-radius: var(--radius-ctrl); background: var(--white); padding: 4px; }
#permWrap { margin-top: 14px; max-height: 60vh; overflow: auto; }
/* #endregion */

/* #region Product page: list filters and the Packs / Seller Rates grids (on a phone each grid row becomes a card with its labels) */
.ab-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; padding: 0 20px 12px; }
.ab-grid-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ab-grid td { padding: 8px 10px; vertical-align: top; }
.ab-grid tbody tr:hover { background: none; }
.ab-grid .ab-input { min-width: 130px; }
.ab-grid .ab-err { display: block; white-space: normal; max-width: 260px; margin-top: 4px; }
.ab-grid td.ab-sno { padding-top: 18px; }
.ab-grid input[readonly], .ab-grid select:disabled { background: var(--page); color: var(--muted); }
@media (max-width: 640px) {
  .ab-filters { padding: 0 12px 12px; }
  .ab-grid thead { display: none; }
  .ab-grid, .ab-grid tbody, .ab-grid tr, .ab-grid td { display: block; width: 100%; }
  .ab-grid tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .ab-grid td, .ab-grid tr:last-child td { border: 0; padding: 4px 0; white-space: normal; }
  .ab-grid td.ab-sno { width: 100%; text-align: left; padding-top: 4px; font-weight: 600; }
  .ab-grid td.ab-sno::before { content: "Row "; }
  .ab-grid td[data-label]::before { content: attr(data-label); display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
  .ab-grid td.r { text-align: left; }
  .ab-grid .ab-input { min-width: 0; }
  .ab-grid .ab-err { max-width: none; }
}
/* #endregion */

/* #region Toast status colours (green, red, gold with tinted background) */
.ab-toast.success { background: #e3f6e8; border-color: #8fd3a2; border-left-color: #1e9e4a; color: #0f4d24; }
.ab-toast.success .bar { background: #1e9e4a; }
.ab-toast.error { background: #fde8e8; border-color: #f2a1a1; border-left-color: #d32f2f; color: #7a1414; }
.ab-toast.error .bar { background: #d32f2f; }
.ab-toast.warning { background: #fff4d1; border-color: #e8c55a; border-left-color: #d9a400; color: #6b4e00; }
.ab-toast.warning .bar { background: #d9a400; }
.ab-toast .x { color: inherit; opacity: .7; }
/* #endregion */

/* #region Product view popup (wide modal, icon-only button) */
.ab-modal.wide { width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.ab-modal.wide .ab-tablewrap { overflow: auto; margin: 10px 0 14px; }
.ab-btn.ab-iconbtn { padding: 4px 8px; }
/* #endregion */

/* #region Status colours (rule 57: Active is green, Deactive and Inactive are red) */
.s-Active, .s-Current { color: var(--ok); }
.s-Inactive, .s-Deactive { color: var(--danger); }
.ab-btn.ab-iconbtn svg { display: block; }
/* #endregion */
