/* oneStock — merged oneApp theme tokens. */
:root {
  /* oneApp theme tokens */
  --primary: #465fff;
  --on-primary: #ffffff;
  --primary-dark: #3538cd;
  --primary-container: #f6f8ff;
  --on-primary-container: #2e3192;
  --secondary: #667085;
  --secondary-container: #e4e7ec;
  --on-secondary-container: #344054;
  --surface: #ffffff;
  --surface-variant: #f9fafb;
  --surface-container: #f2f4f7;
  --text: #344054;
  --text-dark: #1D2939;
  --dark-grey: #344054;
  --muted: #667085;
  --outline: #98a2b3;
  --outline-variant: #EAECF0;
  --light-grey: #D0D5DD;
  --button-secondary-border: var(--light-grey);
  --border: #eaecf0;
  --orange: #ff7f00;
  --orange-watermark: #B54708;
  --red: #D92D20;
  --red-watermark: #F04438;
  --red-soft: #ff383c;
  --green: #298b08;
  --green-watermark: #12B76A;
  --blue: #2563eb;
  --pill-blue-bg: #eff6ff;
  --pill-blue-text: #175CD3;
  --pill-red-bg: #fef3f2;
  --pill-red-text: var(--red);
  --pill-green-bg: #ECFDF3;
  --pill-green-text: #027A48;
  --card-title-font-size: 18px;
  --form-grid-gap: 20px;
  --gap-card-head: 16px;
  --gap-card-filters: 16px;
  --font-weight-light: 400;
  --font-weight-normal: 500;
  --font-weight-bold: 600;
  --font-weight-extra-bold: 700;
  --content-card-title-font-weight: var(--font-weight-bold);
  --content-card-title-color: var(--text);
  --gray: #79747e;
  --radius: 8px;
  --radius-card: 16px;
  --radius-full: 999px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --shadow-lg: 0 12px 24px -4px rgba(16, 24, 40, .14), 0 8px 16px -8px rgba(16, 24, 40, .14);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --color-gray-50: #f9fafb;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--surface);           /* Figma frames are white */
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  width: 100%;
}
select:not(:disabled):hover,
.searchable-select-trigger:not(:disabled):hover { cursor: pointer; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}
input:disabled, select:disabled { background: var(--surface-container); color: var(--gray); }
#accRole:disabled { background: var(--surface-container); }
#bizName:disabled, #bizCurrency:disabled { background: var(--surface-container); }

/* ---------- signin (TailAdmin signin layout, brand panel removed) ---------- */
.signin-body { background: var(--surface); }
.signin-page { display: flex; min-height: 100dvh; width: 100%; justify-content: center; padding: 24px 16px; }
.signin-col { display: flex; flex: 1; flex-direction: column; justify-content: center; width: 100%; max-width: 420px; }
.signin-inner { width: 100%; }
.signin-head { margin-bottom: 24px; }
.signin-logo { display: block; margin: 0 auto 16px; border-radius: 12px; }
.signin-head h1 { font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 32px; font-weight: var(--font-weight-extra-bold); color: var(--text); margin-bottom: 6px; }
.signin-head p { color: var(--muted); font-size: 14px; }

.signin-social { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
.btn-social {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface-variant); border: 1px solid transparent; border-radius: var(--radius);
  padding: 11px 16px; font-size: 13.5px; font-weight: var(--font-weight-normal); color: var(--text);
}
.btn-social:hover { background: var(--surface-container); }

.signin-divider { position: relative; text-align: center; margin: 18px 0; }
.signin-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--outline-variant);
}
.signin-divider span { position: relative; background: var(--surface); padding: 0 14px; color: var(--muted); font-size: 13px; }

.signin-body .field label { font-size: 13.5px; font-weight: var(--font-weight-normal); color: var(--text); margin-bottom: 6px; display: inline-block; }
.signin-body .field .req { color: var(--red-soft); margin-left: 2px; }
.signin-body form { display: flex; flex-direction: column; gap: 18px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  background: none; border: none; padding: 4px; color: var(--muted); display: inline-flex;
}

.signin-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: -4px; }
.signin-row--center { justify-content: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.signin-link { color: var(--primary); font-size: 13.5px; }
.signin-link:hover { color: var(--primary-dark); }
.signup-name-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 639.98px) { .signup-name-grid { grid-template-columns: 1fr; gap: 18px; } }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.back-link:hover { color: var(--text); }
.back-link svg { stroke: currentColor; }

.alert-success { background: #e7f6ec; color: var(--green); }

/* ---------- shell (M3 app bar 64px, phone canvas) ---------- */
.app-shell { min-height: 100dvh; }
.drawer {
  position: fixed; inset: 0 auto 0 0; width: 272px; background: var(--surface);
  z-index: 100; transform: translateX(-105%); transition: transform .22s ease;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 50px 30px 0px; text-align: left;
  border-bottom: 1px solid var(--outline-variant);
}
.drawer-row { display: flex; align-items: center; gap: 12px; }
.drawer-head img { border-radius: 8px; }
.drawer-head strong { font-size: 16px; font-weight: var(--font-weight-normal); }
.drawer-head small { display: block; color: var(--muted); }
.drawer-greeting { font-size: 13px; padding: 20px 5px; font-weight: var(--font-weight-bold); }
.drawer-nav { flex: 1; padding: 20px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-radius: var(--radius-full); color: var(--text); font-weight: var(--font-weight-normal);
  width: 100%; text-align: left; background: none; border: none; font-size: 14px;
}
.nav-item:hover { background: var(--surface-container); }
.nav-item .badge { margin-left: auto; background: var(--secondary-container); color: var(--on-secondary-container); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: var(--font-weight-bold); }
.nav-item img { flex: none; }
.drawer-foot { display: none; border-top: 1px solid var(--outline-variant); padding: 8px; }
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-scrim.show { opacity: 1; pointer-events: auto; }

.main { margin-left: 0; padding-bottom: 96px; }
.topbar {
  position: sticky; top: 0; z-index: 50; background: var(--surface);
  display: flex; align-items: center; gap: 4px; height: 64px; padding: 0 26px;
  border-bottom: 1px solid var(--outline-variant);
}
.page-title { font-size: 22px; }
.topbar-spacer { flex: 1; }
.icon-btn {
  background: none; border: none; font-size: 20px;
  border-radius: var(--radius-full); color: var(--text);
  min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-container); }
.icon-btn img { display: block; }
.btn img { vertical-align: middle; }

/* Items actions dropdown (Export / Import) — anchored to the topbar ⋮ button */
.menu-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.12); z-index: 124; }
.menu-pop {
  position: absolute; top: 56px; right: 8px; z-index: 126; min-width: 170px;
  background: var(--surface); border: 1px solid var(--outline-variant); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; padding: 12px 14px; font-size: 14.5px; color: var(--text); border-radius: 10px;
}
.menu-pop button:hover { background: var(--surface-container); color: var(--text); }
.menu-pop button span { font-size: 15px; }

/* Phone canvas: cap the app column at the Figma width, centered on desktop */
.content { padding: 26px; max-width: 430px; margin: 0 auto; }
@media (min-width: 900px) {
  #menuBtn { display: none; }
}

/* ---------- dashboard (stacked sections, Figma S1) ---------- */
.cards-grid { display: flex; flex-direction: column; }
.status-card {
  display: block; position: relative; color: var(--text);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-card);
  box-shadow: none;
  padding: 18px;
}
.status-card-head { margin-bottom: 4px; }
.status-card-head .card-title { font-size: 22px; font-weight: var(--font-weight-light); }
.status-card.card-orange .card-title { color: var(--orange); }
.status-card.card-red .card-title { color: var(--red); }
.status-card.card-blue .card-title { color: var(--blue); }
.status-card-items { display: flex; flex-direction: column; }
.status-row { font-size: 13px; padding: 10px 0; display: flex; align-items: center; }
.status-row + .status-row { border-top: 1px solid var(--outline-variant); }
.status-row .sname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.status-row b { font-weight: var(--font-weight-light); color: var(--text); flex-shrink: 0; }
.welcome { margin-top: 32px; text-align: center; }

/* ---------- toolbar & chips (oneApp segmented filter control, demo.oneapp.com/invoices) ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
/* track: gray-100 pill container, 2px padding, 2px gap (h-11 rounded-lg p-0.5 gap-0.5 bg-gray-100) */
.chips {
  display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto;
  background: #f2f4f7; border-radius: 8px; padding: 2px;
  width: fit-content; max-width: 100%;
}
/* pill buttons: h-10 rounded-md px-3, transparent until active (text-gray-500) */
.chip {
  border: none; background: transparent; border-radius: 6px;
  padding: 0 12px; font-size: 14px; font-weight: var(--font-weight-normal); color: #667085;
  height: 36px; display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; flex: none;
}
.chip:hover { color: #101828; }
/* active: white pill + shadow-theme-xs (bg-white shadow-theme-xs text-gray-900) */
.chip.active { background: #fff; color: #101828; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.chip a { color: inherit; }
/* Manage Contact tabs reuse the itemChips segmented-control look */
#mngTabs { margin-bottom: 14px; }
.items-count { margin: 0 0 2px; font-size: 13px; }
.search-row { display: flex; align-items: center; gap: 16px; }
.search-row input { flex: 1; min-width: 0; }
.barcode-input-row { display: flex; align-items: center; gap: 8px; }
.barcode-input-row input { flex: 1; min-width: 0; }
.barcode-scan-btn { flex: 0 0 40px; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 8px; background: var(--surface); }
.barcode-scan-btn:hover { background: var(--surface-container); }

/* ---------- items (list rows 60px + dividers, Figma S2) ---------- */
.content-card.items > .d-table-footer { border-top: 1px solid var(--outline-variant); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.item-row {
  display: flex; align-items: center; gap: 12px; background: transparent;
  border-bottom: 1px solid var(--outline-variant); padding: 16px; color: var(--text);
  min-height: 60px;
}
.item-row:last-child { border-bottom: none; }
.item-thumb {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface-container);
  display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; flex-shrink: 0;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb.lg { width: 64px; height: 64px; font-size: 30px; }
.item-meta { flex: 1; min-width: 0; }
.item-meta strong { display: block; }
.item-meta small { display: block; font-size: 12px; color: var(--muted); }
.item-qty { text-align: right; padding: 0 10px; }
.item-qty b { font-size: 16px; font-weight: var(--font-weight-light); }
.item-qty small { display: block; font-size: 11px; color: var(--muted); }
.item-act-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: none; padding: 0;
  background: var(--surface-container); display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.item-act-btn img { display: block; }
.item-name.red { color: var(--red); }
.item-name.orange { color: var(--orange); }
.item-name.gray { color: var(--gray); }
.item-qty b.red { color: var(--red); }
.item-qty b.orange { color: var(--orange); }
.item-qty b.gray { color: var(--gray); }

/* ---------- detail ---------- */
.qty-big { font-size: 24px; font-weight: var(--font-weight-light); }
.qty-big.red { color: var(--red); } .qty-big.orange { color: var(--orange); } .qty-big.gray { color: var(--gray); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--form-grid-gap); background: var(--surface); padding: 0; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field-error { display: flex; align-items: center; gap: 5px; color: var(--red); font-size: 12px; line-height: 1.4; }
#imageLimitForm .field-help { margin-top: 8px; color: var(--muted); font-size: 12px; }
.field-error[hidden] { display: none; }
.field-hint { display: block; color: #B54708; font-size: 12px; line-height: 1.4; margin-top: 4px; }
.field-hint[hidden] { display: none; }
.field.has-error > input,
.field.has-error > select,
.field.has-error > textarea { border-color: var(--red-watermark) !important; box-shadow: 0 0 0 1px var(--red-watermark); }
.field.full { grid-column: 1 / -1; }
.pricing-limit-row { display: grid; grid-template-columns: 1fr; gap: var(--form-grid-gap); }
.pricing-limit-row .field-help { color: var(--muted); font-size: 12px; }
@media (min-width: 768px) {
  .pricing-limit-row { grid-template-columns: 1fr 1fr 1fr; }
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input, .row select { width: auto; flex: 1; min-width: 120px; }
.section { margin-top: 24px; }
.section > h3 { font-size: 16px; font-weight: var(--font-weight-bold); margin-bottom: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-del {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff;
  border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; line-height: 1;
}
.act-list { display: flex; flex-direction: column; }
/* Recent Activity table (Time | Activity | Qty) */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.section-head h3 { margin: 0; text-transform: uppercase; }
.link-btn {
  background: none; border: none; color: var(--primary); font-size: 13px; font-weight: var(--font-weight-normal);
  cursor: pointer; display: inline-flex; align-items: center; gap: 3px; padding: 4px 2px;
  text-transform: uppercase;
}
.link-btn .arr { font-size: 15px; line-height: 1; }
.act-table .act-row.head span:last-child { text-align: center; }
.act-table .act-row .type { font-weight: var(--font-weight-normal); text-transform: capitalize; }
.act-row b { text-transform: capitalize; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: auto; }

/* ---------- item detail redesign (carousel, toggle, lightbox) ---------- */
.carousel { position: relative; }
.carousel-main {
  position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3;
  background: var(--surface-variant); display: flex; justify-content: center;
}
.carousel-main > img { width: 100%; object-fit: contain; }
.carousel-main > img.carousel-empty { width: 100%; height: 100%; object-fit: contain; opacity: .35; cursor: default; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.9); color: #475467;
  box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 1px 3px rgba(16,24,40,.1);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.carousel-btn svg { display: block; }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-edit {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.9); color: #555;
  box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 1px 3px rgba(16,24,40,.1);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.carousel-edit svg { display: block; }
.carousel-image-menu { top: 56px; right: 8px; }
.image-menu-icon { width: 16px; height: 16px; display: block; flex: none; color: currentColor; }
/* oneApp-style position counter — white dots, active widens to a pill */
.carousel-dots {
  position: absolute; bottom: 20px; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: center; gap: 6px;
}
.carousel-dots .dot { width: 10px; height: 10px; border-radius: 999px; border: none; background: #fff; padding: 0; cursor: pointer; transition: width .2s, background .2s; }
.carousel-dots .dot.active { background: #fff; width: 26px; }
/* oneApp control insets: 12px on phones, 16px on wider screens */
@media (min-width: 640px) {
  .carousel-btn.prev { left: 16px; }
  .carousel-btn.next { right: 16px; }
}
.detail-head { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.detail-head > .detail-title { width: 100%; min-width: 0; }
.detail-title h2 { font-size: 20px; font-weight: var(--font-weight-normal); margin: 0 0 4px; }
.detail-title h2 > span { font-size: inherit; padding-bottom: 3px; }
/* active/inactive toggle (M3-style switch button) */
.switch-btn {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none;
  cursor: pointer; min-height: 40px; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; border-radius: 999px;
}
.switch-btn:disabled { opacity: .7; cursor: default; }
.switch-track { width: 46px; height: 26px; border-radius: 999px; background: var(--surface-variant); border: 2px solid var(--outline); position: relative; transition: background .18s ease, border-color .18s ease; flex: none; }
.switch-thumb { position: absolute; top: 1px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--outline); transition: left .18s ease, background .18s ease; }
.switch-btn.on .switch-track { background: var(--primary); border-color: var(--primary); }
.switch-btn.on .switch-thumb { left: 20px; background: #fff; }
.switch-label { font-size: 13px; color: var(--text); font-weight: var(--font-weight-normal); }
/* detail columns (aligned: Current Qty/Cost/Description | Min Qty/Sell) */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--form-grid-gap); margin-top: 32px;
}
.stock-card { display: flex; flex-direction: column; gap: 8px; }
.stock-label { color: #344054; font-size: 13px; font-weight: var(--font-weight-normal); }
.stock-card > b,
.stock-label { font-size: 16px; font-weight: var(--font-weight-bold); }
.stock-card > span { font-size: 13px; font-weight: var(--font-weight-normal); }
.stock-value {
  display: block;
  width: auto; min-height: 0; box-sizing: border-box;
  padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--text);
  font-size: 13px; font-weight: var(--font-weight-light);
}
.stock-value.gray { color: var(--gray); }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-item.full { grid-column: 1 / -1; }
.info-label { color: var(--dark-grey); font-size: 13px; font-weight: var(--font-weight-normal); }
.info-value { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.select-wrap { display: flex; align-items: center; gap: 2px; align-self: flex-start; }
.select-wrap .chev { color: var(--muted); flex: none; }
.plain-select {
  border: none; background: transparent; padding: 0; width: auto;
  font: inherit; font-size: 15px; color: var(--text);
  -webkit-appearance: none; appearance: none; outline: none; cursor: pointer; text-align: left;
}
.plain-select:disabled { color: var(--gray); }
.desc-edit {
  font: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--outline); border-radius: 8px; padding: 8px 10px;
  background: var(--surface); resize: vertical; min-height: 56px; width: 100%;
}
.detail-meta { font-size: 12px; color: var(--muted); display: block; margin-top: 8px; }
/* breadcrumb */
.page-heading { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; font-size: 13px; min-width: 0; }
.page-heading a { color: var(--primary); text-decoration: none; font-weight: var(--font-weight-normal); flex: none; }
.page-heading .crumb-sep { color: var(--muted); flex: none; }
.page-heading .crumb-cur { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* item detail card (matches items-list/reports card style) */
.detail-card > .content-card-body {
  padding-top: 24px;
  padding-bottom: 24px;
}
@media (max-width: 767px) {
  .detail-card > .content-card-body { padding-left: 18px; padding-right: 18px; }
}
@media (min-width: 768px) {
  .detail-card > .content-card-body { padding-left: 24px; padding-right: 24px; }
}
/* barcode strip + retail-style human-readable number + delete */
@font-face {
  font-family: 'OCR-B';
  src: url('/fonts/ocrb.ttf') format('truetype');
  font-weight: var(--font-weight-light);
  font-style: normal;
  font-display: swap;
}
.barcode-row { display: flex; margin-top: 20px; justify-content: left; align-items: center; gap: 8px; }
.act-card { margin-top: 24px; }
.barcode-box { flex: 0 0 auto; display: flex; flex-direction: column; }
.barcode-label { color: #344054; font-size: 13px; font-weight: var(--font-weight-normal); margin-bottom: 7px; }
.barcode-strip { display: flex; width: 100%; }
.barcode-strip img { display: block; }
.barcode-strip svg { display: block; max-width: 100%; height: 70px; }
.barcode-num {
  display: block; max-width: 100%; min-height: 0; box-sizing: border-box;
  padding: 0 8px 2px; margin-top: -4px; text-align: center;
  border: 0; border-radius: 0; background: transparent; color: var(--text);
  font-family: 'OCR-B', monospace; font-size: 17px; font-weight: var(--font-weight-light); letter-spacing: 2px;
  white-space: nowrap;
}
/* image lightbox */
.lightbox { position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 18px; cursor: pointer;
}

/* ---------- activities (bulk, Figma S1b) ---------- */
.act-item-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border-bottom: 1px solid var(--outline-variant); padding: 12px 0; margin-bottom: 0; flex-wrap: wrap;
}
.act-item-info { flex: 1; min-width: 140px; }
.act-item-info strong { font-size: 14px; }
.act-item-info small { display: block; font-size: 12px; color: var(--muted); }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--outline);
  background: var(--surface); font-size: 18px; line-height: 1;
}
.unit-price, .sell-price, .adj-note { width: 110px; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: var(--surface); border-radius: 28px 28px 0 0; max-height: 70dvh;
  display: flex; flex-direction: column; box-shadow: 0 -4px 24px rgba(0,0,0,.2);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid var(--outline-variant); }
@media (max-width: 767px) {
  .sheet-head { padding: 14px 18px; }
}
.sheet-body { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; }
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 12px;
}
.new-activity { display: grid; gap: 16px; }
.sheet-drag { width: 40px; height: 5px; border-radius: 3px; background: var(--outline); margin: 10px auto 0; flex: none; }
.itemact-body .qty-controls { width: 100%; }
/* oneApp Stock Quantity stepper (segmented pill: [− | n | +]) */
.qty-controls.ia-qty,
.qty-controls.qty-stepper {
  display: flex; align-items: stretch; gap: 0;
  border-radius: 8px; overflow: hidden;
}
.qty-controls.ia-qty { width: 100%; }
.qty-controls.ia-qty:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(70, 101, 255, .12); }
.qty-controls.qty-stepper { width: fit-content; flex: none; border: 1px solid var(--light-grey); }
.qty-controls.ia-qty .qty-btn,
.qty-controls.qty-stepper .qty-btn {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 0;
  background: #fff; color: #344054; font-size: 0; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.qty-controls.ia-qty .qty-btn:hover,
.qty-controls.qty-stepper .qty-btn:hover { background: #f9fafb; }
.qty-controls.ia-qty .qty-btn:active,
.qty-controls.qty-stepper .qty-btn:active { background: #eaecf0; }
.qty-controls.ia-qty .qty-num { flex: 1; min-width: 0; }
.qty-controls.qty-stepper .qty-num { min-width: 36px; }
.qty-controls.ia-qty .qty-input.qty-num {
  width: 100%; min-width: 0; padding: 0 12px;
  text-align: center; font: inherit; font-size: 14px; font-weight: var(--font-weight-normal); color: var(--text);
  background: var(--surface);
}
.qty-controls.qty-stepper .qty-input.qty-num {
  width: 36px; min-width: 36px; height: 44px; padding: 0 4px;
  border: 0; border-left: 1px solid var(--light-grey); border-radius: 0;
  text-align: center; font: inherit; font-size: 14px; font-weight: var(--font-weight-normal); color: #344054;
  background: #fff; appearance: textfield;
}
.qty-controls.qty-stepper .qty-input.qty-num:focus { outline: 2px solid rgba(70, 95, 255, .25); outline-offset: -2px; }
.qty-controls.qty-stepper .qty-input.qty-num::-webkit-outer-spin-button,
.qty-controls.qty-stepper .qty-input.qty-num::-webkit-inner-spin-button { margin: 0; }
.qty-controls.ia-qty .qty-btn:last-child,
.qty-controls.qty-stepper .qty-btn:last-child { border-left: 1px solid var(--light-grey); }
.itemact-body #iActUnitPrice { border-color: var(--light-grey); }
.itemact-body #iActUnitPrice:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(70, 101, 255, .12);
}
.sheet-item {
  text-align: left; background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--radius); padding: 12px; font-size: 15px; color: var(--text);
}
.sheet-item:hover { border-color: var(--primary); }
.sheet-item.active { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: var(--font-weight-bold); }
.sheet-scrim, .modal-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 110;
}
.sheet-scrim { z-index: 115; }

/* ---------- reports ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--outline-variant); }
.table th { font-weight: var(--font-weight-bold); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tfoot td { font-weight: var(--font-weight-extra-bold); }

/* ---------- settings (Figma S5: sections + 44px rows) ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { border: 1px solid var(--outline); background: var(--surface); padding: 8px 16px; border-radius: var(--radius-full); font-weight: var(--font-weight-normal); }
.tab.active { background: var(--secondary-container); color: var(--on-secondary-container); border-color: var(--secondary-container); }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { background: var(--secondary-container); color: var(--on-secondary-container); border-radius: 12px; padding: 3px 10px; font-size: 13px; }
.contact-list { display: flex; flex-direction: column; margin-top: 10px; }

.settings-group > h3 { font-size: 12px; font-weight: var(--font-weight-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0; }
.settings-group .srow { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--outline-variant); flex-wrap: wrap; min-height: 44px; }
@media (max-width: 767.98px) {
  .settings-group .srow { padding: 0; }
}
@media (min-width: 768px) {
  .settings-group .srow { padding: 0; }
}
.settings-management-actions { display: grid; gap: 16px; }
.settings-management-actions .srow { padding-top: 24px; }
.settings-platform-business-card .settings-management-actions .srow { padding: 0; }
.settings-group .srow:last-child { border-bottom: none; }
.settings-group .srow .srow-label { flex: 1; min-width: 140px; font-size: 12px; color: var(--muted); }
.settings-group .srow input[type=text], .settings-group .srow input[type=email], .settings-group .srow select { flex: 2; min-width: 160px; }
.settings-group .srow .val { color: var(--muted); flex: 2; min-width: 160px; box-sizing: border-box; border: 1px solid transparent; padding: 10px 12px; }
.terms-link { color: var(--red-soft); font-weight: var(--font-weight-bold); }
.app-version { color: var(--muted); font-size: 13px; padding: 4px 0 12px; }
.settings-contact-row { margin-bottom: 24px; }
.settings-contact-link { color: var(--text); font-size: 14px; font-weight: var(--font-weight-normal); text-decoration: none; }
.settings-contact-link span { color: var(--primary); }
.settings-contact-link:hover { text-decoration: underline; }
.settings-logout-btn { min-width: 180px; }
.settings-logout-btn svg { flex: none; }
#manageCategoryBtn, #managePurposeBtn, #manageContactBtn, #manageUsersBtn { min-width: 220px; }
#managePricingSubscriptionBtn, #managePlatformUsersBtn { min-width: 250px; }

/* ---------- FAB (M3 56x56, bottom-right) ---------- */
.fab {
  position: fixed; right: 16px; bottom: 24px; z-index: 80;
  width: 56px; height: 56px; border-radius: 16px; border: none;
  background: var(--blue); color: #fff; font-size: 28px; font-weight: var(--font-weight-light);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
  transition: transform .15s, opacity .2s;
}
.fab:active { transform: scale(.94); }
.fab:disabled, .fab.plan-limit-disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.fab:disabled:active, .fab.plan-limit-disabled:active { transform: none; }
.fab img { display: block; filter: invert(1); }
.fab.fab-labelable { gap: 8px; width: 56px; overflow: hidden; white-space: nowrap; transition: width .2s, border-radius .2s, transform .15s, opacity .2s; }
.fab.fab-labelable:hover, .fab.fab-labelable:focus-visible { width: 166px; border-radius: 16px; padding: 0 18px; }
.fab.fab-labelable::after { content: attr(data-label); display: none; font-size: 14px; font-weight: var(--font-weight-normal); }
.fab.fab-labelable:hover::after, .fab.fab-labelable:focus-visible::after { display: block; }
.fab.business-fab img { width: 26px; height: 26px; object-fit: contain; flex: none; }

/* ---------- scanner ---------- */
.modal-scrim { display: flex; align-items: center; justify-content: center; z-index: 130; padding: 20px; }
.modal { background: var(--surface); border-radius: 28px; width: 100%; max-width: 420px; padding: 24px; }
.mng-edit-modal { padding: 0; }
.mng-edit-modal > .modal-head { padding: 24px; border-bottom: 1px solid var(--outline-variant); }
.mng-edit-modal > .modal-body { padding: 12px 24px; }
.modal > form { display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.app-dialog-scrim { z-index: 300; }
.app-dialog { position: static; height: auto; overflow: visible; outline: none; }
@media (min-width: 768px) {
  .modal { max-width: 500px; }
}
@media (max-width: 767px) {
  #unknownBarcodeModal .modal-actions { flex-direction: column-reverse; }
  #unknownBarcodeModal .modal-actions .btn-sm { min-width: 160px; }
}
.app-dialog .modal-head { margin-bottom: 18px; }
.app-dialog p { padding-bottom: 12px; }
.app-dialog-message { margin: 0; font-size: 13px; line-height: 1.5; }
.app-dialog-actions { justify-content: flex-end; gap: 16px; margin-top: 24px; margin-bottom: 12px; }

.app-dialog-actions .btn { min-width: 94px; min-height: 42px; border-radius: 8px; }
#unknownBarcodeModal p { margin-bottom: 24px; }
.unknown-barcode-attach-panel .form-grid { margin-bottom: 0; }
.unknown-barcode-attach-panel .act-search-matches { position: static; max-height: 220px; margin-top: 6px; }
#scannerVideo { width: 100%; border-radius: 10px; background: #000; min-height: 200px; }
#scannerStatus { margin-top: 8px; margin-bottom: 12px; font-weight: 600; }
.scanner-note { margin: 12px 0 18px; font-size: 12px; }
#invoiceScannerVideo { width: 100%; border-radius: 10px; background: #000; min-height: 200px; }
#invoiceScannerStatus { margin-top: 12px; margin-bottom: 18px; font-weight: 600; }
#invoiceScannerModal .modal-actions { justify-content: space-between; padding-top: 0; margin-bottom: 0; }
/* Multi-page thumbnail strip: every page the user adds (camera capture or
   Upload Photo) before tapping Start Scanning, shown so a bad page can be
   removed before OCR runs. */
.invoice-scanner-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; max-height: 180px; overflow-y: auto; }
.invoice-scanner-page { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--outline-variant); flex-shrink: 0; }
.invoice-scanner-page img { width: 100%; height: 100%; object-fit: cover; display: block; }
.invoice-scanner-page-num { position: absolute; bottom: 2px; left: 4px; color: #fff; font-size: 11px; font-weight: var(--font-weight-bold); text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.invoice-scanner-page-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; min-width: 20px; min-height: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.invoice-scanner-page-remove:hover { color: var(--text); }
.invoice-scanner-start-row { padding-top: 0; }
.invoice-scanner-start-btn { width: 100%; }
#actScanInvoiceBtn { display: inline-flex; align-items: center; gap: 8px; flex: none; }
#actScanInvoiceBtn img { filter: brightness(0) saturate(100%) invert(48%) sepia(99%) saturate(1939%) hue-rotate(204deg) brightness(101%) contrast(95%); }

/* ---------- Invoice OCR review modal ---------- */
.invoice-review-modal { max-width: 640px; }
.invoice-review-modal .modal-body { max-height: 80vh; overflow-y: auto; }
#invRevOcrNote { margin: 4px 0 12px; font-size: 13px; }
.inv-rev-items { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.inv-rev-reading { color: var(--green-watermark); font-weight: var(--font-weight-bold); }
.inv-rev-row { border: 1px solid var(--outline-variant); border-radius: 12px; padding: 16px; }
.inv-rev-row-linked { border-color: var(--primary); background: var(--surface-container, #f7f8fb); }
.inv-rev-row-ocr { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 8px; }
.inv-rev-row-ocr strong { word-break: break-word; }
/* Inline-editable OCR'd item name: primary blue (same token as linked-item
   name / linked-row border) signals it's editable, not just a label —
   underline reinforces the affordance since contenteditable has no native
   input chrome; focus gets a subtle highlight ring + background tint. */
.inv-rev-name-edit {
  color: var(--primary);
  cursor: text;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
}
.inv-rev-name-edit:focus {
  outline: none;
  padding: 8px;
  background: transparent;
  color: var(--text);
  font-weight: var(--font-weight-light);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent);
}
.inv-rev-row-linked-info { display: flex; align-items: center; gap: 8px; flex: none; }
.inv-rev-linked-name { font-weight: 600; color: var(--primary); }
.inv-rev-row-link-actions { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 200px; }
.inv-rev-row-link-actions input { flex: 1; min-width: 0; }
.inv-rev-row-link-actions .icon-btn:hover { background: transparent; }
#invRevSupplier.inv-rev-supplier-unknown,
#invRevSupplier.inv-rev-supplier-unknown:focus {
  border-color: var(--orange);
  outline-color: var(--orange);
}
.inv-rev-matches { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin-top: 4px; }
.inv-rev-row-fields { display: flex; align-items: flex-end; gap: 20px; margin-top: 10px; }
.inv-rev-row-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.inv-rev-row-fields input { width: 110px; height: 38px; padding: 4px 8px; }
@media (max-width: 767.98px) {
  .inv-rev-row-fields { flex-wrap: wrap; }
  .inv-rev-row-fields > label { width: 100%; }
  .inv-rev-row-fields > label > input { width: 100%; }
}
@media (min-width: 768px) {
  .inv-rev-row-fields > label { width: 50%; }
  .inv-rev-row-fields > label > input { width: 100%; }
}
.inv-rev-row-button-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.inv-rev-totals { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 12px 0; font-size: 14px; }
.inv-rev-total-match { font-weight: 600; }
.inv-rev-match-ok { color: var(--success, #12b76a); }
.inv-rev-match-warn { color: var(--danger, #f04438); }

/* ---------- Business Detail page ---------- */

.business-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--outline-variant);
}
.business-detail-head h3 { margin: 0; color: var(--text); font-size: 18px; font-weight: var(--font-weight-normal); }
.business-status-toggle { flex: none; }
.business-detail-body { padding: 24px; }
@media (max-width: 767px) {
  .business-detail-body { padding: 18px; }
}
.business-detail-section-divider { height: 1px; margin: 18px 0; background: var(--outline-variant); }
.business-status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: var(--font-weight-bold); line-height: 1.2; }
.business-status-active { color: var(--pill-green-text); background: var(--pill-green-bg); }
.business-status-inactive { color: #475467; background: #F2F4F7; }
.business-plan-pill { color: #175CD3; background: #EFF8FF; }
.business-detail-section h4 {
  margin: 0 0 6px;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
}
.business-detail-row.business-change-plan-row { align-items: center; padding-top: 32px; }
.business-change-plan-button { align-items: center; line-height: 1; gap: 8px; }
.business-change-plan-button img { display: block; flex: none; width: 18px; height: 18px; object-fit: contain; filter: brightness(0) invert(1); }
.business-change-plan-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.business-change-plan-control select {
  min-width: 200px;
  max-width: 250px;
  height: 32px;
  padding: 4px 28px 4px 10px;
  border: 1px solid var(--light-grey);
  border-radius: 6px;
  background: #fff;
  color: var(--text-dark);
  font: inherit;
}
.business-detail-actions { display: flex; justify-content: flex-end; gap: 16px; padding-top: 12px; margin-bottom: 12px; }
.business-change-plan-scrim { z-index: 140; }
.business-change-plan-modal { max-width: 420px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 0; }
.business-change-plan-modal > .modal-head { padding: 24px; border-bottom: 1px solid var(--outline-variant); }
.business-change-plan-modal > .modal-body { padding: 12px 24px; }
@media (min-width: 768px) {
  .business-change-plan-modal { max-width: 500px; }
}
.subscription-history-link { color: var(--primary); font-weight: var(--font-weight-bold); text-decoration: none; }
.subscription-history-link:hover { text-decoration: underline; }
.content-card.subscription-history-list > .content-card-head h3 { margin: 0; color: var(--text-dark); font-size: 18px; font-weight: var(--font-weight-bold); }
.content-card.subscription-history-list > .content-card-head p { margin: 2px 0 0; color: #667085; font-size: 14px; }
.subscription-history-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; width: 100%; }
.subscription-history-export {
  border-radius: 8px; background: #fff;
  color: #344054; font-size: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.subscription-history-export { white-space: nowrap; }
.subscription-history-export svg { width: 20px; height: 20px; }
.content-card.subscription-history-list > .content-card-body {
  overflow-x: auto; border-radius: 0 0 16px 16px; border-bottom: 1px solid var(--outline-variant);
}
.table-subscription-history {
  display: table; width: 100%; min-width: 1040px; margin: 0;
  border-collapse: collapse; background: var(--surface); font-size: 13px;
}
.table-subscription-history th {
  padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--outline-variant);
  background: #F9FAFB; color: var(--muted); font-size: 12px; font-weight: var(--font-weight-bold);
  letter-spacing: .04em; text-transform: capitalize; white-space: nowrap;
}
.table-subscription-history td {
  padding: 16px; text-align: left; border-bottom: 1px solid var(--outline-variant);
  color: var(--text); font-size: 13px; vertical-align: middle; white-space: nowrap;
}
.table-subscription-history tbody tr { transition: background .15s; }
.table-subscription-history tbody tr[data-subscription-row] { cursor: pointer; }
.table-subscription-history tbody tr:hover { background: #F9FAFB; }
.table-subscription-history tbody tr:last-child td { border-bottom: 0; }
.subscription-history-plan-head { width: 20%; }
.subscription-history-empty { color: var(--muted) !important; text-align: center !important; padding: 28px 12px !important; }
.subscription-history-footer { padding: 16px 20px; }
.subscription-history-footer .table-info { color: #667085; font-size: 14px; }
.subscription-history-footer .table-info b { color: #344054; font-weight: var(--font-weight-bold); }
.subscription-history-pager { align-items: center; gap: 4px; }
.subscription-history-pager .pg-btn { min-width: 40px; height: 40px; border: 0; border-radius: 8px; font-size: 14px; font-weight: var(--font-weight-normal); }
.subscription-history-pager .pg-btn.pg-nav { border: 1px solid var(--light-grey); }
.subscription-history-pager .pg-btn.active { border-color: var(--primary); }
.subscription-history-pager .pg-btn:hover:not(:disabled):not(.active) { background: #F9FAFB; }
.subscription-history-pager .pg-mobile { display: none; color: #344054; font-size: 14px; font-weight: var(--font-weight-normal); }
.subscription-history-detail-modal { max-width: 420px; }
.subscription-history-detail-list { margin: 0; }
.subscription-history-detail-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 12px 0; border-bottom: 1px solid var(--outline-variant);
}
.subscription-history-detail-row:last-child { border-bottom: 0; }
.subscription-history-detail-label { color: var(--muted); font-size: 13px; }
.subscription-history-detail-value { color: var(--text); font-size: 13px; font-weight: var(--font-weight-normal); text-align: right; word-break: break-word; }
.subscription-history-plan-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid #B2DDFF; border-radius: 999px; background: #EFF8FF;
  color: #175CD3; font-size: 12px; font-weight: var(--font-weight-bold); line-height: 1.2;
}

@media (max-width: 767.98px) {
  .content-card.subscription-history-list > .content-card-head { align-items: stretch; flex-direction: column; gap: 16px; }
  .subscription-history-actions { justify-content: stretch; flex-wrap: wrap; }
  .subscription-history-export { flex: 0 0 auto; }
  .table-subscription-history {
    min-width: 0;
    table-layout: fixed;
  }
  .table-subscription-history th,
  .table-subscription-history td {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .table-subscription-history th {
    padding: 12px 18px;
  }
  .table-subscription-history td { padding: 12px 18px; }
  .table-subscription-history th:nth-child(2),
  .table-subscription-history td:nth-child(2) { padding-left: 0; padding-right: 0; }
  .table-subscription-history th:nth-child(3),
  .table-subscription-history td:nth-child(3) { padding-left: 0; padding-right: 0; }
  .table-subscription-history th:nth-child(4),
  .table-subscription-history td:nth-child(4),
  .table-subscription-history th:nth-child(5),
  .table-subscription-history td:nth-child(5),
  .table-subscription-history th:nth-child(6),
  .table-subscription-history td:nth-child(6) { display: none; }
  .table-subscription-history th:nth-child(1) { width: 32%; }
  .table-subscription-history th:nth-child(2) { width: 34%; }
  .table-subscription-history th:nth-child(3) { width: 34%; }
}
@media (min-width: 768px) {
  .table-subscription-history th { padding: 12px 24px; }
  .table-subscription-history td { padding: 12px 24px; }
}
@media (max-width: 639.98px) {
  .subscription-history-export { flex: 1 1 140px; }
  .subscription-history-footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .subscription-history-footer .table-info { text-align: center; }
  .subscription-history-pager { justify-content: space-between; width: 100%; }
  .subscription-history-pager .pg-mobile { display: inline; }
  .subscription-history-pager .pg-nums { display: none; }
}

/* ---------- PWA prompt ---------- */
.pwa-prompt {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 140;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.pwa-prompt span { flex: 1; font-size: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 18px; border-radius: 24px;
  font-size: 14px; z-index: 200; box-shadow: var(--shadow-lg); max-width: 90vw;
  animation: toast-in .2s ease;
}
.toast-err { background: var(--red-soft); }
.toast-ok { background: var(--green-watermark); }
.toast-warn { background: var(--orange); color: #202124; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- buttons (M3 filled) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1px solid var(--button-secondary-border); color: var(--text);
  border-radius: var(--radius-full); padding: 10px 24px; font-weight: var(--font-weight-normal); font-size: 14px;
  white-space: nowrap; text-transform: none; letter-spacing: .02em;
}
.btn:hover { background: var(--surface-container); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: transparent; border-color: var(--button-secondary-border); color: var(--text); }
.btn-tertiary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-link { background: transparent; border-color: transparent; color: var(--primary); padding-left: 0; padding-right: 0; }
.btn-link:hover { background: transparent; cursor: pointer; color: var(--primary-dark); }
.btn-save { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #B42318; border-color: #B42318; color: #fff; }
.btn-block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- alerts ---------- */
.alert { border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.alert-danger { background: #fce8e6; color: var(--red-soft); }
.alert-warning { background: #fff7e6; color: #9a6700; }
.duplicate-warning { margin-top: 14px; }
.duplicate-warning-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.duplicate-compare-btn { flex-shrink: 0; color: #9a6700; border-color: #e8c56a; }
.alert-danger .duplicate-compare-btn { color: var(--red-soft); border-color: #f5c6c2; }
.loading { color: var(--muted); text-align: center; padding: 24px 0; }


/* ============================================================
   oneStock — oneApp theme styles (merged from oneapp-theme.css).
   This section intentionally follows the base rules above to preserve
   the previous cascade order.
   ============================================================ */
/* ---------- body background ---------- */
body { background-color: var(--color-gray-50); }

/* ---------- form pages: white cards on gray-50 (oneApp style) ---------- */
/* all .form-card pages (activity forms, import) stretch full width to the right (Aug 2026) */
.form-card { max-width: none; }
/* Add Item form card stretches full width too (Aug 2026) */
#newItemForm { max-width: none; }
/* Settings page cards stretch full width too (Aug 2026); Manage-* stay capped */
#content > .settings-group { max-width: none; }
.settings-master-data-card .card-head {
  margin: -18px -18px 18px;
  padding: 24px;
}
.settings-master-data-card .card-body { display: block; }
.settings-master-data-card .settings-management-actions .srow { padding-top: 0; }
.mandatory-fields-form { margin: 0; }
.mandatory-fields-card .card-head {
  margin: -18px -18px 18px;
  padding: 24px;
}
.mandatory-field-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.mandatory-field-copy { min-width: 0; }
.mandatory-field-label { display: block; color: var(--text); font-size: 14px; font-weight: var(--font-weight-normal); }
.mandatory-field-copy small { display: block; width: 100%; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mandatory-field-row .switch-btn { flex: none; }
.activity-price-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.activity-price-field input { min-width: 0; }
@media (max-width: 767px) {
  .mandatory-field-row { align-items: flex-start; flex-direction: column; gap: 16px; }
}
@media (min-width: 768px) {
  .mandatory-fields-card .card-head {
    margin: -24px -24px 24px;
    padding: 24px;
  }
  .settings-master-data-card .card-head {
    margin: -24px -24px 24px;
    padding: 24px;
  }
}

/* ---------- Item Images card / dropzone (Add Item page, Aug 2026) ----------
   Matches the oneApp add-product "Products Images" card: separate card
   below the form, head with title + border-b, dashed dropzone with upload
   icon + "Click to upload or drag and drop" text. */
#newItemImagesCard { margin-top: 20px; }
@media (max-width: 767px) {
  .form-images { padding: 18px; }
}
@media (min-width: 768px) {
  .form-images { padding: 24px; }
}
.img-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 200px;
  border: 2px dashed var(--light-grey); /* gray-300 */
  border-radius: 12px;
  background: #F9FAFB; /* gray-50 */
  cursor: pointer;
  padding: 28px 16px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.img-drop:hover, .img-drop.dragover {
  border-color: var(--primary);
  background: rgba(70, 101, 255, .05);
}
.img-drop svg { width: 40px; height: 40px; color: #667085; margin-bottom: 12px; flex: none; }
.img-drop p { font-size: 14px; color: #667085; margin: 0; }
.img-drop p b { color: var(--text-dark); font-weight: var(--font-weight-bold); }
.img-drop .img-drop-sub { font-size: 12px; color: #98A2B3; margin-top: 4px; }
#newItemImagesCard .photo-strip { margin-top: 12px; }
#newItemImagesCard .photo { width: 100px; height: 100px; }
#newItemImagesCard .photo-source-menu {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px;
}
#newItemImagesCard .photo-rotate,
#newItemImagesCard .photo-del {
  position: absolute; top: 2px; background: rgba(0,0,0,.6); color: #fff;
  border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 13px; line-height: 1;
  cursor: pointer; z-index: 1;
}
#newItemImagesCard .photo-rotate { left: 2px; }
#newItemImagesCard .photo-del { right: 2px; }
.barcode-suggested-images { margin-bottom: 14px; }
.barcode-suggested-images-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.barcode-suggested-image {
  position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 2px solid #E4E7EC; padding: 0; cursor: pointer; background: #F2F4F7;
}
.barcode-suggested-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.barcode-suggested-image:hover { border-color: var(--primary); }
.barcode-suggested-image.is-loading { opacity: .5; cursor: wait; }
.barcode-suggested-image.is-added { border-color: #12B76A; cursor: default; }
.barcode-suggested-image.is-added::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(18, 183, 106, .35); color: #fff; font-size: 20px; font-weight: var(--font-weight-bold);
}
.photo-editor-scrim {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(16, 24, 40, .72);
}
.photo-editor {
  width: min(760px, 100%); max-height: min(90vh, 860px); display: flex; flex-direction: column;
  overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 20px 48px rgba(16, 24, 40, .25);
}
.photo-editor-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #E4E7EC; }
.photo-editor-preview { min-height: 360px; flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; background: #101828; overflow: hidden; }
.photo-editor-preview img { max-width: 100%; max-height: 62vh; object-fit: contain; transition: transform .2s ease; }
.photo-editor-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #E4E7EC; }
@media (max-width: 767px) {
  .photo-editor-scrim { padding: 8px; }
  .photo-editor-preview { min-height: 280px; padding: 12px; }
  .photo-editor-preview img { max-height: 58vh; }
  .photo-editor-actions { flex-wrap: wrap; padding: 12px; }
}
/* Item Detail photo panel mirrors the Add Item "Item Images" card */
#photoPanel { margin-top: 24px; scroll-margin-top: 80px; }
#photoPanel .photo-strip { margin-top: 12px; }
/* Add Item submit — below the Item Images card, right-aligned (oneApp Publish-style) */
.add-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-top: 20px;
}
.add-item-actions #newItemErr { width: 100%; }
@media (max-width: 767px) {
  .add-item .form-grid { padding: 18px; }
}
@media (min-width: 768px) {
  .add-item .form-grid { padding: 24px; }
}
.add-item-actions .btn-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 180px;
}

/* ---------- oneApp add-product form pattern (Aug 2026) ----------
   Reference: https://demo.oneapp.com/add-product
   Card = rounded-2xl (16px) + gray-200 border; head = px-6 py-4 title row with
   border-b; fields = label above input (text-sm font-medium gray-700); inputs =
   h-11 (44px) rounded-lg (8px) border-gray-300 with brand focus ring; grid =
   gap-5, 2 cols at >=768px. */
/* title: text-base font-medium text-gray-800 (oneApp "Default Inputs" card head) */
/* fields: label above input */
.field > span { font-weight: var(--font-weight-normal); color: var(--dark-grey); } /* text-sm font-medium text-gray-700 */
.field > .field-error { display: flex; align-items: center; gap: 5px; color: var(--red); font-size: 12px; font-weight: var(--font-weight-normal); line-height: 1.4; }
.field > .field-error[hidden] { display: none; }
.add-new-contact-link { align-self: flex-start; margin-top: 5px; color: var(--primary); font-size: 13px; font-weight: var(--font-weight-normal); }
.add-new-contact-link:hover { text-decoration: underline; }
/* grid: gap-5, 2 cols at >=768 (overrides app.css 640px breakpoint) */
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
/* inputs/selects/textareas inside forms: h-11 rounded-lg border-gray-300 */
.form-grid input:not([type=hidden]):not([type=file]),
.form-grid textarea,
.toolbar input, .toolbar select, .toolbar textarea,
.settings-group .srow input[type=text], .settings-group .srow input[type=email], .settings-group .srow select {
  border: 1px solid var(--light-grey); /* gray-300 */
  border-radius: 8px; /* rounded-lg */
  background: #fff;
  padding: 0 16px; /* px-4 */
  font-size: 13px; /* text-sm */
  color: var(--text); /* text */
  box-shadow: none;
}
.form-grid textarea, .toolbar textarea { height: auto; padding: 10px 16px; resize: none; }
/* focus: brand border + 3px brand-500/10 ring (focus:ring-3 focus:ring-brand-500/10) */
.form-grid input:not([type=hidden]):not([type=file]):focus,
.form-grid select:focus, .form-grid textarea:focus,
.toolbar input:focus, .toolbar select:focus, .toolbar textarea:focus,
.settings-group .srow input[type=text]:focus, .settings-group .srow input[type=email]:focus, .settings-group .srow select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(70, 101, 255, .12);
}
.field.has-error > input:focus,
.field.has-error > select:focus,
.field.has-error > textarea:focus {
  outline: none;
  border-color: var(--red-watermark) !important;
  box-shadow: 0 0 0 1px var(--red-watermark) !important;
}
/* selects: appearance-none + oneApp chevron */
.form-grid select, .toolbar select, .settings-group .srow select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4.79175 7.396L10.0001 12.6043L15.2084 7.396' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px; /* pr-11 */
}
/* all dropdown (select) inputs match the Items Business selector */
select {
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4.79175 7.396L10.0001 12.6043L15.2084 7.396' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding: 0 44px 0 16px;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}

/* Searchable select menus used by currency and invoice business dropdowns. */
.searchable-select { position: relative; width: 100%; }
.searchable-select-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.searchable-select-trigger {
  width: 100%; padding: 10px 44px 10px 16px; text-align: left;
  border-radius: 8px; color: var(--text); background: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative;
}
.searchable-select-trigger::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid #667085; border-bottom: 1.5px solid #667085;
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.searchable-select-trigger:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(70, 101, 255, .12); }
.searchable-select-trigger:disabled { background: var(--surface-container); color: var(--gray); cursor: not-allowed; }
.searchable-select-menu {
  position: fixed; z-index: 1000; padding: 8px 6px;
  background: #fff; border: 1px solid var(--light-grey); border-radius: 8px; box-shadow: 0 8px 20px rgba(16, 24, 40, .14);
}
.searchable-select-search { height: 38px; padding: 8px 10px; margin-bottom: 6px; }
.searchable-select-options { max-height: 240px; overflow-y: auto; }
.searchable-select-option { display: block; width: 100%; min-height: 38px; margin-bottom: 4px; padding: 8px; border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--text); white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.searchable-select-option:hover, .searchable-select-option[aria-selected="true"] { background: var(--surface-container); }
#newUserRole:hover { cursor: pointer; }
/* toolbar (activity form fields) as 2-col grid on tablet+ */
.toolbar { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) {
  .toolbar { grid-template-columns: 1fr 1fr; gap: 20px; }
  .toolbar .field.full { grid-column: 1 / -1; }
}
/* settings .srow .val mirrors the new input box (44px, px-4) */
.settings-group .srow .val {
  flex: 2; min-width: 160px; box-sizing: border-box;
  border: 1px solid transparent; height: 44px; line-height: 42px; padding: 0 16px;
}
/* field rows (label + input/select/val): grid so the select's chevron padding
   (44px pr) can't skew flex sizing — the Currency select rendered ~9px wider than
   the Business Name input at >=768px; 1fr 2fr keeps the label:field ratio (Aug 2026) */
.settings-group .srow:has(.srow-label) {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  align-items: center;
}
@media (max-width: 767.98px) {
  .settings-group .srow:has(.srow-label) { grid-template-columns: 1fr; }
}
/* card header: responsive title row with faint divider below */
.form-card-head {
  border-bottom: 1px solid var(--outline-variant); /* gray-200 */
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  grid-column: 1 / -1; /* spans the form grid when used inside #newItemForm */
}
@media (max-width: 767px) {
  .form-card-head {
    padding: 18px;
  }
}
.form-card-head h3 { font-weight: var(--font-weight-normal); }
@media (min-width: 768px) {
  .form-card-head {
    padding: 24px;
  }
}
.create-invoice-page .invoice-form-card .form-card-head { border-bottom: 1px solid var(--outline-variant); }
.form-card-footer { border-top: 1px solid var(--outline-variant); display: flex; align-items: center; }
.form-card-footer > .invoice-actions { width: 100%; margin: 0; padding: 0; border-top: 0; }
@media (max-width: 767px) {
  .form-card-footer { padding: 18px; }
}
@media (min-width: 768px) {
  .form-card-footer { padding: 24px; }
}
@media (max-width: 767px) {
  .form-card-body {
    padding: 18px;
  }
}
@media (min-width: 768px) {
  .form-card-body {
    padding: 24px;
  }
}
.card-head, .card-footer {
  display: flex; align-items: center; gap: 10px;
  margin: -24px -24px 24px; padding: 18px 24px;
  border-bottom: 1px solid var(--outline-variant);
}

.card-body { display: block; }
.card-footer {
  margin: 24px -24px -24px; border-top: 1px solid var(--outline-variant); border-bottom: 0;
}
.card-footer > .invoice-actions { width: 100%; margin: 0; padding: 0; border-top: 0; }
/* Platform Owner pricing form */
#pricingTagline { width: 100%; box-sizing: border-box; }
/* activity-form head: search bar + barcode match the items page item-card-head */
.act-type-title { flex: 1 1 100%; }
.form-card-head .search-row { flex: 1 1 280px; min-width: 0; max-width: 560px; margin-left: auto; }
.form-card-head .search-ico-wrap { flex: 1; min-width: 0; }
.form-card-head .search-ico-wrap input { height: 44px; border-color: var(--light-grey); }
.form-card-head .icon-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0px; }
#actScanBtn img { width: 44px; height: 44px; }
#actScanBtn:hover { background: none; }
.act-right-head { display: flex; flex: 1 1 auto; gap: 16px; }
.activity-receive .search-row { max-width: none; }
@media (min-width: 1400px) {
  .act-right-head { max-width: 700px; }
}
/* activity type + search: stacked on mobile (type row 1, search row 2), inline on tablet+ */
@media (min-width: 768px) {
  .act-type-title { flex: 0 0 auto; }
  .form-card-head .search-row { max-width: none; }
  .act-right-head { margin-left: auto; }
}
@media (max-width: 767.98px) {
  .form-card-head .search-row { flex: 1 1 100%; width: 100%; margin-left: 0; max-width: none; }
  .activity-receive .form-card-head { flex-direction: column; gap: var(--gap-card-head); padding: 18px; align-items: flex-start; }
  .activity-receive .form-card-head .search-row { flex: auto; margin-left: 0; }
}
@media (max-width: 767px) {
  .act-right-head { flex-direction: column; width: 100%; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
  .activity-receive .form-card-head { flex-direction: column; align-items: flex-start; }
  .act-right-head { margin-left: 0; }
}
@media (min-width: 768px) and (max-width: 1399px) {
  .act-right-head { width: 100%; }
}
/* mobile only: tighter content padding (web/tablet unchanged) */
@media (max-width: 767.98px) {
  .content { padding: 14px; }
}
/* tablet+: full-width content (cards span the screen) */
@media (min-width: 768px) {
  .content { max-width: none; }
}
/* Airbnb-style search dropdown — floats below the search bar (no layout push) */
.search-row { position: relative; }
.act-search-matches {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}
.act-search-matches .act-result { padding: 10px 12px; }
/* price label + click-to-edit price (input appears only after clicking) */
.act-result .act-item-info { flex: 1; min-width: 0; }
.price-inline { display: flex; align-items: center; gap: 8px; }
.price-val { cursor: pointer; border-bottom: 1px dashed var(--outline); }
.price-val:hover { color: var(--primary); }
.act-result .unit-price { width: 110px; padding: 4px 8px; font-size: 13px; }
/* item detail Recent Activity: qty as oneApp invoice status pill (Aug 2026) */
.act-table .act-row .qty {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: var(--font-weight-normal); text-align: center;
  justify-self: center; /* keep the pill compact — grid default stretch makes it a full-column bar */
}
.act-table .act-row .qty.qty-plus { background: #eff6ff; color: #175CD3; }
.act-table .act-row .qty.qty-minus { background: #fef3f2; color: var(--red); }
.act-table .act-row .qty:not(.qty-plus):not(.qty-minus) { background: #f2f4f7; color: #475467; }
/* item detail Recent Activity card — oneApp Products List card style (Aug 2026) */
.detail-card.act-card {
  padding: 0;                /* head + rows carry their own padding */
  overflow: hidden;          /* clip row hover to the rounded corners */
  box-shadow: none;          /* products-list card has no shadow */
}
.detail-card.act-card .act-list > .muted { padding: 16px 20px; }
.act-card-head {
  display: flex; flex-direction: column; gap: 16px;
  justify-content: space-between;
}
@media (max-width: 767px) {
  .act-card-head { padding: 18px; }
}
@media (min-width: 768px) {
  .act-card-head { padding: 24px; }
}
.act-card-title h3 { margin: 0; font-size: 18px; font-weight: var(--font-weight-bold); color: var(--text); }
.act-card-title p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.act-view-btn {
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
  border-radius: 8px; border: 1px solid var(--primary); background: transparent;
  padding: 8px 14px; font-size: 13px; font-weight: var(--font-weight-normal); color: var(--primary);
  cursor: pointer; transition: background .15s;
}
.act-view-btn:hover { background: var(--primary-container); }
.act-view-btn .arr { font-size: 14px; line-height: 1; }
@media (min-width: 640px) {
  .act-card-head { flex-direction: row; align-items: center; }
  .act-view-btn { align-self: auto; }
}
/* table — products-list style header + rows */
.act-table .act-row.head {
  padding: 16px 20px; font-size: 12px; font-weight: var(--font-weight-normal);
  letter-spacing: normal; text-transform: none; color: #667085;
  border-bottom: 1px solid var(--outline-variant);
}
.act-table .act-row {
  border-bottom: 1px solid var(--outline-variant);
  transition: background .15s;
}
.act-table .act-row .type { font-weight: var(--font-weight-normal); color: #344054; }
.act-table .act-row:not(.head):hover { background: #F9FAFB; }
.act-table .act-list .act-row:last-child,
.act-table .act-row:last-child { border-bottom: none; }
/* Item Detail Recent Activity uses the shared semantic table treatment. */
.act-data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.act-data-table thead { background: var(--surface-variant); border-top: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.act-data-table th {
  padding-top: 12px; padding-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: var(--font-weight-bold);
  text-align: left; text-transform: capitalize; letter-spacing: .04em; white-space: nowrap;
}
@media (max-width: 767px) {
  .act-data-table th { padding-left: 18px; padding-right: 18px; }
}
@media (min-width: 768px) {
  .act-data-table th { padding-left: 24px; padding-right: 24px; }
}
.act-data-table td {
  padding-top: 12px; padding-bottom: 12px; color: var(--text);
  vertical-align: middle; white-space: nowrap;
}
@media (max-width: 767px) {
  .act-data-table td { padding-left: 18px; padding-right: 18px; }
}
@media (min-width: 768px) {
  .act-data-table td { padding-left: 24px; padding-right: 24px; }
}
.act-data-table tbody tr:last-child td { border-bottom: 0; }
.act-table .act-data-table thead tr.act-row,
.act-table .act-data-table tbody tr.act-row {
  display: table-row; grid-template-columns: none; padding: 0;
}
.act-data-table tbody tr.act-row:hover { background: #FAFBFC; }
.act-data-table tbody tr.act-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.act-data-table td.time { color: var(--muted); }
.act-data-table td:last-child { text-align: center; }
.act-data-table th:last-child { text-align: center; }
.act-data-table td[colspan] { padding: 24px 18px; color: var(--muted); text-align: center; }
/* item detail: min qty click-to-edit */
.min-qty-edit { cursor: pointer; display: block; width: 80px; color: var(--primary); }
.min-qty-edit:hover { color: var(--primary); }
.min-qty-edit-input { width: 80px; padding: 4px 8px; font-size: 13px; }
/* item detail: cost/sell price + barcode click-to-edit */
.inline-edit { cursor: pointer; color: var(--primary); }
.control-disabled { opacity: .5; cursor: not-allowed !important; }
.inline-edit:hover { color: var(--primary); }
.inline-edit.is-disabled { cursor: default; color: var(--gray); border-bottom-color: transparent; }
.inline-edit-input { width: 150px; padding: 4px 8px; font-size: 13px; }
.detail-name-edit-input { width: 100%; max-width: none; font: inherit; font-weight: inherit; }
.barcode-edit { width: 100%; font-family: inherit; }
#barcodeScanBtn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; }
#barcodeScanBtn:hover { background: transparent; }
/* mobile (≤767px): fixed inline-edit widths requested for detail fields */
@media (max-width: 767.98px) {
  .min-qty-edit-input { width: 150px; max-width: none; }
  #descEdit { width: 350px; max-width: 100%; }
}
/* tablet portrait (768–899px): wider name editor and full-width sell price */
@media (min-width: 768px) and (max-width: 899.98px) {
  #purchasePriceEdit,
  #sellPriceEdit { width: 100%; }
}
/* Purchase Price and Sell Price inputs are full-width at every breakpoint */
#purchasePriceEdit,
#sellPriceEdit { width: 100%; }
/* tablet/web: min qty edit input fills its grid column (phone keeps 80px) */
@media (min-width: 768px) {
  .min-qty-edit-input { width: 100%; }
}
/* return page: borrowed-items list header + Borrowed/Unreturned column */
.act-results-head { display: flex; align-items: center; gap: 10px; padding: 8px 0 6px; margin-top: 30px; font-size: 11px; font-weight: var(--font-weight-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--color-gray-600); border-bottom: 1px solid var(--outline-variant); }
.act-results-head span { line-height: 1.25; }
.act-results-head span:nth-child(1) { flex: 1; }
.act-results-head-return span:nth-child(2) { width: 88px; text-align: center; }
.act-results-head-return span:nth-child(3) { width: 104px; text-align: center; margin-left: auto; }
.act-result .act-bu { width: 88px; text-align: center; font-size: 13px; color: var(--color-gray-700); }
/* tablet/web: pull the Borrowed/Unreturned column left instead of pinning it to the far right */
@media (min-width: 768px) {
  .act-results-head-return span:nth-child(1) { max-width: 45%; }
  .act-result .act-item-info { max-width: 45%; }
}
/* return rows: fixed right column matching the header's Returning Qty width (104px), pinned to the row's right edge */
.act-qty-col { width: 104px; display: flex; align-items: center; justify-content: center; gap: 6px; margin-left: auto; }
.act-qty-col .qty-input { width: 64px; min-width: 0; text-align: center; font-size: 13px; }
.qty-right .qty-input { width: 64px; text-align: center; }
.qty-controls.ia-qty.qty-over-limit {
  border-color: var(--red-watermark) !important;
  box-shadow: 0 0 0 1px var(--red-watermark);
}
.qty-over-limit { border-color: var(--red-watermark) !important; box-shadow: 0 0 0 1px var(--red-watermark); }
.act-qty-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; max-width: 100%; }
.act-qty-stack .qty-right,
.act-qty-stack .act-qty-col { margin-left: 0; }
.act-qty-stack .act-qty-error { flex-basis: auto; width: max-content; max-width: min(100%, 320px); text-align: right; }
.act-qty-error { color: #D92B20; font-size: 12px; line-height: 1.4; }
.adj-row .act-qty-error { grid-column: 1 / -1; text-align: left; }
.act-qty-col .icon-btn { width: 24px; height: 24px; padding: 0; flex-shrink: 0; }
.act-qty-col .icon-btn img { width: 16px; height: 16px; }
/* bulk Activities: quantity input width follows the requested breakpoints */
@media (min-width: 768px) {
  #actSearchResults .qty-input,
  #actItemRows .qty-input { width: 120px; }
}
@media (max-width: 767.98px) {
  #actSearchResults .qty-input,
  #actItemRows .qty-input { width: 70px; }
}
/* bulk Activities: Received From / Sold To / Borrowed By fills its field */
.form-card #actContact { width: 100%; }
/* space below the added-items list on the activities page */
#actSearchResults { padding-bottom: 30px; }
/* more breathing room between the contact/select and the Note field */
.form-card .toolbar { margin-top: 12px; }
/* non-return rows: pin the qty + delete group to the row's far right edge */
.qty-right { margin-left: auto; }
/* adjustment page: ITEM | CURRENT | NEW | ADJ columns — grid so head and rows share identical tracks */
.act-results-head-adjustment { display: grid; grid-template-columns: minmax(0, 1fr) 60px 90px 50px 36px; gap: 8px; }
.act-results-head-adjustment span { text-align: center; line-height: 1.25; }
.act-results-head-adjustment span:first-child { text-align: left; }
.adj-row.act-result { display: grid; grid-template-columns: minmax(0, 1fr) 60px 90px 50px 36px; gap: 8px; align-items: center; }
.adj-row .adj-current { text-align: center; font-size: 13px; color: var(--color-gray-700); }
.adj-row .adj-new { width: 100%; min-width: 0; padding: 4px 8px; font-size: 13px; }
.adj-row .adj-diff { text-align: center; font-size: 13px; font-weight: var(--font-weight-bold); }
/* adjustment per-row note: sits BELOW the row, full width */
.adj-note { width: 100%; margin: -6px 0 12px; padding: 6px 10px; font-size: 13px; border: 1px solid var(--outline); border-radius: 8px; }
.adj-row .icon-btn { width: 36px; height: 36px; justify-self: end; padding: 0; }
/* mobile: divide the 4 adjustment columns evenly; delete keeps a slim track on the right */
@media (max-width: 767.98px) {
  .act-results-head-adjustment { grid-template-columns: repeat(4, 1fr) 36px; }
  .act-results-head-adjustment span:nth-child(5) { display: block; }
  .adj-row.act-result { grid-template-columns: repeat(4, 1fr) 36px; }
  .adj-row.act-result .icon-btn { display: flex; width: 36px; height: 36px; justify-self: end; }
  .adj-row.act-result .adj-new { width: 100%; }
}
/* manage-list pages: table-style rows with avatar + delete icon */
.mng-table { overflow: hidden; }
.mng-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #F0F2F6; font-size: 11px; font-weight: var(--font-weight-bold); text-transform: uppercase; letter-spacing: .04em; color: #637381; border-bottom: 1px solid var(--outline-variant); }
.mng-head span { flex-shrink: 0; }
.mng-head input { flex: 1; min-width: 0; padding: 6px 10px; font-size: 13px; font-weight: var(--font-weight-light); text-transform: none; letter-spacing: 0; border: 1px solid var(--outline); border-radius: 8px; background: #fff; }
.mng-row { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; padding: 0 14px 0; background: #fff; border-bottom: 1px solid var(--outline-variant); }
.mng-row:nth-child(even) { background: #FAFBFC; }
.mng-row:last-child { border-bottom: 0; }
.mng-row .mng-name { grid-column: 1; width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; padding: 4px 6px; border-radius: 6px; }
.mng-row .mng-name:focus { outline: none; background: #fff; border: 1px solid var(--primary); box-shadow: 0 0 0 3px rgba(70, 95, 255, .12); }
.mng-row .icon-btn { grid-column: 2; grid-row: 1; width: 32px; height: 32px; padding: 0; justify-content: center; justify-self: center; flex-shrink: 0; }
/* manage users: oneApp Basic-Table-5-style table (search + filter + add-on-top) */
.usr-add { margin-bottom: 12px; }
.form-grid.usr-add { padding-top: 24px; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; }
@media (max-width: 767px) {
  .table-card-head { padding: 18px; }
}
@media (min-width: 768px) {
  .table-card-head { padding: 24px; }
}
.table-pagesize { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; flex: none; }
.table-pagesize select { width: auto; min-width: 100px; padding: 6px 8px; font-size: 13px; }
@media (max-width: 767.98px) { .table-pagesize { display: none; } }
.table-head-filters { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0; flex: 1; }
.table-business-filter { width: 220px; flex: 0 1 220px; }
.table-business-filter .searchable-select-trigger { min-height: 44px; }
.table-searchbar { position: relative; width: 100%; margin: initial; }
.table-searchbar input { padding-left: 36px; padding-right: 32px; border-color: var(--light-grey); }
.searchbar-icon, .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.searchbar-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; padding: 0; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 50%; }
.searchbar-clear svg { width: 14px; height: 14px; }
@media (max-width: 767px) {
  .table-head-filters { width: 100%; flex-wrap: wrap; gap: 12px; }
  .table-business-filter, .table-searchbar { width: 100%; max-width: none; flex-basis: 100%; }
}
.searchbar-clear:hover { color: var(--text); background: var(--outline-variant); }
.search-ico-wrap, .search-bar-row { position: relative; flex: 1; min-width: 0; }
.search-ico-wrap input { width: 100%; padding-left: 36px; }
@media (min-width: 768px) {
  .d-table > tbody > tr > td {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 767px) {
  .d-table > tbody > tr > td {
    padding-left: 18px;
    padding-right: 18px;
  }
  .d-table > tbody > tr > td.item-meta > .item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }
}
@media (min-width: 768px) {
  .d-table > tbody > tr > td.item-meta > .item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
  }
}
.d-table-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; font-size: 12px; color: var(--muted); background: #fff; border-top: 1px solid var(--outline-variant); }
@media (min-width: 768px) {
  .d-table-footer { padding: 12px 24px; }
}
.table-pager { display: flex; gap: 4px; }
.table-pager .pg-btn { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--outline-variant); background: #fff; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.table-pager .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.table-pager .pg-btn:disabled { opacity: .4; cursor: default; }
/* Items pagination matches the Activities/Reports table footer. */
.d-table-footer .table-info b { color: var(--text-dark); font-weight: var(--font-weight-bold); }
.d-table-footer .table-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.d-table-footer .table-pager .pg-btn { min-width: 40px; height: 40px; padding: 0 10px; border: none; border-radius: 8px; font-size: 14px; font-weight: var(--font-weight-normal); color: #344054; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.d-table-footer .table-pager .pg-btn.pg-nav { border: 1px solid var(--light-grey); }
.d-table-footer .table-pager .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.d-table-footer .table-pager .pg-btn:hover:not(:disabled):not(.active) { background: #F9FAFB; }
.d-table-footer .table-pager .pg-chev { display: block; }
.d-table-footer .table-pager .pg-mobile { display: none; font-size: 14px; font-weight: var(--font-weight-normal); color: #344054; }
@media (max-width: 639.98px) {
  .d-table-footer { flex-direction: column; align-items: stretch; }
  .d-table-footer .table-pager { justify-content: space-between; width: 100%; }
  .d-table-footer .table-pager .pg-mobile { display: inline; }
  .d-table-footer .table-pager .pg-nums { display: none; }
}
@media (max-width: 767px) {
  .d-table-footer .table-info { text-align: center; }
}
.mng-table .table-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 72px; gap: 10px; align-items: center; }
@media (max-width: 767px) {
  .mng-table .table-grid { padding: 12px 18px; }
}
@media (min-width: 768px) {
  .mng-table .table-grid { padding: 12px 24px; }
}
.usr-head, .table-head { background: #F0F2F6; font-size: 11px; font-weight: var(--font-weight-bold); text-transform: uppercase; letter-spacing: .04em; color: #637381; border-bottom: 1px solid var(--outline-variant); }
.usr-head span, .table-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usr-th { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; padding: 0; margin: 0; font-size: 11px; font-weight: var(--font-weight-bold); text-transform: uppercase; letter-spacing: .04em; color: #637381; cursor: pointer; text-align: left; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usr-th:hover { color: var(--primary); }
.usr-th .usr-sort { font-size: 10px; line-height: 1; opacity: .45; color: currentColor; }
.usr-th.sorted { color: var(--primary); }
.usr-th.sorted .usr-sort { opacity: 1; }

.reports-drill-row { cursor: pointer; }
.reports-drill-row:hover { background: #F9FAFB; }
.usr-row:nth-child(even), .table-row:nth-child(even) { background: #FAFBFC; }
.usr-row:last-child, .table-row:last-child { border-bottom: 0; }
.usr-name { min-width: 0; font-weight: var(--font-weight-bold); font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-login { min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-role { font-size: 12px; color: var(--muted); }
/* manage lists (categories/purposes/contact-types/contacts): Manage-User-style table */
.table-grid.cols-1 { grid-template-columns: minmax(0, 1fr) 40px; }
.table-grid.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 40px; }
.table-grid.cols-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); }
.mng-grid.cols-1 { grid-template-columns: minmax(0, 1fr) 92px; }
.mng-grid.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 92px; }
.table-row-display { display: block; width: 100%; min-width: 0; cursor: pointer; }
.table-row-input { width: 100%; min-width: 0; border: 1px solid var(--light-grey); background: #fff; font: inherit; color: inherit; padding: 6px 8px; border-radius: 6px; }
.table-row-input:focus { outline: none; background: #fff; border: 1px solid var(--primary); box-shadow: 0 0 0 3px rgba(70, 95, 255, .12); }
.usr-cell { min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-row .icon-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; justify-content: center; justify-self: center; }
.mng-status-btn { justify-self: center; min-width: 82px; border: 1px solid var(--outline); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; padding: 6px 10px; font: inherit; font-size: 12px; font-weight: var(--font-weight-normal); line-height: 1.2; }
.mng-status-btn.is-active { border-color: rgba(46, 125, 50, .35); background: #EAF6EC; color: #287D32; }
.mng-status-btn.is-inactive { border-color: rgba(117, 117, 117, .35); background: #F2F3F5; color: #6B7280; }
.mng-status-btn:hover { filter: brightness(.97); }
.mng-section .form-grid { grid-template-columns: 1fr; }
/* Manage-* pages: oneApp products-list structure (form-card + full-width table) */
.mng-form-card { margin-bottom: 24px; }
.subs-plan-form { margin-bottom: 24px; }
.mng-form-card .form-card-body { display: flex; flex-direction: column; }
.mng-form-card .form-card-body .btn { align-self: flex-start; }
.mng-pricing-subscription-actions { display: flex; align-items: center; gap: 16px; }
/* Manage-* Name input (Item Category / Activity Purpose / Contact): oneApp gray-300 border var(--light-grey) + h-11 control (Aug 2026) */
.mng-form-card .field input,
.mng-form-card .field input {
  height: 44px; min-height: 44px;
  border: 1px solid var(--light-grey); /* gray-300 */
  border-radius: 8px;
  background: #fff;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-dark);
  box-shadow: none;
}
.mng-form-card .field input:focus,
.mng-form-card .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(70, 101, 255, .12);
}
.mng-list-card { padding: 0; overflow: hidden; }

.mng-semantic-table-wrap { width: 100%; overflow-x: auto; }
.mng-semantic-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.mng-semantic-table td { padding: 12px 24px; text-align: left; vertical-align: middle; }
.mng-semantic-table thead { display: table-header-group; }
.mng-semantic-table tbody { display: table-row-group; }
.mng-semantic-table tr { display: table-row; }
.mng-semantic-table thead { border-top: 1px solid var(--outline-variant); }
.mng-semantic-table thead tr { background: #F9FAFB; border-bottom: 1px solid #EAECF0; }
.mng-semantic-table > tbody > tr { border-bottom: 1px solid var(--outline-variant); }
.mng-semantic-table > tbody > tr:last-child { border-bottom: none; }
.mng-semantic-table th { background: var(--surface-variant); color: var(--muted); font-size: 13px; font-weight: var(--font-weight-normal); text-align: left; vertical-align: middle; white-space: nowrap; padding-top: 12px; padding-bottom: 12px; }
.mng-semantic-table > thead > tr > th:last-child,
.mng-semantic-table > tbody > tr > td:last-child { text-align: center; }

.mng-semantic-table tbody tr:nth-child(even) { background: #fff; }
.mng-semantic-table tbody tr:hover { background: #F9FAFB; }
.mng-semantic-table th .table-head-sort { width: 100%; }
.mng-semantic-table .mng-status-btn { margin-left: 0; }
.mng-status-label { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: var(--font-weight-normal); line-height: 1.2; white-space: nowrap; }
.mng-status-label.is-active { background: #EAF6EC; border-color: rgba(46, 125, 50, .35); color: #287D32; }
.mng-status-label.is-inactive { background: #F2F3F5; border-color: rgba(117, 117, 117, .35); color: #6B7280; }
.mng-actions-cell { position: relative; width: 56px; text-align: center !important; }
.mng-semantic-table td.mng-actions-cell .mng-menu-btn { margin-left: 0; }
.mng-table > .mng-semantic-table-wrap > .mng-semantic-table:not(.pricing-plans-semantic-table):not(.users-table) th:first-child,
.mng-table > .mng-semantic-table-wrap > .mng-semantic-table:not(.pricing-plans-semantic-table):not(.users-table) td:first-child { width: 50%; }
.mng-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.mng-menu-btn:hover, .mng-menu-btn[aria-expanded="true"] { background: #F2F4F7; color: var(--text); }
.mng-action-menu { top: 36px; right: 8px; min-width: 190px; max-width: 320px; z-index: 130; }
.users-table { table-layout: fixed; width: 100%; }
.users-table th, .users-table td { width: 20%; }
.users-table th:first-child, .users-table td:first-child { width: 30%; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 30%; }
.platform-owner-users-table th:nth-child(1), .platform-owner-users-table td:nth-child(1) { width: 23%; }
.platform-owner-users-table th:nth-child(2), .platform-owner-users-table td:nth-child(2) { width: 23%; }
.platform-owner-users-table th:nth-child(3), .platform-owner-users-table td:nth-child(3) { width: 20%; }
.platform-owner-users-table th:nth-child(4), .platform-owner-users-table td:nth-child(4) { width: 16%; }
.platform-owner-users-table th:nth-child(5), .platform-owner-users-table td:nth-child(5) { width: 10%; }
.platform-owner-users-table th:nth-child(6), .platform-owner-users-table td:nth-child(6) { width: 8%; }
.pricing-plans-semantic-table { min-width: 1000px; table-layout: auto; }
.pricing-plans-semantic-table th:nth-child(1) { min-width: 140px; }
.pricing-plans-semantic-table th:nth-child(2), .pricing-plans-semantic-table th:nth-child(3) { min-width: 110px; }
.pricing-plans-semantic-table th:nth-child(10) { min-width: 260px; }
.pricing-plans-semantic-table th:last-child { min-width: 64px; }
.pricing-plans-semantic-table .pricing-plan-actions { text-align: center; }
@media (max-width: 767px) {
  .mng-semantic-table td { padding: 12px 18px; }
  .mng-semantic-table th { padding-left: 18px; padding-right: 18px; }
  .pricing-plans-table-wrap { overflow-x: auto; }
  .pricing-plans-semantic-table { min-width: 0; table-layout: fixed; }
  .pricing-plans-semantic-table th:nth-child(2), .pricing-plans-semantic-table td:nth-child(2),
  .pricing-plans-semantic-table th:nth-child(3), .pricing-plans-semantic-table td:nth-child(3),
  .pricing-plans-semantic-table th:nth-child(4), .pricing-plans-semantic-table td:nth-child(4),
  .pricing-plans-semantic-table th:nth-child(5), .pricing-plans-semantic-table td:nth-child(5),
  .pricing-plans-semantic-table th:nth-child(6), .pricing-plans-semantic-table td:nth-child(6),
  .pricing-plans-semantic-table th:nth-child(7), .pricing-plans-semantic-table td:nth-child(7) { display: none; }
  .pricing-plans-semantic-table th:nth-child(1), .pricing-plans-semantic-table td:nth-child(1) { width: auto; }
  .pricing-plans-semantic-table th:nth-child(11), .pricing-plans-semantic-table td:nth-child(11) { width: 96px; }
  .pricing-plans-semantic-table th:nth-child(12), .pricing-plans-semantic-table td:nth-child(12) { width: 72px; }
}
@media (min-width: 768px) {
  .mng-semantic-table th { padding-left: 24px; padding-right: 24px; }
}
.reports-standard-table-wrap { width: 100%; overflow-x: auto; }
.reports-standard-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; background: #fff; }
.reports-standard-table th, .reports-standard-table td { padding: 12px 24px; border-bottom: 1px solid var(--outline-variant); text-align: left; vertical-align: middle; }
.reports-standard-table th { background: #F0F2F6; color: #637381; font-size: 12px; font-weight: var(--font-weight-bold); }
.reports-standard-table td { color: var(--text); font-size: 13px; }
.reports-standard-table tbody tr:hover { background: #F9FAFB; }
.reports-standard-table th .table-head-sort { width: 100%; }
.reports-standard-table tr[data-br-id], .reports-standard-table tr[data-adj-i] { cursor: pointer; }
.reports-standard-table .rep-act-qty { display: table-cell; }
@media (max-width: 767px) {
  .reports-standard-table th, .reports-standard-table td { padding: 12px 18px; }
  .reports-detail-table { min-width: 900px; }
}

.mng-list-card .usr-head, .mng-list-card .table-head { background: #fff; border-bottom: 1px solid #E4E7EC; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: var(--font-weight-normal); color: #667085; }
.mng-list-card .usr-th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: var(--font-weight-normal); color: #667085; }
.mng-list-card .usr-row:nth-child(even), .mng-list-card .table-row:nth-child(even) { background: #fff; }
.mng-list-card .usr-row:hover, .mng-list-card .table-row:hover { background: #F9FAFB; }
.mng-list-card .d-table-footer { border-top: 1px solid #E4E7EC; }
.mng-list-card .table-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mng-list-card .table-pager .pg-btn {
  min-width: 40px; height: 40px; padding: 0 10px;
  border: none; border-radius: 8px; font-size: 14px; font-weight: var(--font-weight-normal);
  color: #344054; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.mng-list-card .table-pager .pg-btn.pg-nav { border: 1px solid var(--light-grey); }
.mng-list-card .table-pager .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mng-list-card .table-pager .pg-btn:hover:not(:disabled):not(.active) { background: #F9FAFB; }
.mng-list-card .table-pager .pg-btn:disabled { opacity: .5; }
.mng-list-card .table-pager .pg-chev { display: block; }
.mng-list-card .table-pager .pg-ell { color: #667085; padding: 0 2px; font-size: 14px; }
.mng-list-card .table-pager .pg-mobile { display: none; font-size: 14px; font-weight: var(--font-weight-normal); color: #344054; }
@media (max-width: 639.98px) {
  .mng-list-card .d-table-footer { flex-direction: column; align-items: stretch; gap: 12px; }
  .mng-list-card .table-pager { justify-content: space-between; width: 100%; }
  .mng-list-card .table-pager .pg-mobile { display: inline; }
  .mng-list-card .table-pager .pg-nums { display: none; }
}
/* saved subscription plans: same Basic-Table pattern as Manage User List */
.pricing-plans-table { margin-top: 0; }
.pricing-plans-card .table-card-head { justify-content: space-between; }
.pricing-plans-grid {
  grid-template-columns: minmax(140px, 1fr) minmax(110px, .8fr) minmax(110px, .8fr) minmax(100px, .75fr) minmax(90px, .55fr) minmax(90px, .55fr) minmax(260px, 2fr) minmax(180px, 1.2fr) minmax(100px, .75fr) 40px !important;
  min-width: 1500px;
}
.pricing-plan-name { min-width: 0; font-weight: var(--font-weight-bold); font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pricing-plan-cell { min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pricing-plan-price { color: var(--text); font-variant-numeric: tabular-nums; }
.pricing-plan-description { white-space: nowrap; }
.pricing-plans-grid[data-plan-id] { cursor: pointer; }
.pricing-plans-grid[data-plan-id]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.pricing-plans-grid .pricing-plan-status { display: flex; align-items: center; }
.pricing-plans-grid .pricing-plan-actions { cursor: default; }
.pricing-plans-grid .pricing-plan-actions, .pricing-plan-actions-header { min-width: 0; display: flex; align-items: center; justify-content: center; }
.pricing-plan-actions .icon-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; cursor: pointer; }
.pricing-plans-semantic-table td.pricing-plan-status { display: table-cell; }
.pricing-plans-semantic-table td.pricing-plan-actions { display: table-cell; text-align: center; }
.pricing-plans-semantic-table th.pricing-plan-status-header { min-width: 100px; }
.pricing-plans-semantic-table th.pricing-plan-actions-header { width: 100%; text-align: center; }
.pricing-plans-semantic-table td.pricing-plan-actions { width: 84px; min-width: 84px; }
.pricing-plans-semantic-table tbody tr[data-plan-id] { cursor: pointer; }
.pricing-plans-semantic-table tbody tr[data-plan-id]:hover { background: #F9FAFB; }
.pricing-plans-semantic-table th:nth-child(10), .pricing-plans-semantic-table td:nth-child(10) { display: none; }
.pricing-plan-actions-header { font-size: 12px; font-weight: var(--font-weight-normal); color: #667085; }
.pricing-plan-menu { top: auto; right: auto; min-width: 150px; }
.pricing-plans-empty { min-width: 1500px; }
.pricing-plans-card .pricing-plans-table { overflow-x: auto; }
.pricing-plans-card .pricing-plans-table > .table-card-head { min-width: 0; }
.pricing-plan-detail-modal { max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto; }
.pricing-plan-detail-list { margin: 0; }
.pricing-plan-detail-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 12px 0; border-bottom: 1px solid var(--outline-variant);
}
.pricing-plan-detail-row:last-child { border-bottom: 0; }
.pricing-plan-detail-label { color: #667085; font-size: 13px; }
.pricing-plan-detail-value { max-width: 62%; color: #344054; font-size: 14px; font-weight: var(--font-weight-normal); text-align: right; word-break: break-word; }
@media (min-width: 768px) {
  .mng-table .pricing-plans-grid {
    grid-template-columns: 12% 8% 8% 7% 10% 10% 20% 12% 8% 5% !important;
    min-width: 0;
    gap: 0;
  }
  .pricing-plans-empty,
  .pricing-plans-card .pricing-plans-table > .table-card-head { min-width: 0; }
}
@media (max-width: 767px) {
  .pricing-plans-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr) minmax(0, 1fr) 40px !important;
    min-width: 0;
  }
  .pricing-plans-grid > :nth-child(4),
  .pricing-plans-grid > :nth-child(5),
  .pricing-plans-grid > :nth-child(6),
  .pricing-plans-grid > :nth-child(7),
  .pricing-plans-grid > :nth-child(8),
  .pricing-plans-grid > :nth-child(9) { display: none; }
  .pricing-plans-grid > :nth-child(10) { display: flex; }
  .pricing-plans-empty,
  .pricing-plans-card .pricing-plans-table > .table-card-head { min-width: 0; }
}
/* reports: oneApp Basic-Table-5-style report table */
.rep-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rep-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  min-width: 660px;
}
.rep-center { text-align: center; }
.rep-right { text-align: right; }
/* Activities table row (Reports > Activities): renamed span classes. */
.content-card.reports .table-row[data-act-i] .report-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.content-card.reports .table-row[data-act-i] .report-qty { white-space: nowrap; font-variant-numeric: tabular-nums; }
.content-card.reports .table-row[data-act-i] .category { min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-card.reports .table-row[data-act-i] .activity-type { min-width: 0; font-size: 13px; color: var(--text); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-card.reports .table-row[data-act-i] .purpose { min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-card.reports .table-row[data-act-i] .item-name { min-width: 0; font-weight: var(--font-weight-bold); font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-card.reports .table-row[data-act-i] .rep-time::before { content: ' '; }
@media (max-width: 767px) {
  /* Activities: show the date first and HH:mm directly below it. */
  .content-card.reports .table-row[data-act-i] .report-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.25;
    white-space: normal;
  }
  .content-card.reports .table-row[data-act-i] .rep-time {
    font-size: 11px;
  }
  .content-card.reports .table-row[data-act-i] .rep-time::before { content: none; }
}
.rep-num { min-width: 0; text-align: right; font-size: 13px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-qty { text-align: center; font-size: 13px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-income { font-weight: var(--font-weight-bold); }
.rep-purpose { min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-total .rep-num { font-weight: var(--font-weight-extra-bold); }
/* reports: receive summary table (Category | Cost, Aug 2026) */
.rep-cat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
}
/* reports: sell summary table (Period | Cost | Income, Aug 2026) */
.rep-cat-grid.rep-sell-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-head-sort {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 0;
  font: inherit; color: inherit; cursor: pointer; min-width: 0;
}
.table-head-sort:hover { color: var(--primary); }
.table-head-sort.active { color: var(--primary); }
.table-head-sort .rep-sort-ico { flex-shrink: 0; opacity: .8; }
.table-head-sort.rep-right { margin-left: auto; }
.rep-cat-grid.rep-total .rep-total-label { grid-column: auto; }
/* reports: From/To labeled date pickers (side by side) */
.date-range, .date-range-filter { display: flex; gap: 10px; align-items: flex-end; }
.date-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.date-field label { font-size: 12px; font-weight: var(--font-weight-normal); color: var(--muted); }
.date-field input { width: 100%; }
/* reports: calendar icon + popover (oneApp datepicker) */
.cal-field { position: relative; }
.cal-field input[type="text"] { padding-right: 40px; height: 44px; cursor: pointer; border: 1px solid var(--light-grey); }
.cal-icon {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: none; background: transparent;
  color: var(--muted); border-radius: 6px; cursor: pointer; padding: 0;
}
.cal-icon:hover { background: var(--surface-container); color: var(--text); }
.cal-pop {
  position: fixed; z-index: 300; width: 288px;
  background: #fff; border: 1px solid var(--outline-variant);
  border-radius: 12px; box-shadow: 0 12px 24px -4px rgba(16, 24, 40, .18), 0 8px 16px -8px rgba(16, 24, 40, .14);
  padding: 12px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title {
  font-size: 15px; font-weight: var(--font-weight-bold); color: var(--text);
  border: none; background: transparent; cursor: pointer; padding: 4px 10px; border-radius: 6px;
}
.cal-title:hover { background: var(--surface-container); color: var(--text); }
.cal-nav {
  width: 30px; height: 30px; border: none; background: transparent; border-radius: 6px;
  color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-nav:hover { background: var(--surface-container); color: var(--text); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; font-weight: var(--font-weight-bold); color: var(--outline); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
  height: 34px; border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--text); font-size: 13px; font-weight: var(--font-weight-normal);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.cal-day:hover { background: var(--surface-container); }
.cal-day.out { color: var(--outline); }
.cal-day.sel { border-color: var(--outline); }
/* year picker view (click the title year) */
.cal-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-year {
  height: 40px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 14px; font-weight: var(--font-weight-normal);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.cal-year:hover { background: var(--surface-container); }
.cal-year.sel { border-color: var(--outline); }
/* reports: filter card (oneApp "Default Inputs" style) */
/* merged card head (products-list style): title left, tabs+Download right, bottom divider */
.content-card.reports > .content-card-head {
  position: relative; z-index: 40;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--gap-card-filters);
  padding: 18px; flex-wrap: wrap;
}
/* title alone on the LEFT; tabs + Download grouped on the RIGHT */

.reports-right-head { display: flex; align-items: center; gap: 16px; flex-shrink: 0; margin-left: auto; }
.content-card.reports > .content-card-filters .date-range-filter { gap: 16px; }
.reports-right-head .reports-tabs { flex-shrink: 0; }
.reports-right-head .searchable-select { flex: 0 1 200px; width: 200px; min-width: 150px; }
.reports-right-head #activitiesBusinessFilter {
  width: 200px; height: 44px; padding: 10px 12px;
  border: 1px solid var(--outline); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
/* mobile (<768): wrapped row — tabs LEFT, Download RIGHT */
@media (max-width: 767.98px) {
  .reports-right-head { width: 100%; margin-left: 0; justify-content: space-between; flex-wrap: wrap; }
  .reports-right-head .searchable-select { flex: 1 1 100%; width: 100%; min-width: 0; }
  .reports-right-head .reports-tabs { min-width: 0; max-width: 100%; }
}
@media (min-width: 768px) {
  .content-card.reports > .content-card-head { padding: 24px; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
  .content-card.reports > .content-card-head { flex-direction: column; align-items: stretch; }
  .content-card.reports > .content-card-head .content-card-title { width: 100%; }
  .content-card.reports > .content-card-head .reports-right-head { flex: 1 1 100%; width: 100%; margin-left: 0; justify-content: flex-end; }
}
.reports-download-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--light-grey); background: #fff;
  font-size: 14px; font-weight: var(--font-weight-normal); color: #344054;
  cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.reports-download-btn:hover { background: #F9FAFB; }
/* search + From/To/Filter on ONE row: search LEFT, dates+Filter RIGHT (≥768) */
.content-card.reports > .content-card-filters {
  flex-direction: column;
}
.left-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  width: 100%;
}
.search-bar-wrapper { width: 100%; }
.search-bar-wrapper > p { color: var(--muted); margin: 0 0 10px; font-size: 12px; font-weight: var(--font-weight-bold); }
.content-card.reports > .content-card-filters .search-bar-wrapper { flex: 1 1 0; min-width: 0; }
.content-card.reports > .content-card-filters .search-bar-row { flex: 1 1 0; min-width: 0; max-width: none; width: 100%; }
.content-card.reports > .content-card-filters .search-bar-row input {
  width: 100%; padding: 10px 16px 10px 44px;
  border-radius: 8px; border: 1px solid var(--light-grey); background: #fff;
  font-size: 14px; color: var(--text);
}
.content-card.reports > .content-card-filters .search-icon { left: 16px; }
/* Type dropdown beside the LEFT of the search bar */
.content-card.reports > .content-card-filters .reports-type-field { min-width: 150px; }
.content-card.reports > .content-card-filters .reports-type-field select {
  width: 100%; height: 44px; padding: 0 44px 0 16px;
  border-radius: 8px; border: 1px solid var(--light-grey); background-color: #fff;
  font-size: 14px; color: var(--text); appearance: none; -webkit-appearance: none; cursor: pointer;
}
.content-card.reports > .content-card-filters .reports-type-field > label { margin-bottom: 6px; }
/* ≥768: search LEFT, From/To/Filter RIGHT on one row */
@media (min-width: 1200px) {
  .content-card.reports > .content-card-filters { flex-direction: row; align-items: flex-end; }
  .content-card.reports > .content-card-filters .search-bar-row { flex: 1 1 auto; min-width: 0; }
  .content-card.reports .date-range-filter { flex: 0 1 auto; min-width: 0; }
  .content-card.reports .date-range-filter .date-field { min-width: 150px; }
}
@media (max-width: 767.98px) {
  .search-bar-wrapper { display: flex; flex-direction: column-reverse; }
  .search-bar-wrapper > p { margin-top: 10px; margin-bottom: 0; }
  .content-card.reports > .content-card-filters .search-bar-row { max-width: 100%; }
}
@media (max-width: 639.98px) {
  .content-card.reports > .content-card-filters .search-bar-row { max-width: none; width: 100%; }
}
.reports-tabs { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; background: #f2f4f7; border-radius: 8px; padding: 2px; width: fit-content; max-width: 100%; }
.rep-filter-btn {
  flex-shrink: 0; height: 44px; padding: 10px 18px;
  border-radius: 8px; border: 1px solid var(--light-grey); background: #fff;
  font-size: 14px; font-weight: var(--font-weight-normal); color: #344054;
  cursor: pointer; transition: background .15s;
}
.rep-filter-btn:hover { background: #F9FAFB; }
.content-card.reports .date-range-filter { border-bottom: none; width: 100%; }
.content-card.reports .date-range-filter .rep-filter-btn { margin-left: auto; }
@media (min-width: 768px) {
  .content-card.reports .date-range-filter { align-items: flex-start; }
  .content-card.reports .date-range-filter .rep-filter-btn { margin-top: 22px; }
}
@media (max-width: 767.98px) {
  .date-range, .date-range-filter { flex-direction: column; align-items: normal; }
  .content-card.reports .date-range-filter .rep-filter-btn { align-self: flex-start; margin-left: 0; }
}
.reports-field > label { display: block; font-size: 13px; font-weight: var(--font-weight-normal); color: var(--text); margin-bottom: 6px; }
.reports-field input, .reports-field select { width: 100%; }
.content-card.reports .date-field label { color: var(--text); font-size: 13px; font-weight: var(--font-weight-normal); }
/* merged card: results section */
.content-card.reports .mng-table { border: none; border-radius: 0; margin-top: 0; }
@media (max-width: 767.98px) {
  .content-card.reports .mng-table > .muted { padding: 12px 18px; }
}
@media (min-width: 768px) {
  .content-card.reports .mng-table > .muted { padding: 12px 24px; }
}
/* reports: activities table (Time | Item | Category | Activity | Purpose | Qty) */
.table-head, .table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.table-head { font-size: 13px; }
@media (max-width: 767.98px) {
  .table-head, .table-row { padding: 14px 18px; }
}
/* tablet/web: widen Item, Category, and Purpose while keeping Qty compact */
@media (min-width: 768px) {
  .table-head, .table-row { padding: 16px 24px; }
  .table-head, .table-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1.35fr) minmax(0, .8fr) minmax(0, 1.35fr) 72px; }
}
.rep-act-qty { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Activities table: move Category, Activity, and Purpose slightly farther right. */
.content-card.reports .mng-table .table-head > span:nth-child(3),
.content-card.reports .mng-table .table-row > span:nth-child(3),
.content-card.reports .mng-table .table-head > span:nth-child(4),
.content-card.reports .mng-table .table-row > span:nth-child(4),
.content-card.reports .mng-table .table-head > span:nth-child(5),
.content-card.reports .mng-table .table-row > span:nth-child(5) { padding-left: 24px; }
/* Activities table: keep Qty at the right edge of its final column. */
.content-card.reports .mng-table .table-head .rep-right,
.content-card.reports .mng-table .table-row .report-qty { justify-self: end; }
.content-card.reports .mng-table .table-head .rep-right { text-align: right; }
@media (max-width: 767.98px) {
  .content-card.reports .mng-table .table-head,
  .content-card.reports .mng-table .table-row {
    grid-template-columns: 78px minmax(0, 1fr) 64px 52px;
    gap: 8px;
  }
  .content-card.reports .mng-table .table-head > span:nth-child(3),
  .content-card.reports .mng-table .table-row > span:nth-child(3),
  .content-card.reports .mng-table .table-head > span:nth-child(5),
  .content-card.reports .mng-table .table-row > span:nth-child(5) { display: none; }
  .content-card.reports .mng-table .table-head > span:nth-child(1),
  .content-card.reports .mng-table .table-row > span:nth-child(1),
  .content-card.reports .mng-table .table-head > span:nth-child(2),
  .content-card.reports .mng-table .table-row > span:nth-child(2),
  .content-card.reports .mng-table .table-head > span:nth-child(4),
  .content-card.reports .mng-table .table-row > span:nth-child(4) { padding-left: 0; }
  .content-card.reports .mng-table .table-head .rep-right,
  .content-card.reports .mng-table .table-row .report-qty {
    justify-self: center;
    text-align: center;
  }
}
@media (max-width: 767px) {
  /* Mobile Activities: inset Item/Activity and pin Qty to the far right. */
  .content-card.reports .mng-table .table-head > span:nth-child(2),
  .content-card.reports .mng-table .table-row > span:nth-child(2),
  .content-card.reports .mng-table .table-head > span:nth-child(4),
  .content-card.reports .mng-table .table-row > span:nth-child(4) { padding-left: 8px; }
  .content-card.reports .mng-table .table-head .rep-right,
  .content-card.reports .mng-table .table-row .report-qty {
    justify-self: end;
    text-align: right;
  }
}
/* reports: borrow/return table (Item | Borrower | Borrow/Return, Aug 2026) */
.rep-br-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}
.rep-br-item { min-width: 0; font-size: 13px; font-weight: var(--font-weight-normal); color: #344054; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-br-borrower { min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-br-date { font-variant-numeric: tabular-nums; }
/* borrow/return rows are tappable → S4c detail sheet */
.rep-br-grid[data-br-id] { cursor: pointer; }
.rep-br-grid[data-br-id]:hover { background: #F9FAFB; }
/* activities rows are tappable → activity detail sheet */
.table-row[data-act-i] { cursor: pointer; }
.table-row[data-act-i]:hover { background: #F9FAFB; }
/* adjustment rows are tappable → activity detail sheet (Aug 2026) */
.rep-adj-grid[data-adj-i] { cursor: pointer; }
.rep-adj-grid[data-adj-i]:hover { background: #F9FAFB; }
/* ---------- borrowing detail sheet (S4c) ---------- */
.br-title { font-size: 20px; font-weight: var(--font-weight-extra-bold); color: var(--text-dark); padding: 4px 0 10px; }
/* borrowing detail — oneApp alert components (Success/Warning/Error) + trend pills (Aug 2026) */
.br-alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 12px; padding: 12px 14px;
  border: 1px solid transparent;
  margin: 8px 0;
}
.br-alert-success { background: #ECFDF3; border-color: #12B76A; }
.br-alert-warning { background: #FFFAEB; border-color: #F79009; }
.br-alert-error   { background: #FEF3F2; border-color: var(--red-watermark); }
.br-alert-icon { flex: none; line-height: 0; margin-top: 1px; }
.br-alert-success .br-alert-icon { color: #12B76A; }
.br-alert-warning .br-alert-icon { color: #F79009; }
.br-alert-error   .br-alert-icon { color: var(--red-watermark); }
.br-alert-title { font-size: 14px; font-weight: var(--font-weight-bold); color: var(--text-dark); margin: 0 0 3px; }
.br-alert-body { font-size: 14px; color: #667085; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.br-trend-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: var(--font-weight-bold); line-height: 1.7; }
.br-trend-pill.red  { background: #FEF3F2; color: var(--red); }
.br-trend-pill.blue { background: #EFF6FF; color: #2563EB; }
/* borrowing detail — plain borrow/return rows (outside alert components, Aug 2026) */
.br-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 2px; }
.br-row .br-lbl { color: #667085; font-size: 14px; }
.br-row .br-val { font-weight: var(--font-weight-bold); color: var(--text-dark); font-size: 14px; }
.br-qty { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #344054; }
.br-date { color: #667085; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.br-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 10px; padding: 10px 14px; font-size: 14px;
}
.br-borrower-banner { background: #FFF8E1; color: #4A3B00; }
.br-borrower-banner strong { font-weight: var(--font-weight-bold); color: var(--text-dark); }
.br-qty-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 2px; }
.br-borrowed-qty { color: var(--red); font-weight: var(--font-weight-bold); font-size: 15px; }
.br-qty-date { color: #667085; font-size: 13px; font-variant-numeric: tabular-nums; }
.br-status-banner { border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 2px 0 6px; }
.br-status-done { background: var(--pill-green-bg); color: var(--pill-green-text); }
.br-status-open { background: #FEF3F2; color: var(--red); }
.br-section-head { font-size: 13px; font-weight: var(--font-weight-bold); color: var(--text-dark); padding: 12px 0 4px; }
.br-return-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--outline-variant); }
.br-return-row:last-child { border-bottom: none; }
.br-ret-qty { color: #175CD3; font-weight: var(--font-weight-bold); font-size: 14px; }
.br-ret-date { color: #667085; font-size: 13px; font-variant-numeric: tabular-nums; }
/* ---------- activity detail sheet (item-detail Recent Activity row tap) ---------- */
.activity-detail-title { font-size: 20px; font-weight: var(--font-weight-extra-bold); color: var(--text); padding-bottom: 24px; }
.activity-detail-item-link { display: block; text-decoration: none; cursor: pointer; }
.activity-detail-item-link:hover { color: #175CD3; }
.activity-detail-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--outline-variant); }
.activity-detail-row:last-child { border-bottom: none; }
.activity-detail-row:has(+ .activity-detail-fifo) { border-bottom: none; }
.activity-detail-row:has(+ .activity-detail-invoice-image) { border-bottom: none; }
.activity-detail-label { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.activity-detail-value { color: var(--text); font-weight: var(--font-weight-normal); text-align: right; word-break: break-word; }
.activity-detail-fifo { margin-top: 12px; }
.activity-detail-fifo-title { font-size: 13px; font-weight: var(--font-weight-bold); color: var(--text); margin-bottom: 8px; background: var(--primary-container); padding: 12px 24px; margin-left: -24px; margin-right: -24px; }
.activity-detail-fifo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.activity-detail-fifo-table th { text-align: left; color: var(--muted); font-weight: var(--font-weight-bold); padding: 12px 0; border-bottom: 1px solid var(--outline-variant); }
.activity-detail-fifo-table td { color: var(--text); padding: 12px 0; border-bottom: 1px solid var(--outline-variant); }
.activity-detail-fifo-table tr:last-child td { border-bottom: none; }
.activity-detail-fifo-table th:last-child,
.activity-detail-fifo-table td:last-child { text-align: right; }
.fifo-qty-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: var(--font-weight-normal); text-align: center; background: #fef3f2; color: var(--red); }
/* Scan Invoice photos, shown below Admin on a Receive activity's detail
   sheet — shared by every item that was linked from the same invoice.
   Single page fills the width; 2+ pages lay out as a thumbnail grid. */
.activity-detail-invoice-image { margin-top: 12px; }
.activity-detail-invoice-image > .activity-detail-label { display: block; margin-bottom: 8px; }
.activity-detail-invoice-gallery { display: grid; grid-template-columns: 1fr; gap: 8px; }
.activity-detail-invoice-gallery:has(.activity-detail-invoice-img:nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-detail-invoice-img { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; border: 1px solid var(--outline-variant); background: var(--surface-variant); cursor: zoom-in; }
.activity-detail-invoice-gallery:has(.activity-detail-invoice-img:nth-child(2)) .activity-detail-invoice-img { max-height: 180px; object-fit: cover; }
.business-detail-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px; border-bottom: none; }
.business-detail-row:last-child { border-bottom: none; }
.business-detail-label { color: var(--text); font-size: 13px; flex-shrink: 0; }
.business-detail-value { color: var(--text); font-size: 13px; font-weight: var(--font-weight-normal); text-align: right; word-break: break-word; }
.compare-item-name { display: block; text-align: left; padding: 4px 2px 10px; }
.compare-item-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 2px 0 10px; }
.compare-item-image-wrap { min-width: 0; width: 100%; }
.compare-item-image { display: block; width: 100%; aspect-ratio: 1; height: auto; border: 1px solid var(--outline-variant); border-radius: 10px; object-fit: cover; }
.activity-detail-value.qty-plus,
.activity-detail-value.qty-minus,
.activity-detail-value.qty-in {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: var(--font-weight-normal); text-align: center;
}
.activity-detail-value.qty-plus { background: #eff6ff; color: #175CD3; }
.activity-detail-value.qty-minus { background: #fef3f2; color: var(--red); }
.activity-detail-value.qty-in { background: #eff6ff; color: #175CD3; }
/* activity-detail body: plain block container (not .sheet-body's flex column) —
   iOS Safari can fail to reflow a flex+overflow column after innerHTML, clipping it to 0 height */
.act-body { padding: 24px; overflow-y: auto; }
@media (max-width: 767px) {
  .act-body { padding: 14px 18px; }
}
/* same for the sheet itself: block, not flex column, so the body always sizes to content */
#actSheet { display: block; }
/* New Activity modal (itemAct sheet): form control borders gray-300 var(--light-grey) (user: "update the form input type border color: var(--light-grey)") */
#itemActSheet select,
#itemActSheet textarea { border: 1px solid var(--light-grey); }
#itemActSheet .qty-btn { border-color: var(--light-grey); }
.act-table .act-row[data-i] { cursor: pointer; }
.act-table .act-row[data-i]:active { background: #F9FAFB; }
/* reports: adjustment table (Date | Item | Adj Qty, Aug 2026) */
.rep-adj-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}
/* reports activities qty — oneApp Products List stock pill, same as item-detail Recent Activity (Aug 2026) */
.content-card.reports .table-head .rep-act-qty,
.content-card.reports .rep-adj-grid .rep-act-qty {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: var(--font-weight-normal); text-align: center;
  justify-self: center; /* grid items blockify — keep the pill compact, not a full-column bar */
}
.content-card.reports .table-row .report-qty {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: var(--font-weight-normal); text-align: center;
  justify-self: center; /* grid items blockify — keep the pill compact, not a full-column bar */
}
.content-card.reports .table-row .report-qty.qty-plus { background: rgb(239, 246, 255); color: rgb(23, 92, 211); font-weight: var(--font-weight-bold); }
.content-card.reports .table-head .rep-act-qty.qty-plus,
.content-card.reports .rep-adj-grid .rep-act-qty.qty-plus { background: #E8EDFB; color: #4169E1; font-weight: var(--font-weight-bold); }
.content-card.reports .table-head .rep-act-qty.qty-minus,
.content-card.reports .table-row .report-qty.qty-minus,
.content-card.reports .rep-adj-grid .rep-act-qty.qty-minus { background: #fef3f2; color: var(--red); }
.content-card.reports .table-row .report-qty.qty-minus,
.content-card.reports .rep-adj-grid .rep-act-qty.qty-minus { padding: 2px 10px; }
.content-card.reports .table-head .rep-act-qty.qty-in,
.content-card.reports .table-row .report-qty.qty-in,
.content-card.reports .rep-adj-grid .rep-act-qty.qty-in { background: #eff6ff; color: #175CD3; }
.content-card.reports .table-row .report-qty.qty-in { padding: 2px 6px !important; }
.content-card.reports .table-head .rep-act-qty:not(.qty-plus):not(.qty-minus):not(.qty-in),
.content-card.reports .table-row .report-qty:not(.qty-plus):not(.qty-minus):not(.qty-in),
.content-card.reports .rep-adj-grid .rep-act-qty:not(.qty-plus):not(.qty-minus):not(.qty-in) { background: #f2f4f7; color: #475467; }
/* adjustment: keep the pill right-aligned under the "Adj Qty" header (Aug 2026) */
.content-card.reports .rep-adj-grid .rep-act-qty { justify-self: end; }
.content-card.reports .table-head .rep-right { text-align: center; }
/* reports tables — oneApp Products List card style (Aug 2026, same as item-detail Recent Activity) */
.content-card.reports .usr-head,
.content-card.reports .table-head {
  background: #fff; font-weight: var(--font-weight-normal);
  text-transform: none; letter-spacing: normal; color: #667085;
}
.content-card.reports .usr-head { font-size: 12px; }
.content-card.reports .usr-row,
.content-card.reports .table-row { background: #fff; }
.content-card.reports .usr-row:nth-child(even) { background: #fff; }
.content-card.reports .table-row:not(.rep-total):hover,
.content-card.reports .usr-row:not(.rep-total):hover { background: #F9FAFB; }
.content-card.reports .rep-grid,
.content-card.reports .rep-br-grid,
.content-card.reports .rep-adj-grid { padding: 16px 20px; }
@media (min-width: 1200px) {
  .content-card.reports .rep-grid,
  .content-card.reports .rep-br-grid,
  .content-card.reports .rep-adj-grid {
    padding-left: 24px;
    padding-right: 24px;
  }
}
/* summary tables follow their visible column count, not the Activities grid */
.content-card.reports .mng-table .table-head.rep-cat-grid,
.content-card.reports .mng-table .table-row.rep-cat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.content-card.reports .mng-table .table-head.rep-cat-grid.rep-sell-grid,
.content-card.reports .mng-table .table-row.rep-cat-grid.rep-sell-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* Reports pagination — oneApp products-list style (Aug 2026) */
.content-card.reports .d-table-footer .table-info b { color: var(--text-dark); font-weight: var(--font-weight-bold); }
.content-card.reports .table-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.content-card.reports .table-pager .pg-btn {
  min-width: 40px; height: 40px; padding: 0 10px;
  border: none; border-radius: 8px; font-size: 14px; font-weight: var(--font-weight-normal);
  color: #344054; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.content-card.reports .table-pager .pg-btn.pg-nav { border: 1px solid var(--light-grey); }
.content-card.reports .table-pager .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.content-card.reports .table-pager .pg-btn:hover:not(:disabled):not(.active) { background: #F9FAFB; }
.content-card.reports .table-pager .pg-btn:disabled { opacity: .5; }
.content-card.reports .table-pager .pg-chev { display: block; }
.content-card.reports .table-pager .pg-ell { color: #667085; padding: 0 2px; font-size: 14px; }
.content-card.reports .table-pager .pg-mobile { display: none; font-size: 14px; font-weight: var(--font-weight-normal); color: #344054; }
@media (max-width: 639.98px) {
  .content-card.reports .d-table-footer { flex-direction: column; align-items: stretch; gap: 12px; }
  .content-card.reports .table-pager { justify-content: space-between; width: 100%; }
  .content-card.reports .table-pager .pg-mobile { display: inline; }
  .content-card.reports .table-pager .pg-nums { display: none; }
}
@media (max-width: 767px) {
  .table-reports > thead > tr > th:not(:first-child),
  .table-reports > tbody > tr > td:not(:first-child) { padding-left: 0; }
}
.table-reports tbody tr[data-act-i] { cursor: pointer; transition: background-color .6s ease; }
.table-reports tbody tr[data-act-i]:hover,
.table-reports tbody tr[data-act-i]:focus-visible { background: #FAFBFC; }
.table-reports tbody tr[data-act-i]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.table-reports tbody tr.activity-row-new { background: var(--pill-green-bg); }
.table-reports tbody tr.activity-row-new:hover,
.table-reports tbody tr.activity-row-new:focus-visible { background: var(--pill-green-bg); }
.table-reports th:last-child,
.table-reports td:last-child { width: 72px; }
.table-reports .report-date,
.table-reports .category,
.table-reports .purpose,
.table-reports .activity-type { overflow: hidden; text-overflow: ellipsis; }
.table-reports .item-name { max-width: 240px; font-weight: var(--font-weight-bold); color: var(--text); }
.table-reports .category,
.table-reports .purpose { max-width: 220px; color: var(--text); }
.table-reports .activity-type { max-width: 160px; color: var(--text); text-transform: capitalize; }
.table-reports .rep-time { display: inline; margin-left: 4px; font-size: 12px; }
.table-reports .rep-act-qty,
.reports-data-table .rep-act-qty {
  display: inline-block; min-width: 35px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: var(--font-weight-normal); line-height: 1.4; text-align: center;
}
.table-reports .rep-act-qty.qty-plus,
.reports-data-table .rep-act-qty.qty-plus { background: var(--pill-blue-bg); color: var(--pill-blue-text); }
.table-reports .rep-act-qty.qty-minus,
.reports-data-table .rep-act-qty.qty-minus { background: var(--pill-red-bg); color: var(--pill-red-text); }
.table-reports .rep-act-qty:not(.qty-plus):not(.qty-minus),
.reports-data-table .rep-act-qty:not(.qty-plus):not(.qty-minus) { background: #F2F4F7; color: #475467; }
.table-reports td[colspan] { padding: 24px 18px; color: var(--muted); text-align: center; }
@media (max-width: 767.98px) {
  .table-reports { min-width: 0; }
  .table-reports th:nth-child(3), .table-reports td:nth-child(3),
  .table-reports th:nth-child(5), .table-reports td:nth-child(5) { display: none; }
  .table-reports th:last-child, .table-reports td:last-child { width: 52px; }
  .table-reports .report-date { line-height: 1.25; }
  .table-reports .rep-time { display: block; margin-left: 0; margin-top: 2px; font-size: 11px; }
  .table-reports .item-name { max-width: none; }
  .table-reports .activity-type { max-width: 130px; }
}
/* Reports > Reports summary tables use the same semantic table treatment as Activities. */
.reports-data-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.reports-data-table-wrap:has(td[colspan]) { border-radius: 0 0 16px 16px; }
.reports-data-table-wrap:has(tbody tr.rep-total) { border-radius: 0 0 16px 16px; }
.reports-rows > .d-table-footer { border-radius: 0 0 16px 16px; border-bottom: 1px solid var(--outline-variant); }

.reports-data-table thead {
  background: #F9FAFB; border-top: 1px solid #E4E7EC; border-bottom: 1px solid #E4E7EC;
}
.reports-data-table td {
  vertical-align: middle; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .reports-data-table td { padding-left: 18px; padding-right: 18px; }
}
.reports-data-table tbody tr.reports-drill-row { cursor: pointer; }
.reports-data-table tbody tr.reports-drill-row:hover,
.reports-data-table tbody tr.reports-drill-row:focus-visible { background: #FAFBFC; }
.reports-data-table tbody tr.reports-drill-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.reports-summary-table th:first-child, .reports-summary-table td:first-child { width: 60%; }
.reports-summary-table th:not(:first-child), .reports-summary-table td:not(:first-child) { text-align: right; }
.reports-data-table th .table-head-sort { width: auto; }
.content-card.reports .reports-data-table.reports-three-column-table th:nth-child(1),
.content-card.reports .reports-data-table.reports-three-column-table td:nth-child(1),
.content-card.reports .reports-data-table.reports-three-column-table th:nth-child(2),
.content-card.reports .reports-data-table.reports-three-column-table td:nth-child(2) { width: 40%; }
.content-card.reports .reports-data-table.reports-three-column-table th:last-child,
.content-card.reports .reports-data-table.reports-three-column-table td:last-child { width: 20%; }
.activity-adjustment > thead > tr > th:nth-child(1) { width: 20%; }
.activity-adjustment > thead > tr > th:nth-child(2) { width: 60%; }
.activity-adjustment > thead > tr > th:nth-child(3) { width: 20%; text-align: right; }
.activity-adjustment > tbody > tr > td:last-child { text-align: right; }
.activity-borrow-return > thead > tr > th:nth-child(1) { width: 45%; }
.activity-borrow-return > thead > tr > th:nth-child(2) { width: 25%; }
.activity-borrow-return > thead > tr > th:nth-child(3) { width: 30%; text-align: right; }
.activity-borrow-return > tbody > tr > td:last-child { text-align: right; }
.activity-sell > thead > tr > th:nth-child(1) { width: 20%; }
.activity-sell > thead > tr > th:nth-child(2) { width: 40%; text-align: left; }
.activity-sell > thead > tr > th:nth-child(3) { width: 40%; }
.activity-sell > thead > tr > th:last-child { text-align: right; }
.activity-sell > tbody > tr > td:nth-child(2) { text-align: left; }
.activity-sell > tbody > tr > td:last-child { text-align: right; }
.reports-data-table .rep-num { font-variant-numeric: tabular-nums; }
.reports-data-table .rep-total td { font-weight: var(--font-weight-extra-bold); }
.reports-data-table td[colspan] { padding: 24px 18px; color: var(--muted); text-align: center; }
@media (min-width: 768px) {
  .reports-data-table th, .reports-data-table td { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 767.98px) {
  .reports-summary-table th:first-child, .reports-summary-table td:first-child { width: auto; }
}
/* search-match rows are clickable */
.match-row { cursor: pointer; }
.match-row:hover { background: var(--surface-variant); }
.act-match-empty { padding: 10px 0; }
/* required-field asterisk */
.req { color: #ef4444; font-weight: var(--font-weight-bold); }
.field .req { color: #ef4444; font-weight: var(--font-weight-bold); }
.form-card-head .chips { flex-wrap: wrap; overflow: visible; }
/* inline search results — plain rows below the search bar (no box) */
.act-search-results { margin-top: 4px; }
.act-result {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.act-result:last-child { border-bottom: none; }
.settings-group { margin-bottom: 24px; }
/* Settings-page fields reuse the Add Item `.form-grid`/`.field` pattern (label above
   input). Neutralize the base `.form-grid`'s own padding/background so the grid sits
   flush inside the card (the card + form-card-head already handle spacing). */

.settings-group h3.usr-form-title { margin: 0 -24px; padding: 10px 24px 24px; border-bottom: 1px solid var(--outline-variant); }
.settings-group .srow { border-bottom: none; }

/* ---------- font ---------- */
body, input, select, textarea { font-family: var(--font); }

/* ---------- dashboard cards: oneApp layout-three grid ---------- */
/* ---------- dashboard cards: 3-up on web, stacked on phone/tablet ---------- */
.status-summary-card { display: flex; gap: 24px; }
.status-card { width: 100%; }
@media (max-width: 1199px) {
  .status-summary-card { flex-direction: column; }
}
.cards-grid { display: grid; grid-template-columns: 1fr; grid-auto-rows: 300px; gap: 24px; }
.cards-grid .status-card {
  margin-top: 0 !important; height: 100%; box-sizing: border-box; background: #fff;
}
@media (min-width: 768px) {
  .status-card { padding: 24px; }
}
@media (min-width: 1199px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* phone: keep each card compact — only the first 3 rows */
@media (max-width: 767.98px) {
  .status-card-items .status-row:nth-child(n+4) { display: none; }
}
.status-card-summary { display: block; min-width: 0; }
.status-card-icon {
  position: absolute;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex: 0 0 48px;
  overflow: hidden; border-radius: 12px; background: #f3f4f6;
}
@media (max-width: 767.98px) {
  .status-card-icon { top: 18px; right: 18px; }
}
@media (min-width: 768px) {
  .status-card-icon { top: 24px; right: 24px; }
}
.status-card-icon img { display: block; width: 36px; height: 36px; }
.status-card.card-orange .status-card-icon { background: #fff7ed; }
.status-card.card-red .status-card-icon { background: #fef2f2; }
.status-card.card-blue .status-card-icon { background: #eff6ff; }
.status-card-summary-copy { min-width: 0; padding-right: 64px; }
.card-count { display: block; font-size: 30px; font-weight: var(--font-weight-extra-bold); line-height: 1.15; margin: 2px 0 12px; color: var(--text); }
.card-count.dashboard-status-link { margin: 0; padding: 14px 0 14px 10px; }
/* oneApp trend-pill style applied to status-card titles */
.status-card-summary-copy > .card-title {
  display: inline-block; border-radius: 999px; padding: 4px 12px;
  font-size: 12px; font-weight: var(--font-weight-extra-bold); line-height: 1.4; letter-spacing: .5px; text-transform: uppercase;
}
.status-card.card-orange .status-card-summary-copy > .card-title { background: #fef3e8; color: #ea580c; }
.status-card.card-red .status-card-summary-copy > .card-title { background: #fef1f0; color: #d4281d; }
.status-card.card-blue .status-card-summary-copy > .card-title { background: #eff6ff; color: #2563eb; }
.usage-card {
  margin-top: 24px; padding: 18px; background: #fff;
  border: 1px solid var(--outline-variant); border-radius: var(--radius-card);
}
.usage-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.usage-plan-link { flex-shrink: 0; white-space: nowrap; }
.usage-title { margin: 0; font-size: 18px; font-weight: var(--font-weight-normal); color: var(--text); }
.usage-plan { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.usage-plan strong { color: var(--text); font-weight: var(--font-weight-bold); }
.usage-chart { position: relative; min-height: 173px; margin-top: 8px; }
.usage-gauge { display: block; width: 100%; height: 173px; overflow: visible; }
.usage-gauge path { fill: none; stroke-width: 12; stroke-linecap: round; }
.usage-gauge-track { stroke: rgba(228, 231, 236, .85); }
.usage-gauge-fill { stroke: rgba(70, 95, 255, .85); transition: stroke-dasharray .25s ease; }
.usage-gauge-center {
  position: absolute; right: 15%; bottom: 2px; left: 15%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #667085; text-align: center;
}
.usage-gauge-center span { font-size: 13px; font-weight: var(--font-weight-light); }
.usage-gauge-center strong { color: var(--text-dark); font-size: 28px; line-height: 1.15; font-weight: var(--font-weight-bold); }
.usage-gauge-center small { color: var(--muted); font-size: 13px; font-weight: var(--font-weight-normal); }
.usage-metrics { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--outline-variant); }
.usage-metric {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 140px) 40px; align-items: center; gap: 12px;
  width: 100%; padding: 0; border: 0; background: transparent; color: #344054; text-align: left; cursor: pointer;
}
.usage-metric + .usage-metric { margin-top: 20px; }
.usage-metric-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.usage-metric-copy strong { color: var(--muted); font-size: 13px; font-weight: var(--font-weight-light); }
.usage-metric-copy small { color: var(--text-dark); font-size: 16px; font-weight: var(--font-weight-bold); }
.usage-metric:hover .usage-metric-copy strong, .usage-metric.active .usage-metric-copy strong { color: var(--primary); }
.usage-metric-progress { display: block; position: relative; height: 8px; width: 100%; overflow: hidden; background: #e4e7ec; border-radius: 3px; }
.usage-metric-progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .2s ease; }
.usage-metric > strong { color: var(--muted); font-size: 13px; font-weight: var(--font-weight-normal); text-align: right; }
@media (max-width: 639.98px) {
  .usage-metric { grid-template-columns: minmax(0, 1fr) minmax(0, 120px) 40px; gap: 10px; }
}
@media (max-width: 767px) {
  .business-card { padding: 18px; }
}
.business-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.business-title { margin: 0; font-size: 18px; font-weight: var(--font-weight-normal); color: var(--text); }
.business-donut-row { display: flex; flex-direction: column; align-items: center; gap: 24px; margin-top: 16px; }
.business-donut-wrap { display: flex; justify-content: center; }
.business-donut { width: 260px; height: 260px; }
.business-donut-label { font-size: 17px; font-weight: var(--font-weight-extra-bold); fill: var(--text-dark); }
.business-donut-value { font-size: 13px; font-weight: var(--font-weight-light); fill: #667085; }
.donut-slice { cursor: pointer; transition: opacity 0.2s ease, transform 0.2s ease; outline: none; transform-box: fill-box; transform-origin: center; }
.donut-slice:hover, .donut-slice:focus-visible { transform: scale(1.04); }
.donut-slice.is-dimmed { opacity: 0.35; }
.business-legend { display: flex; flex-direction: column; gap: 12px; align-self: center; }
.legend-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; cursor: pointer; outline: none; }
.legend-item.is-active .legend-label { font-weight: var(--font-weight-extra-bold); color: #3641f5; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.legend-text { display: flex; flex-direction: column; gap: 2px; }
.legend-label { color: var(--text-dark); font-size: 14px; font-weight: var(--font-weight-normal); line-height: 1; }
.legend-count { color: #667085; font-size: 13px; font-weight: var(--font-weight-bold); }
@media (min-width: 768px) {
  .usage-card { padding: 24px; }
  .business-card { padding: 24px; }
  .business-donut-row { flex-direction: row; justify-content: center; }
}
.more-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: var(--font-weight-extra-bold);
  padding: 10px 0 0; text-decoration: none;
}
.more-link:hover { color: var(--text); }

/* ---------- buttons: oneApp radius + indigo primary ---------- */
.btn { border-radius: 8px; }
.btn-save { background: var(--primary); border-color: var(--primary); font-weight: var(--font-weight-bold); box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1); }
#saveActBtn { display: flex; width: 180px; }
#newItemForm .btn-save { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; width: 180px; }
.settings-group .btn-save { width: 180px; }
.btn-save:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 2px 4px rgba(16, 24, 40, .12); }

/* ---------- inputs: oneApp indigo focus ring ---------- */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(70, 95, 255, .14);
}

/* ---------- topbar title ---------- */
.page-title { font-weight: var(--font-weight-bold); }

/* ============================================================
   Responsive layout — web only (phone + tablet share the mobile view)
   ============================================================ */

/* ---------- web (≥900px): oneApp-style persistent sidebar ---------- */
@media (min-width: 900px) {
  .app-shell { display: flex; }
  .drawer {
    position: sticky; top: 0; left: 0; width: 260px; height: 100vh;
    transform: none; box-shadow: none; border-right: 1px solid var(--outline-variant);
    z-index: 40; flex: none; inset: 0 auto auto 0;
  }
  .drawer-scrim { display: none !important; }
  .main { flex: 1; min-width: 0; margin-left: 0; }
  .topbar .icon-btn[aria-label="Menu"] { display: none; }
  /* content fills the area beside the sidebar */
  .content { padding: 24px; }

  .item-row { min-height: 72px; }
  .item-thumb { width: 53px; height: 53px; }
  /* detail photo centered at a readable size */
  .carousel { max-width: 640px; margin-left: auto; margin-right: auto; }
  /* sheets become centered dialogs instead of bottom sheets */
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -50%); border-radius: 20px;
    width: 100%; max-width: 480px; max-height: 80dvh;
  }
  .fab { right: 32px; bottom: 32px; }
}
/* Manage toolbar search bar: wider on large screens */
@media (min-width: 1400px) {
  .table-searchbar { width: 700px; }
}

/* Import items page (#/items/import) */
.imp-back { display: inline-block; color: var(--primary); text-decoration: none; font-weight: var(--font-weight-bold); font-size: 14px; }
.import-items { max-width: none; }
.import-items .content-card-head { border-bottom: 1px solid var(--outline-variant); }
.import-items .content-card-body { padding: 24px; }
.imp-downloads { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; margin-bottom: 24px; }
.imp-downloads .btn { text-decoration: none; }
.import-items .imp-title { font-size: 15px; font-weight: var(--font-weight-bold); color: var(--text); text-transform: none; letter-spacing: normal; margin: 24px 0 24px; padding-top: 24px; }
.imp-preview { overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: 12px; background: #fff; }
.imp-preview table { border-collapse: collapse; width: 100%; min-width: 880px; font-size: 12px; }
.imp-preview th, .imp-preview td { padding: 8px 10px; border-bottom: 1px solid var(--outline-variant); text-align: left; white-space: nowrap; }
.imp-preview thead th { background: var(--primary-container); font-weight: var(--font-weight-bold); }
.imp-preview tbody tr:last-child td { border-bottom: none; }
.imp-preview tbody td { color: var(--muted); }
.imp-notes { font-size: 13px; color: var(--muted); margin: 14px 0 14px; padding-left: 18px; }
.imp-notes li { margin-bottom: 4px; }
.imp-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.imp-file-name { font-size: 13px; flex: 1; min-width: 120px; }
.imp-result { font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-top: 10px; }
.imp-ok { background: #e9f9ef; color: #1a7f37; }
.imp-warn { background: #fff4e5; color: #b54708; }
.imp-result a { color: var(--primary); font-weight: var(--font-weight-bold); }
.imp-file-status { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-top: 10px; }
.imp-file-status svg { flex-shrink: 0; }
.imp-duplicate-list { margin: 8px 0 0; padding-left: 20px; }
.imp-duplicate-list li { margin: 3px 0; }
.imp-err { background: #fdecea; color: #b42318; }

/* Subscription Plan page (#/subscription-plans) — oneApp Pricing Table 3 */
.sub-plan-card-wrap { max-width: none; }
.settings-group.sub-plan-card-wrap { padding: 18px; }
@media (min-width: 768px) {
  .settings-group.sub-plan-card-wrap { padding: 24px; }
}
.sub-plan-card-head { display: flex; align-items: center; justify-content: end; gap: 20px; flex-wrap: wrap; margin-bottom: 48px; }
.sub-plan-billing-toggle {
  position: relative; z-index: 0; display: inline-flex; align-items: center;
  width: 248px; height: 52px; padding: 4px; box-sizing: border-box;
  border-radius: 9999px; background: #F2F4F7;
}
.sub-plan-billing-indicator {
  position: absolute; z-index: 0; top: 4px; left: 4px; width: 120px; height: 44px;
  border-radius: 9999px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  transition: transform .2s ease;
}
.sub-plan-billing-toggle.annually .sub-plan-billing-indicator { transform: translateX(120px); }
.sub-plan-billing-option {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex: 0 0 120px;
  width: 120px; height: 44px; padding: 0; border: 0; border-radius: 9999px;
  background: transparent; color: #667085; font-size: 16px; font-weight: var(--font-weight-normal); line-height: 1;
  cursor: pointer;
}
.sub-plan-billing-option.active { color: var(--text-dark); }

.sub-plan-grid {
  display: grid; grid-template-columns: repeat(var(--sub-plan-count, 1), minmax(0, 1fr));
  grid-auto-rows: 1fr; align-items: stretch; gap: 20px; margin-top: 8px;
}
.sub-plan-grid.sub-plan-grid-multirow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sub-plan-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--outline-variant); border-radius: var(--radius-card);
  padding: 24px; height: 100%; box-sizing: border-box;
}
.sub-plan-card-recommended { background: var(--primary); border-color: var(--primary); color: #fff; }
.sub-plan-badge {
  position: absolute; top: 16px; right: 16px; padding: 4px 12px;
  background: rgba(255, 255, 255, .16); color: #fff; border-radius: 8px;
  font-size: 12px; font-weight: var(--font-weight-bold);
}
.sub-plan-name { display: block; font-size: 20px; font-weight: var(--font-weight-bold); color: var(--text-dark); }
.sub-plan-card-recommended .sub-plan-name { color: #fff; }
.sub-plan-tagline { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.sub-plan-card-recommended .sub-plan-tagline { color: rgba(255, 255, 255, .9); }
.sub-plan-price-wrap { margin: 16px 0 24px; min-height: 58px; }
.sub-plan-price { display: inline-block; margin: 0; font-size: 24px; font-weight: var(--font-weight-extra-bold); color: var(--text-dark); overflow-wrap: anywhere; }
.sub-plan-period { display: inline-block; margin-left: 4px; font-size: 13px; color: var(--muted); }
.sub-plan-original-price { display: inline-block; margin-left: 10px; font-size: 16px; font-weight: var(--font-weight-normal); color: #98A2B3; text-decoration: line-through; overflow-wrap: anywhere; }
.sub-plan-discount {
  display: flex; width: fit-content; align-items: center; margin-top: 10px; padding: 4px 8px;
  border-radius: 9999px; background: #ECFDF3; color: #12B76A; font-size: 12px; font-weight: var(--font-weight-bold);
}
.sub-plan-card-recommended .sub-plan-price { color: #fff; }
.sub-plan-card-recommended .sub-plan-period { color: rgba(255, 255, 255, .9); }
.sub-plan-card-recommended .sub-plan-discount { background: #fff; color: var(--primary); }
.sub-plan-btn { width: 100%; height: 44px; justify-content: center; }
.sub-plan-btn-current { background: #fff; border: 1px solid var(--outline-variant); color: var(--muted); cursor: default; }
.sub-plan-card-recommended .sub-plan-btn:not(.sub-plan-btn-current) { background: #fff; color: var(--primary); }
.sub-plan-card-recommended .sub-plan-btn-current { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }
.sub-plan-features { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.sub-plan-feature { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; color: #344054; }
.sub-plan-card-recommended .sub-plan-feature { color: #fff; }
.sub-plan-check { display: inline-flex; flex-shrink: 0; color: #12b76a; }
.sub-plan-card-recommended .sub-plan-check { color: #fff; }
@media (max-width: 767.98px) {
  .sub-plan-card-head { align-items: flex-start; }
  .sub-plan-billing-toggle { width: 100%; max-width: 248px; }
  .sub-plan-grid { grid-template-columns: minmax(0, 1fr); }
  .sub-plan-grid.sub-plan-grid-multirow { grid-template-columns: minmax(0, 1fr); }
}

/* Let searchable item filters escape the rounded card while open. */
.content-card.items:has(.searchable-select-menu:not([hidden])) { overflow: visible; }
.content-card.reports:has(.searchable-select-menu:not([hidden])) { overflow: visible; }

.content-card.items > .content-card-head {
  position: relative; z-index: 31;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px; flex-wrap: wrap;
}
.content-card.items > .content-card-head .item-right-head { display: flex; flex-direction: row; align-items: center; gap: 24px; flex: 1 1 auto; margin-left: auto; justify-content: flex-end; }
.content-card.items > .content-card-head .chips { width: fit-content; flex-shrink: 0; }
.content-card.items > .content-card-head .search-row { min-width: 0; }
.content-card.items > .content-card-head .search-row .searchable-select { flex: 0 1 200px; width: 200px; min-width: 150px; }
.content-card.items > .content-card-head .table-searchbar { flex: 0 0 50%; min-width: 0; width: 50%; }
.content-card.items > .content-card-head .table-searchbar input { height: 44px; border-color: var(--light-grey); }
.content-card.items > .content-card-head .icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; }
.content-card.items > .content-card-head .icon-btn img { width: 24px; height: 24px; }
/* barcode scan button: 44px icon, no hover tint */
#itemScanBtn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
#itemScanBtn img { width: 44px; height: 44px; }
#itemScanBtn:hover { background: none; }
@media (max-width: 767.98px) {
  .content-card.items > .content-card-head .item-right-head { flex: 1 1 100%; width: 100%; margin-left: 0; flex-direction: column; align-items: stretch; gap: 10px; }
  .content-card.items > .content-card-head .search-row { flex: none; width: 100%; flex-wrap: wrap; }
  .content-card.items > .content-card-head .search-row .searchable-select { flex: 1 1 100%; width: auto; min-width: 0; }
  .content-card.items > .content-card-head .table-searchbar { flex: 1 1 auto; width: auto; }
  #itemRows > .muted { padding: 12px 18px; }
}
@media (min-width: 774px) and (max-width: 1279.98px) {
  .content-card.items > .content-card-head { flex-direction: column; align-items: stretch; }
  .content-card.items > .content-card-head > .content-card-title { width: 100%; }
  .content-card.items > .content-card-head .item-right-head { flex: 1 1 100%; width: 100%; margin-left: 0; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
  .content-card.items > .content-card-head .search-row { flex: 1 1 0; max-width: none; justify-content: flex-end; }
  .content-card.items > .content-card-head .item-right-head { flex-direction: row; }
  .content-card.items > .content-card-head .search-row { flex-wrap: nowrap; }
  .content-card.items > .content-card-head .search-row .chips { flex: 0 0 auto; width: fit-content; }
  .content-card.items > .content-card-head .table-searchbar { flex: 1 1 0; width: auto; }
}
@media (min-width: 1280px) {
  .content-card.items > .content-card-head .search-row { flex: 1 1 0; max-width: none; justify-content: flex-end; }
}
@media (max-width: 767px) {
  .content-card.items > .content-card-head .chips .chip { font-size: 13px; }
}
.content-card.items .items-count { margin: 0; padding: 0; }
.item-bulk-status { flex: none; }
@media (max-width: 767px) {
  .content-card.items .items-count-active,
  .content-card.items .items-count-inactive { display: block; }
  .content-card.items .items-count-divider { display: none; }
}
.item-select,
.item-select-all input {
  appearance: none;
  width: 15px; height: 15px; margin: 0; padding: 0;
  border: 1px solid var(--light-grey); border-radius: 5px;
  background: #fff; cursor: pointer;
}
.item-select:checked,
.item-select-all input:checked {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M10 3L4.75 8.25 2 5.5' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center; background-repeat: no-repeat; background-size: 12px 12px;
}
.item-select:disabled { opacity: .55; cursor: not-allowed; }
.table-items .item-select-all { display: flex; align-items: center; justify-content: flex-start; overflow: visible !important; }
/* Items list is a table at all widths. Mobile (≤767px) shows only Image | Item name |
   Current Qty (+ action); tablet/web (≥768px) show all 9 columns with horizontal scroll. */

.table-items-head,
#itemRows > .item-row {
  align-items: center;
}
.table-items > tbody > tr > td.muted {
  padding: 24px 18px;
  color: var(--muted);
  text-align: center;
}
@media (min-width: 768px) {
  .content-card.items > .content-card-head { padding: 24px; }
  #itemRows > .muted { padding: 12px 24px; }
}
.table-items-head > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-items-head .table-head-sort .th-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-cell { display: block; font-size: 14px; color: #475467; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-cell.item-min,
.item-cell.item-cost { font-variant-numeric: tabular-nums; }
.status-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: var(--font-weight-normal); line-height: 1.7; }
.status-badge.on { background: var(--pill-green-bg); color: var(--pill-green-text); }
.status-badge.off { background: #F2F4F7; color: #475467; }
/* mobile (≤767px): use 13px item-table row text; status badges remain 12px */
@media (max-width: 767.98px) {
  .table-items-head,
  #itemRows > .item-row { column-gap: 5px; }
  .table-items-head > * { justify-self: center; }
  .table-items-head > *:first-child {
    justify-self: start;
    text-align: left;
  }
  .table-items-head > *:nth-child(2) {
    justify-self: start;
    text-align: left;
  }
  .table-items-head > * {
    overflow: visible;
    text-overflow: clip;
  }
  .table-items-head .table-head-sort .th-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .table-items-head [data-sort="name"] {
    justify-self: start;
    text-align: left;
  }

  #itemRows .item-cell,
  #itemRows .item-name,
  #itemRows .item-qty b { font-size: 13px; }
  #itemRows .item-meta { text-align: left; }
  .table-items-head [data-sort="opening_qty"] { justify-self: center; pointer-events: none; }
  .table-items-head [data-sort="opening_qty"] .rep-sort-ico { display: none; }

  .item-cell,
  .table-items-head [data-sort="category"],
  .table-items-head [data-sort="min_qty"],
  .table-items-head [data-sort="purchase_price"],
  .table-items-head [data-sort="is_active"],
  .table-items-head [data-sort="created_at"] { display: none; }
}
/* tablet + web (≥768px): full 9-column table, scrolls horizontally below ~940px */
@media (min-width: 768px) {
  /* Items table text is 13px at ≥768px. */
  #itemRows .item-cell,
  #itemRows .item-name,
  #itemRows .item-qty b { font-size: 13px; }
  .table-items-head [data-sort="name"],
  .table-items-head [data-sort="category"],
  #itemRows .item-meta,
  #itemRows .item-cat { box-sizing: border-box; }
}
/* web (≥900px): smaller thumbnail + wider 53px image column */

/* tablet (768–899px): thumbnail fills the 79px image column (web ≥900px uses the smaller 53px column) */
@media (min-width: 768px) and (max-width: 899.98px) {
  #itemRows .item-thumb { width: 79px; height: 79px; }
}
/* generic icon tooltip — TailAdmin "Default Tooltip" style (demo.tailadmin.com/tooltips):
   white bg, gray-700 text, 12px/500 weight, 8px/14px padding, rounded-lg, border+shadow-md,
   45°-rotated square arrow pointing up at the trigger. Placed below via data-tooltip text.
   Right-aligned (not centered) to the trigger: these buttons sit at the right edge of a
   card with overflow:hidden, so a centered tooltip gets clipped — anchoring the tooltip's
   right edge to the button keeps it inside the card. */
.icon-tooltip { position: relative; }
.icon-tooltip::after {
  content: attr(data-tooltip);
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); color: #344054; font-size: 12px; font-weight: 500; line-height: 1;
  padding: 8px 14px; border-radius: 8px; white-space: nowrap;
  border: 1px solid var(--outline-variant);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 20;
}
.icon-tooltip::before {
  content: ""; position: absolute; right: 12px; top: calc(100% + 4px); transform: rotate(45deg);
  width: 8px; height: 8px; background: var(--surface);
  border-left: 1px solid var(--outline-variant); border-top: 1px solid var(--outline-variant);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 19;
}
.icon-tooltip:hover::after, .icon-tooltip:hover::before { opacity: 1; visibility: visible; }
.icon-tooltip-above::after { top: auto; bottom: calc(100% + 8px); }
.icon-tooltip-above::before {
  top: auto; bottom: calc(100% + 4px);
  border: 0;
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
}
@media (hover: none) {
  .icon-tooltip::after, .icon-tooltip::before { display: none; }
}
/* row action button hover tooltip — "Add Activity" (user: "on user hover: add text Add Activity"); hidden on touch (no hover) */
.item-act-btn { position: relative; }
.item-act-btn::after {
  content: "Add Activity";
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #344054; color: #fff; font-size: 12px; font-weight: var(--font-weight-normal); line-height: 1;
  padding: 7px 10px; border-radius: 6px; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 5;
}
.item-act-btn:hover::after { opacity: 1; visibility: visible; }
@media (hover: none) {
  .item-act-btn::after { display: none; }
}
/* Items uses the same semantic table treatment as Invoices and Registered Business. */
.table-items td { text-align: left; }
.table-items .table-items-head { display: table-row; padding: 0; }
.table-items .table-items-head > * { overflow: visible; }
.table-items tbody .item-row { display: table-row; cursor: pointer; }
.table-items tbody .item-row:hover { background: #FAFBFC; }
.table-items .item-thumb-cell { width: 53px; }
.table-items .item-meta { min-width: 180px; }
.table-items .item-meta .item-name { font-weight: var(--font-weight-normal); }
.table-items .item-cell { display: table-cell; }
.table-items .item-cost,
.table-items .item-min { font-variant-numeric: tabular-nums; }
.table-items .item-act-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; }
@media (min-width: 768px) {
  .table-items th, .table-items td { padding-left: 24px; padding-right: 24px; }
  .table-items .item-select-cell { padding-right: 0; }
}
@media (max-width: 767.98px) {
  .table-items { min-width: 0; }
  .table-items td { text-align: center; }
  .table-items th:nth-child(4), .table-items td:nth-child(4),
  .table-items th:nth-child(6), .table-items td:nth-child(6),
  .table-items th:nth-child(7), .table-items td:nth-child(7),
  .table-items th:nth-child(8), .table-items td:nth-child(8),
  .table-items th:nth-child(9), .table-items td:nth-child(9) { display: none; }
  .table-items th:nth-child(2), .table-items td:nth-child(2) { padding-left: 8px; padding-right: 8px; }
  .table-items > thead > tr > th:nth-child(2),
  .table-items > thead > tr > th:nth-child(3),
  .table-items > thead > tr > th:nth-child(5) { padding-right: 0; }
  .table-items > tbody > tr > td:nth-child(2),
  .table-items > tbody > tr > td:nth-child(3),
  .table-items > tbody > tr > td:nth-child(5) { padding-right: 0; }
  .table-items > thead > tr > th:nth-child(5),
  .table-items > tbody > tr > td:nth-child(5) { padding-left: 0; }
  .table-items > tbody > tr > td.item-action-cell { padding-left: 0; text-align: end; }
  .table-items .item-meta { min-width: 0; width: 100%; }
}

/* ---------- Business (Platform Owner) — TailAdmin "Basic Table 2" style ---------- */
/* Ported from demo.tailadmin.com/basic-tables "Recent Orders" card:
   header row (title + search + filter) above a table with an initials
   avatar column, a plan-pill status column, and a right-aligned action icon. */
.content-card { overflow: hidden; border-radius: var(--radius-card); border: 1px solid var(--outline-variant); background: var(--surface); }

.content-card-head { display: flex; flex-direction: column; gap: var(--gap-card-head); padding: 18px; }

.content-card-title { margin: 0; font-size: var(--card-title-font-size); font-weight: var(--font-weight-normal); color: var(--content-card-title-color); white-space: nowrap; }
@media (min-width: 768px) {
  .content-card-head { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px; }
}
.content-card-body { overflow-x: auto; }
.d-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.d-table thead { background: var(--surface-variant); border-top: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.d-table > thead > tr > th { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 767px) {
  .d-table > thead > tr > th { padding-left: 18px; padding-right: 18px; }
}
@media (min-width: 768px) {
  .d-table > thead > tr > th { padding-left: 24px; padding-right: 24px; }
}
.d-table > thead > tr > th > span { font-size: 12px; }
.d-table .th-label { font-size: 12px; }
.d-table th {
  text-align: left;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-transform: capitalize;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.d-table td { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--outline-variant); font-size: 13px; color: var(--text); white-space: nowrap; }
.d-table tbody tr:last-child td { border-bottom: 0; }
.d-table tbody tr[data-biz-row] { cursor: pointer; }
.d-table tbody tr[data-biz-row]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.d-table tbody tr:hover { background: #FAFBFC; }
.biz-name-cell { display: flex; align-items: center; gap: 12px; }
.biz-avatar { flex: none; width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: var(--font-weight-bold); background: var(--primary-container, #edf0ff); color: var(--primary); }
.biz-name-meta { min-width: 0; }
.biz-name-meta strong { display: block; font-weight: var(--font-weight-bold); font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.biz-name-meta span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.biz-plan-pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: var(--font-weight-bold); }
.biz-plan-pill.plan-free { background: #F2F4F7; color: #475467; }
.biz-plan-pill.plan-pro { background: #EFF8FF; color: #175CD3; }
.biz-plan-pill.plan-premium { background: #FDF2FA; color: #C11574; }
.biz-plan-pill.plan-ultra { background: var(--pill-green-bg); color: var(--pill-green-text); }
.biz-num { text-align: right; font-variant-numeric: tabular-nums; }
.d-table th.biz-num, .d-table td.biz-num { text-align: center; }
.biz-usage { display: inline-flex; align-items: baseline; gap: 3px; }
.biz-usage > strong { font-weight: var(--font-weight-light); }
.biz-usage > span { color: var(--muted); }
.biz-actions { position: relative; text-align: right; }
.d-table th.biz-actions { text-align: right; }
.biz-action-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.biz-action-button:hover, .biz-action-button:focus-visible, .biz-action-button[aria-expanded="true"] { background: #F2F4F7; color: var(--text); }
.biz-action-menu { position: fixed; min-width: 190px; }
.biz-action-menu button:disabled { color: var(--muted); cursor: default; opacity: .55; }
.biz-row-inactive td { color: var(--muted); background: #F9FAFB; }
.biz-row-inactive .biz-name-meta strong { color: var(--muted); }
@media (max-width: 767px) {
  .d-table { min-width: 0; }
  .d-table th.biz-mobile-hide, .d-table td.biz-mobile-hide { display: none; }
  .d-table th.biz-actions, .d-table td.biz-actions { width: 48px; text-align: left; }
  .biz-name-cell { gap: 0; }
  .biz-avatar { display: none; }
  .biz-name-meta span { display: none; }
}

/* ---------- subscription invoices — TailAdmin invoices card ---------- */
.subscription-invoice-page { max-width: 1440px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.subscription-create-invoice span { font-size: 18px; line-height: 0; }

.subscription-invoices-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.content-card-filters { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-card-filters); padding: 24px; border-top: 1px solid var(--outline-variant); }
.content-card-filters > .table-searchbar { width: 50%; }
@media (max-width: 1199px) {
  .content-card.invoices > .content-card-filters > .table-searchbar { flex: auto; }
}
.subscription-invoice-status-chips { flex: none; }
.table-invoices .subscription-invoice-select-cell { width: 24px; padding-right: 0; }
.table-invoices .invoice-select,
.table-invoices .item-select-all input { appearance: none; width: 15px; height: 15px; margin: 0; padding: 0; border: 1px solid var(--light-grey); border-radius: 5px; background: #fff; cursor: pointer; }
.table-invoices .invoice-select:checked,
.table-invoices .item-select-all input:checked { border-color: var(--primary); background-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M10 3L4.75 8.25 2 5.5' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: center; background-repeat: no-repeat; background-size: 12px 12px; }
.table-invoices .item-select-all { display: flex; align-items: center; justify-content: flex-start; }
.subscription-invoice-actions-cell { position: relative; width: 48px; padding-left: 8px !important; padding-right: 8px !important; text-align: center; }
.subscription-invoice-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.subscription-invoice-menu-btn:hover, .subscription-invoice-menu-btn[aria-expanded="true"] { background: #F2F4F7; color: var(--text); }
.subscription-invoice-menu { position: fixed; top: auto; right: auto; min-width: 180px; }
.invoice-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: var(--font-weight-bold); line-height: 1.2; white-space: nowrap; }
.invoice-status-draft { color: #6941C6; background: #F4F3FF; }
.invoice-status-paid { color: var(--pill-green-text); background: var(--pill-green-bg); }
.invoice-status-unpaid { color: #B54708; background: #FFFAEB; }
.invoice-status-cancelled { color: #B42318; background: #FEF3F2; }
.invoice-status-modal, .invoice-cancel-modal { max-width: 460px; }
.invoice-status-modal { padding: 0; }
.invoice-status-modal > .modal-head { padding: 24px; border: 1px solid var(--outline-variant); }
.invoice-status-modal > .modal-body { padding: 12px 24px; }
.invoice-status-modal .field { display: flex; flex-direction: column; gap: 7px; margin: 12px 0 0; }
.invoice-status-modal .field > span { color: #344054; font-size: 13px; font-weight: var(--font-weight-normal); }
.invoice-status-modal select,
.invoice-status-modal input[type="text"] { width: 100%; min-height: 42px; border: 1px solid var(--light-grey); border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--text); font: inherit; box-sizing: border-box; }
.invoice-status-modal .cal-field input[type="text"] { padding-right: 40px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.invoice-cancel-modal .modal-actions { margin-top: 24px; }

.invoice-view-page { width: 100%; max-width: none; margin: 0; padding-bottom: 32px; }
.invoice-detail-card { position: relative; width: 100%; max-width: none; margin: 0; }
.invoice-detail-card .form-card-head { position: relative; z-index: 1; align-items: center; justify-content: space-between; }
.invoice-detail-card .form-card-body, .invoice-detail-card .form-card-footer { position: relative; z-index: 1; }

.invoice-detail-card .form-card-head .invoice-status { margin-left: auto; }
.invoice-detail-card .invoice-view-meta-grid { padding-top: 24px; padding-bottom: 12px; }
.invoice-detail-card .invoice-view-actions { align-items: center; }
.invoice-view-card { width: 100%; padding: 0; overflow: hidden; }
.invoice-view-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 32px; border-bottom: 1px solid #EAECF0; }
.invoice-view-card-head h2 { margin: 0 0 6px; color: #101828; font-size: 24px; }
.invoice-view-card-body { padding: 0 32px 32px; }
.invoice-view-card-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 32px; border-top: 1px solid #EAECF0; }
.invoice-view-card-footer .btn { display: inline-flex; align-items: center; gap: 8px; }
.invoice-view-card-footer .btn img { width: 18px; height: 18px; object-fit: contain; }
.invoice-view-card-footer .btn:disabled { cursor: not-allowed; opacity: .6; }
.invoice-detail-card .form-card-body { font-size: 13px; }

.invoice-view-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.invoice-view-party { min-width: 0; }
.invoice-view-party.invoice-view-from { display: grid; }
.invoice-view-to { display: grid; padding-left: 32px; text-align: right; }
.invoice-view-meta-grid h3 { color: var(--text-dark); font-size: 15px; }
.invoice-view-meta-grid > .invoice-view-party.invoice-view-from > h3 { color: var(--text); font-size: 16px; }
.invoice-view-meta-grid p { margin: 4px 0; color: var(--muted); font-size: 14px; }
.invoice-header { display: grid; gap: 8px; color: var(--muted); font-size: var(--card-title-font-size); line-height: 1.5; }
.invoice-header > div { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.invoice-header strong { color: var(--text); font-weight: var(--font-weight-light); }
.invoice-view-date { display: flex; flex-direction: column; }
.invoice-view-meta-grid strong { display: block; margin-top: 8px; color: var(--text); font-size: 14px; font-weight: var(--font-weight-light); }
.invoice-view-label { margin-bottom: 4px; color: var(--muted); font-size: 16px; font-weight: var(--content-card-title-font-weight); }
.invoice-view-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 32px; }
.invoice-view-dates .invoice-view-date:last-child { text-align: right; }
.invoice-pdf-render { width: 794px !important; max-width: 794px !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
.invoice-pdf-render .invoice-page-heading, .invoice-pdf-render .invoice-detail-card .form-card-footer { display: none !important; }
.invoice-pdf-render .invoice-detail-card { border: 0 !important; box-shadow: none !important; }
.invoice-pdf-render .invoice-detail-card .form-card-head { border-bottom: 0 !important; }
.invoice-pdf-render .invoice-detail-card .form-card-head .invoice-status { display: none !important; }
.invoice-pdf-render .invoice-print-logo { display: block !important; width: 36px; height: 36px; margin-left: auto; object-fit: contain; }
.invoice-pdf-render .invoice-view-payment-note { display: none !important; }
.invoice-pdf-render .invoice-print-note { display: block !important; margin-top: 24px; color: #667085; font-size: 11px; line-height: 1.5; }
.invoice-pdf-render .invoice-view-summary .invoice-view-balance-due { background: #e9f9fd !important; }
.invoice-pdf-render .invoice-view-bottom-grid { display: block !important; }
.invoice-pdf-render .invoice-view-summary { width: 100%; min-width: 0; margin-top: 24px; }
.invoice-pdf-render .invoice-view-summary > div { box-sizing: border-box; }
.invoice-print-page { break-after: page; page-break-after: always; }
.invoice-print-page:last-child { break-after: auto; page-break-after: auto; }

.invoice-watermark { position: absolute; top: 52%; left: 50%; z-index: 2; transform: translate(-50%, -50%) rotate(-25deg); pointer-events: none; font-size: 92px; font-weight: 800; letter-spacing: .12em; line-height: 1; opacity: .1; white-space: nowrap; }
@media (max-width: 767px) {
  .invoice-watermark { font-size: 50px; }
}
.invoice-watermark-paid { color: var(--green-watermark); }
.invoice-watermark-cancelled { color: var(--red-watermark); }
.invoice-watermark-unpaid { color: var(--orange-watermark); }
.invoice-view-table-wrap { overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: 12px; }
.invoice-view-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.invoice-view-table th, .invoice-view-table td { padding: 12px 24px; border-bottom: 1px solid var(--outline-variant); text-align: left; white-space: nowrap; }
.invoice-view-table th { background: var(--primary-container); color: var(--muted); font-size: 12px; font-weight: var(--font-weight-bold); }
.invoice-view-table td { color: var(--text); font-size: 13px; }
.invoice-view-table th:last-child, .invoice-view-table td:last-child { text-align: right; }
.invoice-view-table tbody tr:last-child td { border-bottom: 0; }
.invoice-view-bottom-grid { display: grid; grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); align-items: end; gap: 16px; margin: 24px 0; }
.invoice-view-payment-note { align-self: end; color: var(--muted); font-size: 11px; line-height: 1.5; }
.invoice-print-note { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.invoice-print-note[hidden] { display: none; }

.invoice-view-summary { display: flex; flex-direction: column; gap: 10px; width: 100%; color: var(--muted); font-size: 13px; }
.invoice-view-bottom-grid .invoice-view-summary { margin-top: 0; }
.invoice-view-summary > div { display: flex; justify-content: space-between; width: 100%; gap: 32px; }
.invoice-view-summary strong { color: var(--text); }
.invoice-view-summary .invoice-view-credit { color: var(--red); }
.invoice-view-summary .invoice-view-credit strong { color: var(--red); }
.invoice-view-summary .invoice-view-grand-total { border-top: 1px solid #EAECF0; padding-top: 14px; }
.invoice-view-summary .invoice-view-grand-total,
.invoice-view-summary .invoice-view-amount-paid,
.invoice-view-summary .invoice-view-balance-due { color: var(--text); font-size: 14px; font-weight: var(--font-weight-bold); }
.invoice-view-summary .invoice-view-grand-total strong,
.invoice-view-summary .invoice-view-amount-paid strong,
.invoice-view-summary .invoice-view-balance-due strong { color: var(--text); font-size: 14px; font-weight: var(--font-weight-bold); }
.invoice-view-summary .invoice-view-balance-due { background: #e9f9fd; padding: 12px; }
.invoice-view-note { margin-top: 28px; border-top: 1px solid #EAECF0; padding-top: 18px; }
.invoice-view-note span { color: #667085; font-size: 12px; font-weight: var(--font-weight-bold); }
.invoice-view-note p { margin: 7px 0 0; color: #344054; white-space: pre-wrap; }
@media (min-width: 900px) and (max-width: 1200px) {
  .invoice-view-bottom-grid { grid-template-columns: minmax(0, 8fr) minmax(0, 12fr); }
}
@media (max-width: 899px) {
  .invoice-view-payment-note { align-self: start; margin-bottom: 24px; }
  .invoice-print-note { margin-bottom: 24px; }
  .invoice-view-bottom-grid { display: flex; flex-direction: column; margin-top: 8px; }
}
@media print {
  body:has(.invoice-detail-card) * { visibility: hidden; }
  body:has(.invoice-detail-card) .invoice-detail-card,
  body:has(.invoice-detail-card) .invoice-detail-card * { visibility: visible; }
  .invoice-detail-card { position: absolute; inset: 0; max-width: none; padding: 0; }
  .invoice-detail-card .invoice-page-heading,
  .invoice-detail-card .form-card-footer { display: none; }
  .invoice-view-toolbar { display: none; }
  .invoice-view-card { border: 0; box-shadow: none; }
}
@media (max-width: 767px) {
  .invoice-view-card-head { padding: 20px 16px; }
  .invoice-view-card-body { padding: 0 16px 20px; }
  .invoice-view-card-footer { padding: 16px; flex-wrap: wrap; }
  .invoice-view-meta-grid { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .invoice-view-card-head h2 { font-size: 21px; }
  .invoice-view-bottom-grid { gap: 20px; }
  .invoice-view-bottom-grid .invoice-view-summary { margin-left: auto; }
}

.subscription-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; color: var(--muted); text-align: center; }
.subscription-empty strong { color: var(--text); font-size: 14px; }
.subscription-empty span { font-size: 13px; }
@media (max-width: 767px) {
  .subscription-invoices-actions { width: 100%; justify-content: space-between; }
  .content-card-filters { padding: 18px; }
  .content-card-filters > .table-searchbar { width: 100%; }
  .subscription-invoice-status-chips { max-width: 100%; overflow-x: auto; }
  .subscription-create-invoice { width: auto; }
}

/* ---------- web/tablet table search bars ---------- */
@media (min-width: 768px) {
  /* Registered Businesses: search occupies half of the table card width. */
  .content-card-head .table-searchbar { width: 60%; }

  /* Settings list tables: search occupies half of the table toolbar. */
  .mng-table .table-card-head .table-searchbar { width: 50%; }

  /* Subscription invoices: keep the search + action group at half-table width. */
  .subscription-invoices-actions { width: 50%; }
  .subscription-invoices-actions .table-searchbar { width: auto; min-width: 0; }
}

/* ---------- Create invoice ---------- */
.invoice-page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.invoice-page-heading h2 { margin: 12px 0 4px; font-size: 24px; font-weight: var(--font-weight-bold); color: var(--text); }
.invoice-page-heading p { color: var(--muted); font-size: 13px; }
.invoice-form-card { display: flex; flex-direction: column; }
.invoice-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.invoice-form-grid .field { display: flex; flex-direction: column; gap: 7px; }
.invoice-form-grid .field > span { color: #344054; font-size: 13px; font-weight: var(--font-weight-normal); }
.invoice-form-grid input, .invoice-form-grid select, .invoice-form-grid textarea { width: 100%; border: 1px solid var(--light-grey); border-radius: 8px; background: #fff; color: var(--text); font: inherit; font-size: 14px; padding: 10px 12px; }
.invoice-form-grid input, .invoice-form-grid select { min-height: 42px; }
.invoice-form-grid .cal-field { width: 100%; }
.invoice-form-grid .cal-field input[type="text"] { box-sizing: border-box; }
.invoice-actions button:disabled { opacity: .5; cursor: not-allowed; }
.invoice-form-grid input:focus, .invoice-form-grid select:focus, .invoice-form-grid textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(70,95,255,.12); }
.invoice-form-grid input[readonly] { background: #F9FAFB; color: var(--muted); }
.invoice-additional-info { grid-column: 1 / -1; }
.invoice-divider { height: 1px; margin: 28px 0; background: var(--outline-variant); }
.invoice-items-wrap { overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: 12px; }
.invoice-estimate-notice { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0; padding: 12px 14px; border: 1px solid #F5D48A; border-radius: 8px; background: #FFFBEB; color: #7A4B00; font-size: 12px; line-height: 1.45; }
.invoice-estimate-notice strong { white-space: nowrap; }
.invoice-items-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.invoice-items-table th { padding: 12px 24px; background: var(--primary-container); border-bottom: 1px solid var(--outline-variant); color: var(--muted); font-size: 12px; font-weight: var(--font-weight-bold); text-align: left; text-transform: capitalize; letter-spacing: .04em; }
.invoice-items-table td { padding: 12px 24px; color: var(--text); font-size: 13px; }
.invoice-items-table td small { display: block; margin-top: 5px; color: #667085; font-size: 12px; line-height: 1.45; }
.invoice-inline-amount { display: flex; align-items: center; gap: 5px; min-width: 120px; }
.invoice-inline-amount > span { color: #667085; font-size: 12px; font-weight: var(--font-weight-bold); }
.invoice-inline-edit { width: 100%; min-width: 92px; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--light-grey); border-radius: 6px; background: #fff; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.invoice-inline-edit:focus { outline: 2px solid rgba(59,130,246,.25); border-color: #3B82F6; }
.invoice-proration-row td { background: #FFFBEB; color: #92400E; }
.invoice-items-table th:first-child, .invoice-items-table td:first-child { width: 60px; }
.invoice-items-table th:last-child, .invoice-items-table td:last-child { width: 60px; text-align: center; }
.invoice-items-table th:nth-last-child(2), .invoice-items-table td:nth-last-child(2) { text-align: right; }

.invoice-total-cell { font-weight: var(--font-weight-bold); white-space: nowrap; }
.invoice-delete-btn { width: 30px; height: 30px; min-width: 30px; color: var(--red); font-size: 20px; }
.invoice-empty-row { color: var(--muted) !important; text-align: center; }
.invoice-summary { display: flex; justify-content: flex-end; width: 100%; flex-direction: column; gap: 10px; max-width: none; }
@media (min-width: 768px) {
  .invoice-view-bottom-grid:has(#invoicePrintNote[hidden]) { display: flex; justify-content: flex-end; }
  .invoice-view-bottom-grid:has(#invoicePrintNote[hidden]) .invoice-summary { width: 40%; }
}
.invoice-summary-lines { display: grid; gap: 10px; }
.invoice-summary-lines small { display: block; margin-top: 3px; color: #667085; font-size: 12px; font-weight: var(--font-weight-light); }
.invoice-summary-lines > div { display: flex; justify-content: space-between; gap: 24px; font-size: 14px; color: var(--muted); }
.invoice-summary strong { color: var(--text); font-size: 14px; font-weight: var(--font-weight-bold); }
#invoiceSummaryProration { color: var(--red); }
#invoiceProrationLine > span { color: var(--red); }
.invoice-grand-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid #E4E7EC; color: var(--text) !important; font-weight: var(--font-weight-bold); }
.invoice-grand-total strong { font-size: 18px; }
.invoice-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #E4E7EC; }
.invoice-submit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.invoice-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.invoice-actions .btn img { filter: brightness(0) invert(1); }
.invoice-actions .btn-secondary img { filter: brightness(0) saturate(100%) invert(48%) sepia(99%) saturate(1939%) hue-rotate(204deg) brightness(101%) contrast(95%); }
.invoice-actions .btn-tertiary img { filter: brightness(0) saturate(100%) invert(48%) sepia(99%) saturate(1939%) hue-rotate(204deg) brightness(101%) contrast(95%); }
.invoice-actions #saveInvoiceBtn { color: var(--primary); border-color: var(--primary); }
.invoice-actions #saveInvoiceBtn img { filter: brightness(0) saturate(100%) invert(35%) sepia(99%) saturate(2265%) hue-rotate(224deg) brightness(100%) contrast(101%); }
.invoice-cancel-btn { color: #344054; background: #fff; border: 1px solid var(--light-grey); }
.invoice-cancel-btn:hover { background: #F9FAFB; }

/* Item Detail inline-edit fields use form-grid styling only after entering edit mode. */
.detail-grid .info-item { gap: 7px; }

.detail-grid .plain-select {
  width: 100%; box-sizing: border-box;
  padding: 0 44px 0 16px;
  border: 1px solid var(--light-grey); border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4.79175 7.396L10.0001 12.6043L15.2084 7.396' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px 20px;
  color: var(--text-dark); font-size: 13px; min-width: 200px;
  appearance: none;
}

/* Normal text baseline. Component-specific headings and controls retain their scoped sizes. */
span, b, p, table td { font-size: 13px; }
form label > span, label.field > span { font-size: 13px !important; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),
select,
.btn,
.searchable-select-trigger {
  height: 40px !important;
  min-height: 40px !important;
}
@media (max-width: 767px) {
  .detail-grid .plain-select { min-width: 150px; }
}
@media (max-width: 767px) {
  .invoice-page-heading { align-items: flex-start; }
  .invoice-form-grid { grid-template-columns: 1fr; gap: 16px; }
  .invoice-additional-info { grid-column: auto; }
  .card-head, .card-footer { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .card-head { margin-top: -18px; margin-bottom: 18px; }
  .card-footer { margin-top: 18px; margin-bottom: -18px; }
  .invoice-summary { justify-content: stretch; padding-right: 0; }
  .invoice-summary-lines { width: 100%; min-width: 0; }

  .invoice-actions { align-items: stretch; flex-direction: column; }
  .invoice-submit-actions { flex-direction: column-reverse; align-items: stretch; }
  .invoice-actions .btn { width: 100%; justify-content: center; }
}

/* Standard form controls: 40px across every page and role. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
.searchable-select-trigger,
.searchable-select-search
{
  border: 1px solid var(--light-grey);
}

.btn,
.btn-sm,
.reports-download-btn,
.rep-filter-btn {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
}

@media print {
  @page { margin: 0; }
  body { margin: 0 !important; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .drawer, .topbar, .invoice-page-heading, .invoice-detail-card .form-card-footer { display: none !important; }
  .app-shell, .main, .content { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .invoice-detail-card { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
  .invoice-detail-card .form-card-head { border-bottom: 0 !important; }
  .invoice-detail-card .form-card-head .invoice-status { display: none !important; }
  .invoice-print-logo { display: block !important; width: 36px; height: 36px; margin-left: auto; object-fit: contain; }
  .invoice-print-page { break-after: page; page-break-after: always; }
  .invoice-print-page:last-child { break-after: auto; page-break-after: auto; }

  .invoice-view-summary .invoice-view-balance-due { background: #e9f9fd !important; }
  .invoice-view-payment-note { display: none !important; }
  .invoice-print-note { display: block !important; margin-top: 24px; color: #667085; font-size: 11px; line-height: 1.5; }
}
