:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef3ed;
  --text: #20241f;
  --muted: #667065;
  --line: #dfe4dc;
  --primary: #176f5f;
  --primary-dark: #0f4b43;
  --accent: #b2772e;
  --danger: #b63d32;
  --success: #247647;
  --shadow: 0 18px 45px rgba(31, 38, 33, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Cairo", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(244, 245, 242, 0.92)),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  outline: none;
}

input[type="number"],
input[type="tel"],
.number-input,
[inputmode="decimal"],
#customerPhone,
#saleCustomerPhone,
#loginPassword {
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 111, 95, 0.12);
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 111, 95, 0.12);
}

select.native-select-hidden {
  display: none !important;
}

.smart-select {
  position: relative;
  width: 100%;
  min-width: 0;
  color: var(--text);
  font: inherit;
}

.smart-combo {
  position: relative;
  width: 100%;
  min-width: 0;
}

.smart-select-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 247, 0.98));
  color: var(--text);
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: right;
  box-shadow: 0 8px 18px rgba(31, 38, 33, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.smart-select.open .smart-select-button,
.smart-select-button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 111, 95, 0.12);
}

.smart-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.smart-select-arrow {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef5f1;
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  transition: transform 140ms ease;
}

.smart-select.open .smart-select-arrow {
  transform: rotate(180deg);
}

.smart-select-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 80;
  border: 1px solid rgba(23, 111, 95, 0.22);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(31, 38, 33, 0.16);
  padding: 7px;
}

.smart-combo-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 90;
  border: 1px solid rgba(23, 111, 95, 0.22);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(31, 38, 33, 0.16);
  padding: 7px;
}

.smart-combo.open input {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 111, 95, 0.12);
}

.smart-combo-hint {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid rgba(23, 111, 95, 0.2);
  border-radius: 7px;
  background: #f8faf7;
  color: var(--muted);
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.smart-select-search {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding-bottom: 6px;
}

.smart-select-search input {
  min-height: 36px;
  border-radius: 7px;
  background: #f8faf7;
  font-size: 12px;
  font-weight: 800;
}

.smart-select-options {
  display: grid;
  gap: 4px;
  max-height: min(330px, 52vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-left: 2px;
}

.smart-select-option {
  width: 100%;
  min-height: 34px;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.smart-select-option:hover,
.smart-select-option.active {
  background: #eef6f1;
  color: var(--primary);
}

.smart-select-option:disabled {
  color: #9aa39a;
  background: #f5f7f4;
  cursor: not-allowed;
}

.smart-select-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.smart-select.is-disabled .smart-select-button {
  opacity: 0.58;
  cursor: not-allowed;
}

.inline-control .smart-select,
.invoice-lines.sale-lines .inline-control .smart-select {
  width: 88px;
}

.purchase-cost-method.native-select-hidden + .smart-select {
  width: 140px;
}

.smart-combo.is-disabled {
  opacity: 0.58;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label span {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

td {
  font-size: 13px;
}

td strong {
  display: block;
  font-size: 13px;
}

td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  padding: 24px;
  align-items: stretch;
}

.login-brand-panel {
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(17, 56, 50, 0.83), rgba(17, 56, 50, 0.88)),
    url("https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  min-height: 520px;
}

.login-brand-panel h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.16;
  max-width: 850px;
  margin: 6px 0 18px;
}

.login-brand-panel p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
}

.login-card {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.login-card h2 {
  margin: 0;
  font-size: 25px;
}

.signature-strip {
  width: fit-content;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.12);
}

.signature-strip strong {
  color: #fff;
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.hint-box {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
}

.hint-box strong {
  color: var(--text);
}

.branch-select-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  gap: 24px;
  padding: 24px;
  align-items: stretch;
}

.branch-select-hero {
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(17, 43, 39, 0.94), rgba(23, 111, 95, 0.78)),
    url("https://images.unsplash.com/photo-1584622650111-993a426fbf0a?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-height: 560px;
}

.branch-select-hero h1 {
  max-width: 580px;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.18;
}

.branch-select-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.8;
}

.branch-logout {
  width: fit-content;
  margin-top: 18px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  align-content: center;
}

.branch-card {
  min-height: 190px;
  border: 1px solid rgba(31, 38, 33, 0.08);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 247, 0.96)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--branch-accent) 20%, transparent), transparent 42%);
  color: var(--text);
  padding: 22px;
  display: grid;
  gap: 10px;
  justify-items: start;
  text-align: right;
  box-shadow: 0 18px 42px rgba(31, 38, 33, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.branch-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--branch-accent) 42%, var(--line));
  box-shadow: 0 20px 48px rgba(31, 38, 33, 0.13);
}

.branch-card strong {
  font-size: 22px;
}

.branch-card small {
  color: var(--muted);
  line-height: 1.7;
}

.branch-card em {
  align-self: end;
  color: var(--branch-accent);
  font-style: normal;
  font-weight: 900;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns 160ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app-shell.cashier-mode {
  grid-template-columns: minmax(0, 1fr);
}

.cashier-mode .sidebar {
  display: none;
}

.cashier-mode .page {
  padding-inline: 18px;
}

.sidebar {
  min-height: 100vh;
  background: #112b27;
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-area strong,
.brand-area span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-area span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #f3c16b;
  color: #17221f;
  font-weight: 900;
  letter-spacing: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.brand-mark.large {
  width: 68px;
  height: 68px;
  font-size: 24px;
  margin-bottom: 18px;
}

.brand-mark.invoice {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 15px;
  flex: 0 0 auto;
}

.sidebar-toggle,
.sidebar-expand-button {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transition: 160ms ease;
  flex: 0 0 auto;
}

.sidebar-toggle:hover,
.sidebar-expand-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-expand-button {
  background: #112b27;
  box-shadow: 0 10px 22px rgba(17, 43, 39, 0.18);
}

.sidebar-expand-button:hover {
  background: #17463f;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: right;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.5), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--nav-color) 90%, #ffffff), color-mix(in srgb, var(--nav-color) 76%, #0b261f));
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: 160ms ease;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--nav-color) 28%, transparent);
}

.sidebar-collapsed .sidebar {
  padding: 14px 10px;
  align-items: center;
}

.sidebar-collapsed .sidebar-head {
  display: grid;
  justify-items: center;
}

.sidebar-collapsed .brand-area {
  padding: 0;
  justify-content: center;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-footer {
  display: none;
}

.sidebar-collapsed .brand-mark {
  width: 42px;
  height: 42px;
}

.sidebar-collapsed .sidebar-toggle {
  width: 42px;
  height: 34px;
}

.sidebar-collapsed .nav-list {
  width: 100%;
  justify-items: center;
}

.sidebar-collapsed .nav-item {
  width: 52px;
  height: 52px;
  min-height: 52px;
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .nav-icon {
  width: 34px;
  height: 34px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px 10px 2px;
  display: grid;
  gap: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.sidebar-footer strong {
  color: #fff;
  font-size: 14px;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(244, 245, 242, 0.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 228, 220, 0.8);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-search {
  position: relative;
  width: min(360px, 34vw);
  min-width: 240px;
  flex: 1 1 280px;
}

.global-search > span {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 900;
  z-index: 2;
}

.global-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 38px 8px 38px;
  font-weight: 800;
}

.global-search-clear {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 7px;
  background: #eef5f1;
  color: var(--primary);
  z-index: 3;
}

.global-search-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 30;
  max-height: min(520px, 72vh);
  overflow: auto;
  border: 1px solid rgba(23, 111, 95, 0.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 42px rgba(17, 43, 39, 0.18);
  padding: 6px;
}

.global-search-menu button,
.global-search-empty {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 2px 10px;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: right;
}

.global-search-menu button {
  background: transparent;
  color: var(--text);
}

.global-search-menu button:hover {
  background: #f3faf6;
}

.global-search-menu em {
  grid-row: span 2;
  align-self: center;
  justify-self: start;
  border-radius: 999px;
  background: #edf7f3;
  color: var(--primary);
  padding: 4px 8px;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.global-search-menu strong,
.global-search-menu small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-menu small,
.global-search-empty {
  color: var(--muted);
  font-size: 12px;
}

.cashier-mode-button {
  min-height: 42px;
  border: 1px solid rgba(23, 111, 95, 0.18);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  padding: 8px 12px;
  font-weight: 900;
  white-space: nowrap;
}

.cashier-mode-button.active {
  background: #112b27;
  border-color: #112b27;
  color: #fff;
}

.branch-switcher {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.branch-switcher button {
  min-height: 34px;
  border-radius: 6px;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.branch-switcher button.active {
  background: color-mix(in srgb, var(--branch-accent) 14%, #fff);
  color: var(--branch-accent);
}

.cloud-chip {
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 7px 10px;
  display: grid;
  gap: 1px;
  text-align: center;
}

.cloud-chip span {
  font-size: 12px;
  font-weight: 900;
}

.cloud-chip small {
  font-size: 10px;
  color: var(--muted);
}

.cloud-chip.online {
  border-color: rgba(36, 126, 105, 0.24);
  background: rgba(235, 248, 243, 0.9);
  color: var(--success);
}

.cloud-chip.syncing {
  border-color: rgba(194, 122, 28, 0.28);
  background: rgba(255, 246, 229, 0.95);
  color: var(--accent);
}

.cloud-chip.pending {
  border-color: rgba(41, 121, 115, 0.26);
  background: rgba(236, 248, 247, 0.96);
  color: #28766f;
}

.cloud-chip.offline {
  border-color: rgba(114, 91, 65, 0.24);
  background: rgba(249, 243, 234, 0.96);
  color: #79552f;
}

.cloud-chip.error {
  border-color: rgba(184, 49, 47, 0.25);
  background: rgba(255, 240, 238, 0.96);
  color: var(--danger);
}

.user-chip {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 12px;
  display: grid;
  gap: 2px;
}

.user-chip span {
  font-weight: 800;
}

.user-chip small {
  color: var(--muted);
}

.account-password-button {
  min-height: 42px;
  border: 1px solid rgba(23, 111, 95, 0.18);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary-dark);
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(17, 43, 39, 0.06);
}

.account-password-button b {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef7f3;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 14px;
  line-height: 1;
}

.account-password-button:hover {
  border-color: rgba(23, 111, 95, 0.34);
  background: #f8fcfa;
}

.chat-topbar-button {
  position: relative;
  min-height: 44px;
  border: 1px solid rgba(23, 111, 95, 0.2);
  border-radius: var(--radius);
  background: #f4faf6;
  color: var(--primary);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 1500px) and (min-width: 1101px) {
  .topbar {
    padding-inline: 18px;
    gap: 12px;
  }

  .topbar-actions {
    gap: 8px;
    min-width: 0;
  }

  .global-search {
    width: 260px;
    min-width: 190px;
    flex: 0 1 260px;
  }

  .branch-switcher {
    max-width: 220px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .branch-switcher button {
    padding-inline: 8px;
  }

  .cloud-chip {
    min-width: 68px;
    padding: 6px 8px;
  }

  .user-chip {
    min-width: 104px;
    max-width: 128px;
    padding: 7px 9px;
  }

  .cloud-chip small,
  .user-chip small {
    display: none;
  }

  .cashier-mode-button {
    padding-inline: 10px;
  }
}

.chat-topbar-button b {
  position: absolute;
  top: -8px;
  inset-inline-start: -8px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 6px 14px rgba(182, 61, 50, 0.24);
}

.chat-widget {
  position: fixed;
  inset-inline-start: 24px;
  bottom: 24px;
  width: min(620px, calc(100vw - 48px));
  height: min(520px, calc(100vh - 120px));
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid #cfe0d7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(12, 35, 28, 0.18);
  overflow: hidden;
  animation: chatPanelIn 180ms ease-out;
}

.chat-widget .small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f4faf6;
  border-bottom: 1px solid var(--line);
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-head span,
.chat-users small,
.chat-message small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.chat-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-tabs button {
  position: relative;
  border: 1px solid #d7e4dc;
  border-radius: 999px;
  background: #f8fbf9;
  color: var(--muted);
  padding: 8px 14px;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.chat-tabs button.active {
  border-color: rgba(23, 111, 95, 0.25);
  background: #e7f4ef;
  color: var(--primary);
}

.chat-tabs button:hover {
  transform: translateY(-1px);
}

.chat-tabs b {
  position: absolute;
  top: -7px;
  inset-inline-start: -6px;
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
}

.chat-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 190px 1fr;
}

.chat-body.single {
  grid-template-columns: 1fr;
}

.chat-users {
  min-height: 0;
  overflow: auto;
  border-inline-end: 1px solid var(--line);
  background: #fbfdfb;
  padding: 10px;
}

.chat-users button {
  position: relative;
  width: 100%;
  text-align: start;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.chat-users button.active {
  border-color: rgba(23, 111, 95, 0.18);
  background: #eaf6f1;
  box-shadow: 0 10px 18px rgba(23, 111, 95, 0.08);
}

.chat-users button:hover {
  transform: translateX(-2px);
}

.chat-users strong,
.chat-users small,
.chat-users em {
  display: block;
}

.chat-users strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-users small,
.chat-users em {
  margin-top: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-users em {
  color: #7b867d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.presence-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #b8c2bb;
  box-shadow: 0 0 0 3px rgba(184, 194, 187, 0.16);
}

.presence-dot.online {
  background: #1f9d65;
  box-shadow: 0 0 0 3px rgba(31, 157, 101, 0.16);
}

.presence-dot.online::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px solid rgba(31, 157, 101, 0.34);
  animation: presencePulse 1.8s ease-out infinite;
}

.presence-dot.recent {
  background: #d59b38;
  box-shadow: 0 0 0 3px rgba(213, 155, 56, 0.14);
}

.chat-presence-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid #e4ece5;
  background: #f6fbf8;
}

.chat-presence-strip span,
.chat-presence-strip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.chat-presence-strip strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d9e6dd;
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.chat-users b {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
}

.chat-conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

.chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #fff;
}

.chat-message {
  max-width: 82%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f2f5f2;
  animation: chatBubbleIn 180ms ease-out both;
}

.chat-message.mine {
  margin-inline-start: auto;
  background: #e6f3ee;
  border-bottom-inline-end-radius: 4px;
}

.chat-message.theirs {
  margin-inline-end: auto;
  border-bottom-inline-start-radius: 4px;
}

.chat-message.admin-note {
  max-width: 100%;
  border: 1px solid rgba(190, 137, 54, 0.24);
  background: #fff9ed;
}

.chat-message p {
  margin: 0 0 5px;
  white-space: pre-wrap;
  font-weight: 800;
  line-height: 1.6;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fbfdfb;
}

.chat-compose textarea {
  resize: none;
  min-height: 46px;
  border: 1px solid #cfdbd4;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 800;
}

.chat-admin-compose {
  border-top: 1px solid var(--line);
  background: #fbfdfb;
}

.chat-admin-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px 0;
}

.chat-admin-targets select {
  min-height: 40px;
  border: 1px solid #cfdbd4;
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
  font-weight: 900;
}

.chat-empty {
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
}

@keyframes presencePulse {
  from {
    opacity: 0.75;
    transform: scale(0.78);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes chatPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatBubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-metrics {
  margin-bottom: 18px;
}

.brand-toolbar {
  align-items: stretch;
}

.notice-box.compact {
  padding: 12px 14px;
  align-self: center;
}

.brand-table-wrap {
  max-height: calc(100vh - 360px);
}

.brand-table td {
  vertical-align: middle;
}

.brand-table td strong,
.brand-table td small {
  display: block;
}

.brand-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.compact-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d7e1da;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  font-weight: 900;
}

.compact-input.numeric {
  direction: ltr;
  text-align: center;
}

.teal-action {
  border-color: rgba(23, 111, 95, 0.25) !important;
  background: #eef8f5 !important;
  color: var(--primary) !important;
}

.whatsapp-button {
  border-color: #bfe4d3 !important;
  color: #157347 !important;
}

.page {
  padding: 24px 28px 40px;
  display: grid;
  gap: 20px;
}

.hero-band {
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(18, 54, 49, 0.92), rgba(23, 111, 95, 0.74)),
    url("https://images.unsplash.com/photo-1600566753190-17f0baa2a6c3?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 210px;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.hero-band h2 {
  max-width: 760px;
  margin: 6px 0 10px;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.2;
}

.hero-band p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.hero-signature {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 180px;
}

.hero-signature span,
.hero-signature strong {
  display: block;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.login-brand-panel .eyebrow,
.hero-band .eyebrow {
  color: #f3c16b;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 24px;
  line-height: 1.25;
}

.metric-card small {
  color: var(--muted);
}

.performance-hero {
  min-height: 175px;
  background:
    linear-gradient(90deg, rgba(16, 56, 47, 0.96), rgba(33, 113, 99, 0.82)),
    linear-gradient(135deg, #10382f, #176f5f 54%, #b2772e);
  position: relative;
  overflow: hidden;
}

.performance-hero::after {
  content: "";
  position: absolute;
  inset: auto 26px 24px auto;
  width: min(42vw, 420px);
  height: 90px;
  border-block: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(255, 255, 255, 0.14) 14% 16%, transparent 16% 32%, rgba(255, 255, 255, 0.18) 32% 34%, transparent 34% 55%, rgba(255, 255, 255, 0.13) 55% 57%, transparent 57% 78%, rgba(255, 255, 255, 0.2) 78% 80%, transparent 80%),
    linear-gradient(180deg, transparent 0 60%, rgba(255, 255, 255, 0.14) 60% 63%, transparent 63%);
  opacity: 0.7;
  pointer-events: none;
}

.performance-hero > * {
  position: relative;
  z-index: 1;
}

.performance-badge {
  width: 150px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.06), 0 18px 34px rgba(0, 0, 0, 0.18);
}

.performance-badge span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.performance-badge strong {
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.performance-metrics .metric-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 247, 0.96));
}

.performance-metrics .metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}

.performance-metrics .metric-card:nth-child(2)::before,
.performance-metrics .metric-card:nth-child(5)::before {
  background: #b2772e;
}

.performance-metrics .metric-card:nth-child(4)::before {
  background: var(--success);
}

.performance-metrics .metric-card:nth-child(6)::before {
  background: var(--danger);
}

.inventory-metrics .inventory-value-card {
  background: #f1f8f5;
  border-color: #cfe6da;
}

.inventory-metrics .inventory-value-card strong {
  color: var(--primary);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(28, 36, 30, 0.05);
  padding: 18px;
  min-width: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.panel.inner {
  box-shadow: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.split-layout.reverse {
  grid-template-columns: minmax(380px, 0.55fr) minmax(0, 1fr);
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(320px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.settings-policy-editor {
  display: grid;
  gap: 14px;
}

.settings-policy-editor textarea {
  min-height: 220px;
  font-weight: 800;
  line-height: 1.8;
}

.system-health-panel {
  margin-top: 16px;
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.system-health-grid div {
  position: relative;
  overflow: hidden;
  border: 1px solid #dce7df;
  border-radius: 12px;
  background: #fbfcfa;
  padding: 12px;
}

.system-health-grid div::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: #9ca8a0;
}

.system-health-grid .ok::before {
  background: #1f9d65;
}

.system-health-grid .info::before {
  background: #2d7fbd;
}

.system-health-grid .warning::before {
  background: #d59b38;
}

.system-health-grid .danger::before {
  background: #b63d32;
}

.system-health-grid span,
.system-health-grid strong {
  display: block;
}

.system-health-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.system-health-grid strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.invoice-reference-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.resizable-split-layout {
  grid-template-columns:
    minmax(var(--split-first-min, 280px), var(--split-first, 38%))
    10px
    minmax(0, 1fr) !important;
  gap: 8px;
}

.split-layout.reverse.resizable-split-layout {
  grid-template-columns:
    minmax(var(--split-first-min, 300px), var(--split-first, 42%))
    10px
    minmax(0, 1fr) !important;
}

.split-resizer {
  align-self: stretch;
  min-height: 160px;
  width: 10px;
  min-width: 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
}

.split-resizer span {
  width: 4px;
  height: min(92px, 42%);
  min-height: 42px;
  border-radius: 999px;
  background: #d7e0d8;
  box-shadow: inset 0 0 0 1px rgba(23, 111, 95, 0.06);
  transition: 160ms ease;
}

.split-resizer:hover span,
.resizable-split-layout.is-resizing .split-resizer span {
  width: 6px;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(23, 111, 95, 0.1);
}

.resizable-split-layout.is-resizing {
  user-select: none;
}

.resizable-split-layout.is-resizing > :not(.split-resizer) {
  pointer-events: none;
}

.invoice-list-panel {
  position: sticky;
  top: 104px;
}

.invoice-preview-panel {
  min-height: 68vh;
}

.invoice-preview-frame {
  min-height: 54vh;
  display: grid;
  align-items: start;
  animation: premiumReveal 180ms ease-out;
}

.invoice-preview-frame .invoice-paper {
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 24px;
}

.invoice-reference-profit {
  display: block;
  width: fit-content;
  margin: -2px 0 8px auto;
}

.invoice-status-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.invoice-status-panel div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
}

.invoice-status-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.invoice-status-panel strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.delivery-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px);
  align-items: end;
}

.delivery-layout .invoice-list-panel {
  top: 104px;
}

.delivery-sale-card {
  display: grid;
  gap: 14px;
}

.delivery-adjust-card {
  border: 1px solid rgba(23, 111, 95, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdfb, #fff);
  padding: 14px;
}

.delivery-adjust-card .notice-box {
  margin-top: 0;
}

.delivery-customer-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.delivery-form-grid {
  grid-template-columns: 1fr;
}

.delivery-history {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.delivery-history > strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.delivery-results button small {
  line-height: 1.7;
}

.delivery-print-paper .invoice-customer {
  grid-template-columns: repeat(3, minmax(0, 170px));
}

.reference-upload-panel {
  margin-bottom: 16px;
}

.reference-compression-card {
  border: 1px solid #dce7dc;
  border-radius: var(--radius);
  background: #f8faf7;
  padding: 12px;
  margin-top: 4px;
}

.reference-compression-card small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
  margin-top: 6px;
}

.reference-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.reference-list-panel {
  position: sticky;
  top: 104px;
}

.reference-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 170px);
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.reference-filters .search-box {
  min-width: 0;
}

.reference-results {
  max-height: 520px;
  overflow: auto;
  padding-left: 2px;
}

.reference-preview-panel {
  min-height: 70vh;
}

.reference-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reference-viewer {
  margin-top: 14px;
  min-height: 62vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf7;
  overflow: hidden;
}

.reference-viewer iframe,
.reference-viewer img {
  display: block;
  width: 100%;
  height: 62vh;
  border: 0;
  background: #fff;
}

.reference-viewer img {
  height: auto;
  min-height: 360px;
  object-fit: contain;
  padding: 14px;
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sales-layout.invoice-entry-layout {
  grid-template-columns: minmax(0, 1fr);
}

.form-panel {
  position: sticky;
  top: 104px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field-full textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.7;
}

.price-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.price-rule-card {
  display: grid;
  gap: 10px;
  border: 1px solid #dce7dc;
  border-radius: var(--radius);
  background: #f8faf7;
  padding: 12px;
}

.price-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-rule-head strong {
  font-size: 14px;
}

.price-rule-head small {
  color: var(--primary);
  direction: ltr;
  font-weight: 900;
}

.computed-price-line {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.computed-price-line strong {
  color: var(--primary);
  direction: ltr;
  font-size: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.invoice-actions {
  align-items: center;
  justify-content: space-between;
}

.sale-sticky-checkout {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  border-top: 1px solid rgba(223, 228, 220, 0.92);
  background: #fff;
  padding: 10px 0 2px;
  box-shadow: none;
}

.sale-sticky-checkout .summary-box {
  margin-top: 0;
}

.invoice-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.print-action-pair {
  display: inline-flex;
  gap: 6px;
  align-items: stretch;
}

.sale-cloud-confirmation {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sale-cloud-confirmation.verified {
  border-color: rgba(36, 126, 105, 0.24);
  background: rgba(235, 248, 243, 0.95);
  color: var(--success);
  animation: verifiedGlow 900ms ease-out;
}

.sale-cloud-confirmation.syncing,
.sale-cloud-confirmation.pending {
  border-color: rgba(41, 121, 115, 0.26);
  background: rgba(236, 248, 247, 0.96);
  color: #28766f;
}

.sale-cloud-confirmation.local {
  border-color: rgba(114, 91, 65, 0.24);
  background: rgba(249, 243, 234, 0.96);
  color: #79552f;
}

.sale-cloud-confirmation.error {
  border-color: rgba(184, 49, 47, 0.25);
  background: rgba(255, 240, 238, 0.96);
  color: var(--danger);
}

.sale-cloud-confirmation button {
  border: 0;
  border-radius: 5px;
  padding: 5px 8px;
  background: rgba(184, 49, 47, 0.1);
  color: var(--danger);
  font: inherit;
  cursor: pointer;
}

.print-action-pair.compact {
  gap: 4px;
  align-items: center;
}

.print-action-pair.compact .icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.thermal-print-button {
  min-width: 58px;
  padding-inline: 12px;
  background: #fff8eb;
  color: #9a5a0a;
  border-color: #ead8b3;
}

.print-action-pair.compact .thermal-print-button {
  min-width: 34px;
  padding-inline: 0;
}

.thermal-section-title {
  display: block;
  padding: 6px 0 3px;
  color: #000;
  border-bottom: 1.5px dashed #000;
  font-size: 12px;
  font-weight: 900;
}

.silent-profit {
  margin-right: auto;
  color: #637269;
  direction: ltr;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.78;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.inventory-toolbar {
  justify-content: flex-start;
}

.inventory-toolbar .search-box {
  flex: 1 1 360px;
}

.section-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 111, 95, 0.18);
  border-radius: 10px;
  background: #eef7f3;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.toolbar-filter {
  min-width: 150px;
}

.toolbar-filter span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.toolbar-filter select {
  min-height: 42px;
}

.hidden-file-input {
  display: none;
}

.search-box {
  min-width: min(100%, 420px);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #fff;
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  border: 0;
  box-shadow: none;
  padding-inline: 0;
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 9px 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #eadbc4;
  color: #2d251a;
}

.secondary.danger-outline {
  background: #fff4f2;
  color: var(--danger);
  border: 1px solid #f0c7c2;
}

.password-cell {
  display: inline-flex;
  direction: rtl;
  border: 1px solid #dbe6df;
  border-radius: 6px;
  background: #f7faf8;
  padding: 5px 8px;
  color: #1b2b25;
  font-weight: 800;
  letter-spacing: 0;
}

.excel-action {
  background:
    linear-gradient(135deg, #0d5d58, #177c72);
  color: #fff;
  border: 1px solid rgba(13, 93, 88, 0.35);
  box-shadow: 0 10px 20px rgba(13, 93, 88, 0.14);
}

.excel-action:hover {
  background:
    linear-gradient(135deg, #0a4946, #12675f);
  color: #fff;
  transform: translateY(-1px);
}

.product-export-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(13, 93, 88, 0.14);
  border-radius: 12px;
  background: #f3faf7;
}

.product-export-strip > span {
  min-width: 62px;
  padding: 0 8px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.product-export-strip button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 9px;
  white-space: nowrap;
  box-shadow: none;
}

.product-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid rgba(13, 93, 88, 0.12);
  border-radius: 12px;
  background: #f8fbf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-pagination.compact {
  justify-content: center;
}

.product-pagination > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.product-pagination strong {
  min-width: 58px;
  color: var(--text);
  text-align: center;
}

.product-pagination .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
}

.export-option {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid rgba(13, 93, 88, 0.18);
}

.export-option:hover:not(:disabled) {
  background: #eaf4ef;
  color: var(--primary-dark);
}

.bulk-delete-option {
  background: #fff5f3;
  color: #a8372b;
  border: 1px solid rgba(168, 55, 43, 0.22);
}

.bulk-delete-option:hover:not(:disabled) {
  background: #ffe6e1;
  color: #8f2b22;
}

.select-column {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.select-column input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.ghost {
  background: #eef3ed;
  color: var(--text);
}

.danger {
  background: #f5dedb;
  color: var(--danger);
}

.password-cell.secure {
  border-color: rgba(36, 126, 105, 0.24);
  background: rgba(235, 248, 243, 0.95);
  color: var(--success);
}

.password-cell.warning {
  border-color: rgba(194, 122, 28, 0.22);
  background: #fff8eb;
  color: #8a5b13;
}

.password-cell.danger {
  border-color: rgba(184, 49, 47, 0.22);
  background: #fff0ee;
  color: var(--danger);
}

.row-password-reset {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(23, 111, 95, 0.16);
  border-radius: 8px;
  background: #f5faf7;
  color: var(--primary-dark);
  font-size: 12px;
  white-space: nowrap;
}

.password-reset-notice {
  border-color: rgba(36, 126, 105, 0.22);
  background: #eef7f3;
  color: var(--primary-dark);
}

.print-action-pair,
.invoice-action-buttons {
  align-items: center;
  gap: 5px;
}

.print-action-pair {
  min-height: 40px;
  padding: 4px;
  border: 1px solid rgba(23, 111, 95, 0.12);
  border-radius: 10px;
  background: rgba(248, 250, 247, 0.92);
  box-shadow: 0 8px 18px rgba(31, 38, 33, 0.04);
}

.panel-head .print-action-pair {
  margin-inline-start: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.print-action-pair > .secondary,
.print-action-pair > .ghost,
.invoice-action-buttons > .secondary,
.invoice-action-buttons > .ghost,
.invoice-action-buttons .print-action-pair > .secondary,
.invoice-action-buttons .print-action-pair > .ghost {
  min-height: 34px;
  border: 1px solid rgba(23, 111, 95, 0.16);
  border-radius: 7px;
  background: #fff;
  color: #26362e;
  padding: 5px 9px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.print-action-pair > .secondary:hover:not(:disabled),
.print-action-pair > .ghost:hover:not(:disabled),
.invoice-action-buttons > .secondary:hover:not(:disabled),
.invoice-action-buttons > .ghost:hover:not(:disabled),
.invoice-action-buttons .print-action-pair > .secondary:hover:not(:disabled),
.invoice-action-buttons .print-action-pair > .ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(23, 111, 95, 0.32);
  background: #eef7f3;
  color: var(--primary-dark);
  box-shadow: 0 8px 16px rgba(31, 38, 33, 0.07);
}

.print-action-pair button::before,
.invoice-action-buttons > .secondary::before,
.invoice-action-buttons > .ghost::before {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #eef5f1;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.print-action-pair.compact {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.print-action-pair.compact button::before {
  content: none !important;
  display: none;
}

.print-action-pair button[data-action*="edit"]::before,
.invoice-action-buttons > button[data-action*="edit"]::before {
  content: "✎";
}

.print-action-pair button[data-action*="print"]::before,
.invoice-action-buttons > button[data-action*="print"]::before {
  content: "⎙";
}

.print-action-pair button[data-action*="thermal"]::before,
.invoice-action-buttons > button[data-action*="thermal"]::before {
  content: "ح";
}

.print-action-pair button[data-action*="whatsapp"]::before,
.invoice-action-buttons > button[data-action*="whatsapp"]::before {
  content: "WA";
  font-size: 8px;
}

.print-action-pair button[data-action*="delivery"]::before,
.invoice-action-buttons > button[data-action*="delivery"]::before {
  content: "✓";
}

.print-action-pair button[data-action*="move"]::before,
.invoice-action-buttons > button[data-action*="move"]::before {
  content: "⇄";
}

.print-action-pair button[data-action*="draft"]::before,
.invoice-action-buttons > button[data-action*="draft"]::before {
  content: "□";
}

.print-action-pair button[data-action*="delete"]::before,
.invoice-action-buttons > button[data-action*="delete"]::before {
  content: "×";
  background: #fff0ed;
  color: var(--danger);
}

.print-action-pair .thermal-print-button,
.invoice-action-buttons .thermal-print-button {
  border-color: rgba(178, 119, 46, 0.22);
  background: #fffaf1;
  color: #8d5512;
}

.print-action-pair .thermal-print-button::before,
.invoice-action-buttons .thermal-print-button::before {
  background: #fff0d9;
  color: #8d5512;
}

.print-action-pair .whatsapp-button,
.invoice-action-buttons .whatsapp-button {
  border-color: rgba(21, 115, 71, 0.22) !important;
  background: #f1faf5;
  color: #157347 !important;
}

.print-action-pair .whatsapp-button::before,
.invoice-action-buttons .whatsapp-button::before {
  background: #dff3e7;
  color: #157347;
}

.print-action-pair .danger-outline,
.invoice-action-buttons .danger-outline,
.invoice-action-buttons .bulk-delete-option {
  border-color: rgba(182, 61, 50, 0.24);
  background: #fff7f5;
  color: var(--danger);
}

.print-action-pair .danger-outline:hover:not(:disabled),
.invoice-action-buttons .danger-outline:hover:not(:disabled),
.invoice-action-buttons .bulk-delete-option:hover:not(:disabled) {
  border-color: rgba(182, 61, 50, 0.36);
  background: #fff0ed;
  color: #922d25;
}

.invoice-move-control {
  padding-inline-start: 4px;
}

.invoice-move-control select {
  min-height: 32px;
  min-width: 118px;
  border-radius: 7px;
  padding: 5px 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.invoice-move-control .secondary {
  min-height: 32px;
  padding: 6px 10px;
}

.full {
  width: 100%;
}

.icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius);
  font-size: 18px;
}

.copy-product-btn {
  width: auto;
  min-width: 58px;
  padding: 0 11px;
  background: #eef7f3;
  color: var(--primary-dark);
  border: 1px solid rgba(23, 111, 95, 0.18);
  font-size: 12px;
  font-weight: 900;
}

.copy-product-btn:hover {
  background: #dff0e9;
  color: var(--primary-dark);
}

.row-actions {
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

.table-wrap.tall {
  max-height: calc(100vh - 220px);
}

.invoice-lines {
  max-height: 360px;
  margin-block: 10px;
}

.invoice-lines.sale-lines {
  max-height: min(86vh, 820px);
}

.invoice-lines.sale-lines th,
.invoice-lines.sale-lines td {
  padding-block: 8px;
}

.invoice-lines.sale-lines .mini-input,
.invoice-lines.sale-lines .inline-control select {
  min-height: 34px;
}

.invoice-builder .number-input,
.invoice-lines.sale-lines .mini-input,
.payment-panel .number-input,
.discount-row .number-input {
  font-size: 15px;
  font-weight: 900;
  color: #14221c;
}

.invoice-lines.sale-lines td {
  font-size: 14px;
  font-weight: 800;
}

.sale-line-product-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 260px;
}

.sale-line-row {
  scroll-margin-bottom: 240px;
}

.sale-line-product-copy {
  min-width: 0;
}

.sale-line-drag-handle {
  width: 28px;
  min-width: 28px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8b9a91;
  cursor: grab;
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
}

.sale-line-drag-handle span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 7px 0 currentColor,
    0 14px 0 currentColor,
    8px 0 0 currentColor,
    8px 7px 0 currentColor,
    8px 14px 0 currentColor;
}

.sale-line-drag-handle:hover,
.sale-line-drag-handle.is-dragging {
  color: var(--primary);
  background: #eef7f3;
  cursor: grabbing;
}

.sale-lines-dragging {
  cursor: grabbing;
  user-select: none;
}

.sale-lines-dragging input,
.sale-lines-dragging button:not(.sale-line-drag-handle),
.sale-lines-dragging .smart-select {
  pointer-events: none;
}

.sale-lines-dragging .sale-line-row:not(.sale-line-dragging) {
  transition: background 120ms ease, transform 160ms ease;
}

.sale-line-dragging td {
  background: #eef8f5 !important;
  box-shadow: inset 0 1px 0 rgba(23, 111, 95, 0.18), inset 0 -1px 0 rgba(23, 111, 95, 0.18);
}

.sale-line-placeholder td {
  padding: 8px 10px;
  background: transparent !important;
}

.sale-line-placeholder div {
  height: 58px;
  border: 1.5px dashed rgba(23, 111, 95, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(23, 111, 95, 0.08), rgba(243, 250, 246, 0.6)),
    #f7fbf8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.sale-line-drag-card {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(23, 111, 95, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 50px rgba(17, 43, 39, 0.22);
  padding: 12px 14px;
  pointer-events: none;
  direction: rtl;
  animation: dragCardLift 120ms ease-out;
  will-change: transform;
}

.sale-line-drag-card-grip {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow:
    0 7px 0 var(--primary),
    0 14px 0 var(--primary),
    8px 0 0 var(--primary),
    8px 7px 0 var(--primary),
    8px 14px 0 var(--primary);
}

.sale-line-drag-card strong,
.sale-line-drag-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-line-drag-card strong {
  color: var(--text);
  font-size: 14px;
}

.sale-line-drag-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sale-line-drag-card b {
  color: var(--primary);
  font-size: 14px;
  white-space: nowrap;
}

.sale-line-drag-card.dropping {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 120ms ease, transform 120ms ease;
}

.invoice-lines.sale-lines td:nth-child(6) {
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.invoice-lines.sale-lines .inline-control select {
  font-size: 13px;
  font-weight: 900;
}

.line-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.line-actions .icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 900;
}

.line-move-btn {
  border: 1px solid rgba(23, 111, 95, 0.14);
  background: #eef7f3;
  color: var(--primary-dark);
}

.line-move-btn:not(:disabled):hover {
  background: #dff0e9;
}

.invoice-builder .summary-box strong,
.invoice-builder .payment-panel strong {
  font-size: 16px;
  font-weight: 900;
}

.invoice-builder .summary-box .total strong {
  font-size: 24px;
}

.payment-grid input.number-input {
  min-height: 44px;
}

.empty-state,
.empty-cell {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 700;
}

.empty-cell {
  border: 0;
}

.stock-pill {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 28px;
  border-radius: 999px;
  background: #e3f3ea;
  color: var(--success);
  font-weight: 900;
}

.stock-pill.danger {
  background: #f5dedb;
  color: var(--danger);
}

.stock-pill.backorder {
  background: #fff1d8;
  color: #a45a05;
}

.product-list-table .product-number-cell {
  color: #15231d;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.product-list-table .product-number-cell strong {
  font-size: inherit;
  font-weight: 900;
}

.product-list-table .product-number-cell .stock-pill {
  font-size: 15px;
  font-weight: 900;
}

.type-pill {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 26px;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.type-pill.merchant {
  background: #fff2d9;
  color: #9b5b0b;
}

.type-pill.consumer {
  background: #e3f3ea;
  color: var(--success);
}

.selected-row {
  background: #f8faf7;
}

.debt-text {
  color: var(--danger);
}

.credit-text {
  color: var(--success);
}

.muted-line {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.customer-profile {
  display: grid;
  gap: 14px;
}

.profile-balance {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf7;
  padding: 10px 14px;
  min-width: 180px;
  display: grid;
  gap: 5px;
}

.profile-balance span,
.profile-balance strong {
  display: block;
}

.profile-balance span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-balance strong {
  font-size: 20px;
}

.profile-balance.has-debt {
  background: #fff8eb;
  border-color: #eadbc4;
}

.profile-balance.has-debt strong {
  color: var(--danger);
}

.profile-balance.has-credit {
  background: #f0f8f4;
  border-color: #cfe8d8;
}

.profile-balance.has-credit strong {
  color: var(--success);
}

.profile-balance button {
  min-height: 34px;
  padding: 6px 10px;
  margin-top: 4px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbfcfa;
}

.compact-row strong,
.compact-row span {
  display: block;
}

.compact-row span {
  color: var(--muted);
  font-size: 12px;
}

.product-activity-panel {
  margin-top: 16px;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 10px 12px;
}

.activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 111, 95, 0.09);
}

.activity-row.import .activity-dot {
  background: #0d5d58;
}

.activity-row.copy .activity-dot {
  background: #b28a45;
}

.activity-row.sale .activity-dot,
.activity-row.purchase .activity-dot,
.activity-row.return .activity-dot,
.activity-row.delivery .activity-dot {
  background: #176f5f;
}

.activity-row.admin .activity-dot,
.activity-row.backup .activity-dot {
  background: #a0652a;
}

.activity-row.user .activity-dot,
.activity-row.customer .activity-dot {
  background: #315f8d;
}

.activity-row strong,
.activity-row small {
  display: block;
}

.activity-row small,
.activity-row time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-row time {
  direction: ltr;
  white-space: nowrap;
}

.security-check {
  margin-top: 12px;
  border: 1px solid #dce7dc;
  border-radius: var(--radius);
  background: #f8faf7;
  padding: 12px;
}

.product-picker {
  position: sticky;
  top: 104px;
}

.product-picker.panel {
  padding: 14px;
}

.product-picker .panel-head {
  margin-bottom: 10px;
}

.product-picker .panel-head h3 {
  font-size: 16px;
}

.picker-count {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.product-picker .search-box input {
  min-height: 38px;
}

.picker-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(135px, 170px);
  gap: 8px;
  align-items: end;
}

.picker-filters .search-box {
  min-width: 0;
}

.brand-filter span {
  font-size: 11px;
}

.brand-filter select {
  min-height: 40px;
}

.product-grid {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.product-grid .picker-empty {
  margin-top: 0;
}

.product-tile {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 58px;
  padding: 7px 9px;
  text-align: right;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name price"
    "meta stock";
  align-items: center;
  gap: 2px 10px;
  transition: 140ms ease;
}

.product-tile:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(23, 111, 95, 0.08);
}

.product-tile.stock-backorder {
  border-color: rgba(164, 90, 5, 0.28);
  background: #fffaf1;
}

.product-tile:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-tile strong,
.product-tile span,
.product-tile b,
.product-tile small {
  display: block;
  min-width: 0;
}

.product-tile strong {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
}

.product-tile span,
.product-tile small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tile span {
  grid-area: meta;
}

.product-tile small {
  grid-area: stock;
  justify-self: end;
}

.product-tile b {
  grid-area: price;
  color: var(--primary);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  justify-self: end;
}

.invoice-builder {
  min-height: 520px;
}

.invoice-product-entry {
  border: 1px solid rgba(23, 111, 95, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(23, 111, 95, 0.055), rgba(255, 255, 255, 0.94) 46%),
    #fff;
  padding: 12px;
  margin: 10px 0 12px;
}

.invoice-product-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.invoice-product-entry-head h3 {
  font-size: 16px;
  margin-top: 2px;
}

.invoice-product-entry-head small {
  color: var(--primary);
  background: #edf6f1;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.invoice-product-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(155px, 220px);
  gap: 10px;
  align-items: end;
}

.invoice-product-select .smart-select-button {
  min-height: 48px;
  border-color: rgba(23, 111, 95, 0.24);
  background: #fff;
}

.invoice-product-select .smart-select-label {
  font-size: 13px;
}

.invoice-product-select .smart-select-menu {
  max-width: min(100%, 920px);
}

.invoice-product-select .smart-select-option {
  min-height: 38px;
  line-height: 1.45;
  white-space: normal;
}

.invoice-brand-filter .smart-select-button {
  min-height: 48px;
  background: #fbfcfa;
}

.invoice-product-entry-hint {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.invoice-product-entry-hint b {
  color: #9a5c13;
  font-weight: 900;
  white-space: nowrap;
}

.mini-input {
  min-width: 74px;
  width: 86px;
  min-height: 36px;
  padding: 6px 8px;
}

.purchase-cost-hint {
  margin-block: 10px;
}

.purchase-cost-method {
  width: 140px;
  min-height: 36px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.inline-control {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-control select {
  width: 88px;
  min-height: 36px;
  padding: 4px 8px;
}

.discount-row,
.date-range {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.discount-row label,
.date-range label {
  min-width: 180px;
}

.document-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf7;
  padding: 6px;
  margin-bottom: 14px;
}

.document-switch button {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.document-switch button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 111, 95, 0.14);
}

.notice-box {
  border: 1px solid #eadbc4;
  border-radius: var(--radius);
  background: #fff8eb;
  color: #6d4a1e;
  padding: 12px;
  font-size: 13px;
  font-weight: 800;
  margin-top: 12px;
}

.danger-zone {
  border-color: rgba(182, 61, 50, 0.26);
}

.danger-zone .notice-box {
  border-color: rgba(182, 61, 50, 0.22);
  background: #fff3f1;
  color: #74312b;
}

.danger-zone .stock-reset-note {
  border-color: #d8e2d4;
  background: #f4f8f2;
  color: #425148;
}

.admin-actions-panel {
  display: grid;
  gap: 14px;
}

.admin-action-groups {
  display: grid;
  gap: 14px;
}

.admin-action-group {
  border: 1px solid #e3ebe3;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(251, 252, 250, 0.96), rgba(255, 255, 255, 0.98));
  padding: 14px;
  display: grid;
  gap: 12px;
}

.admin-action-group-head {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2ed;
}

.admin-action-group-head strong {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

.admin-action-group-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.admin-action-card {
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px;
  display: grid;
  gap: 6px;
  text-align: right;
  align-content: start;
  justify-items: start;
  transition: 160ms ease;
}

.admin-action-card:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.admin-action-card:disabled {
  opacity: 0.54;
  cursor: not-allowed;
}

.admin-action-card.warning {
  border-color: rgba(208, 142, 48, 0.28);
  background: #fffaf1;
}

.admin-action-card.soft {
  border-color: rgba(23, 111, 95, 0.2);
  background: #f5faf7;
}

.admin-action-card.danger {
  border-color: rgba(182, 61, 50, 0.28);
  background: #fff5f3;
}

.admin-action-count {
  min-width: 34px;
  min-height: 28px;
  border-radius: 8px;
  background: #eaf1eb;
  color: var(--primary-dark);
  padding: 4px 9px;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  direction: ltr;
}

.admin-action-card.warning .admin-action-count {
  background: #f4e6cc;
  color: #7b4c15;
}

.admin-action-card.danger .admin-action-count {
  background: #f6dedb;
  color: var(--danger);
}

.admin-action-card strong {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
}

.admin-action-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  font-weight: 800;
}

.composite-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 12px;
  margin-top: 12px;
}

.product-similarity-slot {
  grid-column: 1 / -1;
}

.product-similarity-alert {
  border: 1px solid #eadbc4;
  border-radius: var(--radius);
  background: #fffaf1;
  color: #5e421f;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.product-similarity-alert.strong {
  border-color: rgba(182, 61, 50, 0.26);
  background: #fff5f2;
  color: #73342d;
}

.product-similarity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-similarity-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.product-similarity-head strong {
  color: inherit;
  font-size: 14px;
  font-weight: 900;
}

.product-similarity-list {
  display: grid;
  gap: 6px;
}

.product-similarity-item {
  border: 1px solid rgba(31, 38, 33, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.76);
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.product-similarity-item strong,
.product-similarity-item small {
  display: block;
}

.product-similarity-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.product-similarity-item small,
.product-similarity-alert > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.product-similarity-item > span {
  min-width: 48px;
  border-radius: 999px;
  background: #eef6f1;
  color: var(--primary);
  padding: 4px 8px;
  direction: ltr;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.product-similarity-item button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.warning-text {
  color: #a06016;
}

.composite-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.composite-preview span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.composite-preview strong {
  display: block;
  color: var(--primary);
  margin-top: 3px;
}

.composite-component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 150px) 40px;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.combo-input.is-invalid {
  border-color: #b84b3f;
  background: #fff8f6;
}

.import-review-panel {
  margin-top: 14px;
}

.import-review-actions {
  margin-top: 0;
}

.import-review-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.import-review-stats span,
.import-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf6;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.import-status.update {
  background: #eef7f3;
  color: var(--primary);
}

.import-status.create {
  background: #fff8eb;
  color: #9a5a0a;
}

.import-status.error {
  background: #fff3f1;
  color: #b63d32;
}

.import-review-table {
  margin-top: 12px;
}

.danger-text {
  color: #b63d32 !important;
}

.muted-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payment-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 12px;
  margin-top: 12px;
}

.draft-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -4px 0 12px;
}

.draft-tabs button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 34px;
  padding: 6px 10px;
  font-weight: 800;
}

.draft-tabs button.active {
  border-color: var(--primary);
  background: #edf7f3;
  color: var(--primary);
}

.draft-tabs .new-draft {
  border-color: #d9e7dc;
  color: var(--success);
}

.draft-tabs .close-draft {
  border-color: #f0d0cb;
  color: var(--danger);
}

.saved-sale-drafts {
  border: 1px solid #d9e7dc;
  border-radius: var(--radius);
  background: #f8fbf7;
  padding: 10px;
  margin: -2px 0 12px;
}

.saved-sale-drafts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.saved-sale-drafts-head strong {
  color: var(--primary);
  font-size: 14px;
}

.saved-sale-drafts-head small,
.saved-sale-draft-card small {
  color: var(--muted);
  font-weight: 800;
}

.saved-sale-draft-list {
  display: grid;
  gap: 7px;
}

.saved-sale-draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.saved-sale-draft-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.saved-sale-draft-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.saved-draft-save {
  border-color: #c9dfdd;
  color: #126963;
}

.panel-head.slim {
  margin-bottom: 10px;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.payment-grid small {
  color: var(--muted);
  font-size: 11px;
}

.compact-summary {
  margin-top: 10px;
}

.lookup-field {
  position: relative;
}

.selected-lookup {
  border: 1px solid #dce7dc;
  border-radius: 6px;
  background: #f8faf7;
  padding: 7px 34px 7px 9px;
  margin-top: 6px;
  position: relative;
}

.selected-lookup strong,
.selected-lookup small {
  display: block;
}

.selected-lookup small {
  color: var(--muted);
  font-size: 11px;
}

.selected-lookup button {
  position: absolute;
  inset-inline-start: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f5dedb;
  color: var(--danger);
  font-weight: 900;
}

.supplier-lookup-card {
  margin-bottom: 14px;
  border: 1px solid #dbe9e5;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
}

.suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.suggestion-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid #dce9e5;
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  text-align: right;
  cursor: pointer;
}

.suggestion-list button:hover {
  border-color: var(--primary);
  background: #f1f8f6;
}

.suggestion-list span,
.suggestion-empty {
  color: var(--muted);
  font-size: 12px;
}

.inline-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
}

.inline-alert.soft {
  border: 1px solid #d9e9e4;
  background: #eef7f4;
  color: #14554e;
}

.purchase-payment-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-payment-box {
  width: min(360px, 100%);
  border: 1px solid #d7dfd7;
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0 0 auto;
}

.invoice-payment-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.invoice-payment-box div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #edf1ed;
}

.invoice-payment-box div:last-child {
  border-bottom: 0;
}

.invoice-move-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.invoice-move-control select {
  min-height: 42px;
  min-width: 130px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 800;
}

.print-action-pair .invoice-move-control select,
.invoice-action-buttons .invoice-move-control select {
  min-height: 32px;
  min-width: 118px;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 900;
}

.print-action-pair .invoice-move-control .secondary,
.invoice-action-buttons .invoice-move-control .secondary {
  min-height: 34px;
  border: 1px solid rgba(23, 111, 95, 0.16);
  border-radius: 7px;
  background: #fff;
  color: #26362e;
  padding: 5px 9px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

.print-action-pair .invoice-move-control .smart-select,
.invoice-action-buttons .invoice-move-control .smart-select {
  width: 118px;
}

.print-action-pair .invoice-move-control .smart-select-button,
.invoice-action-buttons .invoice-move-control .smart-select-button {
  min-height: 34px;
  border-radius: 7px;
  padding: 5px 8px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

.print-action-pair .invoice-move-control .smart-select-label,
.invoice-action-buttons .invoice-move-control .smart-select-label {
  font-size: 13px;
}

.print-action-pair .invoice-move-control .smart-select-arrow,
.invoice-action-buttons .invoice-move-control .smart-select-arrow {
  width: 20px;
  height: 20px;
  min-height: 20px;
  border-radius: 6px;
}

.lookup-results {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.lookup-results button,
.lookup-empty {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  text-align: right;
}

.lookup-results button.active,
.lookup-results button:hover {
  border-color: var(--primary);
  background: #f2f8f5;
}

.lookup-results button {
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.lookup-results button:hover {
  transform: translateY(-1px);
}

.lookup-results button.fresh {
  border-color: rgba(23, 111, 95, 0.48);
  background: linear-gradient(135deg, rgba(232, 248, 240, 0.98), #fff);
  box-shadow: 0 0 0 4px rgba(23, 111, 95, 0.08), 0 14px 28px rgba(17, 43, 39, 0.08);
  animation: freshInvoicePulse 1500ms ease-out 2;
}

.lookup-results strong,
.lookup-results small {
  display: block;
}

.lookup-results strong {
  font-size: 13px;
}

.lookup-results small,
.lookup-empty {
  color: var(--muted);
  font-size: 11px;
}

.sale-balance-alert {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8faf7;
}

.sale-balance-alert span,
.sale-balance-alert strong,
.sale-balance-alert small {
  display: block;
}

.sale-balance-alert span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.sale-balance-alert strong {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 900;
}

.sale-balance-alert small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sale-balance-alert.debt {
  border-color: rgba(182, 61, 50, 0.24);
  background: #fff3f1;
}

.sale-balance-alert.debt strong {
  color: var(--danger);
}

.sale-balance-alert.credit {
  border-color: rgba(36, 118, 71, 0.22);
  background: #f0f8f4;
}

.sale-balance-alert.credit strong {
  color: var(--success);
}

.sale-phone-suggestion {
  width: 100%;
  margin-top: -4px;
  border: 1px solid rgba(174, 100, 25, 0.28);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff8ec;
  box-shadow: 0 10px 24px rgba(71, 48, 18, 0.06);
}

.sale-phone-suggestion span,
.sale-phone-suggestion strong,
.sale-phone-suggestion small {
  display: block;
}

.sale-phone-suggestion span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.sale-phone-suggestion strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.sale-phone-suggestion small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sale-phone-suggestion button {
  white-space: nowrap;
}

.sale-edit-banner {
  margin: 10px 0 12px;
  border: 1px solid rgba(28, 116, 101, 0.24);
  border-radius: var(--radius);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #effaf7, #fffaf0);
}

.sale-edit-banner span,
.sale-edit-banner strong,
.sale-edit-banner small {
  display: block;
}

.sale-edit-banner span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.sale-edit-banner strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.sale-edit-banner small,
.edit-window-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.invoice-edit-meta {
  margin: 0 0 8px;
  border: 1px solid rgba(28, 116, 101, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--primary);
  background: #f4faf7;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.cancelled-row {
  opacity: 0.64;
  background: #fff8f7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  background: #eef5f1;
  color: var(--primary);
}

.status-pill.danger {
  background: #fde8e5;
  color: var(--danger);
}

.status-pill.warning {
  background: #fff1dc;
  color: #9a5b12;
}

.status-pill.success {
  background: #e8f5ee;
  color: var(--success);
}

.sale-stock-alert {
  margin: 10px 0 12px;
  border: 1px solid rgba(164, 90, 5, 0.24);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fffaf1;
}

.sale-stock-alert strong,
.sale-stock-alert span,
.sale-stock-alert small {
  display: block;
}

.sale-stock-alert strong {
  color: #7d4404;
  font-size: 14px;
  font-weight: 900;
}

.sale-stock-alert span,
.sale-stock-alert small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sale-stock-alert.blocked {
  border-color: rgba(182, 61, 50, 0.24);
  background: #fff3f1;
}

.sale-stock-alert.blocked strong {
  color: var(--danger);
}

.invoice-lines tr.line-backorder td {
  background: #fffaf1;
}

.invoice-lines small em {
  display: inline-block;
  margin-inline-start: 8px;
  color: #a45a05;
  font-style: normal;
  font-weight: 900;
}

.return-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 160px auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.return-results {
  max-height: 260px;
  overflow: auto;
  padding-left: 2px;
  margin-bottom: 12px;
}

.invoice-results {
  max-height: 520px;
  overflow: auto;
  padding-left: 2px;
}

.customer-analysis-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid #dce7dc;
  border-radius: var(--radius);
  background: #f8faf7;
  padding: 12px;
  margin-bottom: 14px;
}

.customer-analysis-filters .form-actions {
  margin-top: 0;
  align-items: end;
  justify-content: flex-start;
  white-space: nowrap;
}

.customer-period-summary,
.customer-product-summary {
  margin-bottom: 12px;
}

.customer-withdrawals-panel {
  margin-top: 16px;
}

.statement-products {
  margin-top: 18px;
}

.statement-products h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.statement-period-totals {
  margin-bottom: 14px;
}

.summary-box {
  border-radius: var(--radius);
  background: #f8faf7;
  border: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.summary-box.flat {
  margin-top: 0;
}

.summary-box div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.summary-box strong {
  color: var(--text);
}

.summary-box .total,
.summary-box .profit {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.summary-box .total strong {
  font-size: 22px;
  color: var(--primary);
}

.summary-box .profit strong {
  color: var(--success);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  font-size: 13px;
  color: var(--text);
}

.check-line input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.permission-grid,
.permission-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.permission-group-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.permission-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.branch-permission-card {
  border: 1px solid #d9e4da;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(241, 248, 245, 0.95), rgba(255, 255, 255, 0.98));
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.permission-search-panel {
  margin-top: 12px;
}

.permission-search-panel .search-box {
  min-width: 100%;
}

.branch-permission-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
}

.branch-check {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: start;
}

.branch-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--branch-accent);
}

.branch-check span {
  color: var(--text);
  font-weight: 900;
}

.branch-check small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.permission-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e3ebe3;
}

.permission-card-head strong {
  font-size: 14px;
  font-weight: 900;
}

.permission-card-head small {
  direction: ltr;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.permission-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-options .check-line {
  min-height: 34px;
  border: 1px solid #edf2ed;
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
}

.permission-options .view-permission {
  border-color: rgba(23, 111, 95, 0.24);
  background: #eff7f3;
  font-weight: 900;
}

.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented button {
  min-height: 40px;
  border-radius: var(--radius);
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
}

.segmented button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.checkbox-line {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  font-weight: 900;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.payroll-layout {
  align-items: start;
}

.total-row {
  background: #f4f8f5;
  font-weight: 900;
}

.report-paper {
  display: grid;
  gap: 16px;
}

.print-report {
  background: #fff;
  padding: 18px;
  border-radius: var(--radius);
}

.report-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
}

.report-head h2 {
  margin: 4px 0;
}

.report-head span,
.report-head strong {
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 12px;
}

.daily-statement {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.daily-statement .wide {
  grid-column: 1 / -1;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-row strong {
  font-size: 13px;
}

.bar-row span {
  color: var(--muted);
  font-size: 12px;
}

.bar-row i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--primary) var(--bar), transparent var(--bar)),
    #e6ebe4;
}

.performance-timeline {
  display: grid;
  gap: 10px;
}

.performance-day-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(130px, 0.9fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 11px 12px;
  animation: premiumReveal 220ms ease both;
}

.performance-day-row > div {
  min-width: 0;
}

.performance-day-row strong,
.performance-day-row span {
  display: block;
}

.performance-day-row strong {
  font-size: 13px;
}

.performance-day-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.performance-day-row i {
  position: relative;
  display: block;
  min-width: 120px;
  height: 12px;
  border-radius: 999px;
  background: #e7ece6;
  overflow: hidden;
}

.performance-day-row i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #46a58c);
  animation: performanceBarGrow 420ms ease both;
}

.performance-day-row b {
  white-space: nowrap;
  color: var(--primary);
  font-size: 13px;
}

.performance-payment-box .total strong {
  color: var(--primary);
}

.performance-invoice-list .compact-row {
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.performance-invoice-list .compact-row:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 111, 95, 0.32);
  box-shadow: 0 12px 26px rgba(31, 38, 33, 0.08);
}

@keyframes performanceBarGrow {
  from {
    width: 0;
  }
  to {
    width: var(--bar);
  }
}

.printable-card {
  max-width: 980px;
  margin-inline: auto;
  width: 100%;
}

.invoice-paper {
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: 30px 30px 22px;
}

.modern-invoice {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.modern-invoice > * {
  position: relative;
  z-index: 1;
}

.ledger-invoice {
  border: 1px solid #e0e7dd;
  border-radius: 8px;
  padding: 26px 28px 20px;
}

.ledger-invoice::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #176f5f, #d6b47a);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-ledger-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.45fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #176f5f;
}

.invoice-ledger-title {
  border: 1px solid #dbe4da;
  border-right: 5px solid #176f5f;
  border-radius: 6px;
  background: #f6f8f4;
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 3px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-ledger-title span,
.invoice-ledger-title strong {
  display: block;
}

.invoice-ledger-title span {
  color: #69746a;
  font-size: 10px;
  font-weight: 900;
}

.invoice-ledger-title h2 {
  margin: 0;
  color: #123d34;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
}

.invoice-ledger-title strong {
  color: #176f5f;
  font-size: 13px;
  font-weight: 900;
}

.invoice-ledger-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.invoice-ledger-meta div,
.invoice-ledger-party {
  border: 1px solid #dbe4da;
  border-radius: 6px;
  background: #fbfcfa;
  padding: 9px 10px;
}

.invoice-ledger-meta span,
.invoice-ledger-meta strong,
.invoice-ledger-party span,
.invoice-ledger-party strong,
.invoice-ledger-party b,
.invoice-ledger-party small {
  display: block;
}

.invoice-ledger-meta span,
.invoice-ledger-party span,
.invoice-ledger-party b {
  color: #69746a;
  font-size: 9px;
  font-weight: 900;
}

.invoice-ledger-meta strong {
  margin-top: 3px;
  color: #17221f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.invoice-ledger-parties {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.75fr);
  gap: 10px;
  margin-bottom: 12px;
}

.invoice-ledger-party {
  min-height: 84px;
}

.invoice-ledger-party strong {
  margin: 3px 0 8px;
  color: #17221f;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}

.invoice-ledger-party div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-top: 5px;
  border-top: 1px dashed #dbe4da;
}

.invoice-ledger-party div + div {
  margin-top: 5px;
}

.invoice-ledger-party small {
  color: #17221f;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.invoice-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  min-height: 58px;
}

.invoice-hero-no-logo {
  justify-content: flex-start;
  direction: ltr;
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-brand strong,
.invoice-brand span {
  display: block;
}

.invoice-brand strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--primary-dark);
}

.invoice-brand span {
  margin-top: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-seller-card {
  min-width: 130px;
  text-align: left;
}

.invoice-seller-card span,
.invoice-seller-card strong,
.invoice-seller-card small {
  display: block;
}

.invoice-seller-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.invoice-seller-card strong {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 900;
}

.invoice-seller-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.invoice-title-panel {
  margin: 34px 0 20px;
  text-align: center;
}

.invoice-title-panel h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
}

.invoice-title-panel div {
  margin-top: 6px;
  display: grid;
  gap: 2px;
  justify-items: center;
}

.invoice-title-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.invoice-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 12px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 12px;
}

.invoice-header-no-logo {
  grid-template-columns: 1fr;
}

.invoice-header-no-logo .invoice-meta {
  justify-self: end;
  text-align: right;
}

.invoice-meta {
  display: grid;
  gap: 3px;
}

.invoice-meta strong {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

.invoice-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-title-block {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
}

.invoice-title-copy {
  display: grid;
  gap: 2px;
}

.invoice-title-copy strong {
  font-size: 27px;
  font-weight: 900;
  line-height: 1.15;
}

.invoice-title-copy span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.invoice-seller {
  grid-column: 1;
  justify-self: start;
  text-align: left;
  min-width: 120px;
}

.invoice-seller span,
.invoice-seller strong {
  display: block;
}

.invoice-seller span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.invoice-seller strong {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 900;
}

.invoice-customer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 170px));
  justify-content: start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 0;
  color: var(--text);
}

.invoice-customer div {
  border: 0;
  border-radius: 6px;
  background: #f0f1ee;
  min-height: 34px;
  padding: 5px 9px;
}

.invoice-customer span,
.invoice-customer strong {
  display: block;
}

.invoice-customer span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.invoice-customer strong {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.modern-invoice .invoice-table {
  border: 1px solid #d7ddd4;
}

.ledger-invoice .invoice-table {
  table-layout: fixed;
  border-color: #dbe4da;
}

.modern-invoice .invoice-table th {
  background: var(--primary-dark);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  padding: 7px 9px;
  font-size: 12px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ledger-invoice .invoice-table th {
  background: #176f5f;
  padding: 8px 9px;
  font-size: 11.5px;
}

.modern-invoice .invoice-table td {
  border-color: #d7ddd4;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.ledger-invoice .invoice-table td {
  padding: 7px 9px;
  border-color: #dbe4da;
  font-size: 11.5px;
}

.modern-invoice .invoice-table td:first-child {
  font-size: 13px;
  font-weight: 900;
}

.ledger-invoice .invoice-table th:first-child,
.ledger-invoice .invoice-table td:first-child {
  width: 48%;
}

.ledger-invoice .invoice-table th:not(:first-child),
.ledger-invoice .invoice-table td:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.ledger-invoice .invoice-table tbody tr:nth-child(even) {
  background: #f8faf7;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.modern-invoice .invoice-table small {
  margin-top: 2px;
  font-size: 9px;
}

.modern-invoice .invoice-table .invoice-item-note {
  color: #111;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.45;
}

.invoice-bottom {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  direction: rtl;
  align-items: start;
}

.invoice-bottom > div {
  min-width: 0;
}

.ledger-invoice .invoice-ledger-bottom {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  margin-top: 12px;
}

.invoice-ledger-payment-area {
  min-width: 0;
}

.invoice-ledger-total-area {
  min-width: 0;
}

.invoice-notes {
  padding-top: 6px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.invoice-notes span,
.invoice-notes strong {
  display: block;
}

.invoice-notes span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.invoice-notes strong {
  font-size: 12px;
  font-weight: 800;
}

.invoice-notes p {
  margin: 6px 0 0;
  color: var(--muted);
}

.invoice-table th,
.invoice-table td {
  border-color: #d8d8d8;
}

.invoice-table th {
  font-size: 13px;
  font-weight: 900;
  color: #4f594f;
}

.invoice-table td {
  font-size: 15px;
  font-weight: 800;
}

.invoice-table td:first-child {
  font-size: 16px;
  font-weight: 900;
}

.invoice-table small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.invoice-totals {
  width: min(100%, 360px);
  margin-right: auto;
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.modern-invoice .invoice-totals {
  width: 100%;
  margin: 0;
  gap: 0;
  border: 1px solid #d7ddd4;
  border-bottom: 0;
}

.ledger-invoice .invoice-totals {
  border-color: #dbe4da;
  box-shadow: inset 4px 0 0 rgba(23, 111, 95, 0.16);
}

.invoice-payments,
.invoice-notice {
  width: fit-content;
  min-width: 260px;
  max-width: 100%;
  margin-top: 18px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fbfcfa;
}

.modern-invoice .invoice-payments {
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 9px 10px;
}

.ledger-invoice .invoice-payments {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-color: #dbe4da;
  border-radius: 6px;
  background: #fbfcfa;
  padding: 10px 12px;
}

.invoice-payments h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.ledger-invoice .invoice-payments h3 {
  color: #123d34;
  font-size: 12px;
  font-weight: 900;
}

.invoice-payments div {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 7px 16px;
}

.modern-invoice .invoice-payments div {
  grid-template-columns: 1fr auto;
  justify-content: stretch;
  gap: 6px 12px;
}

.ledger-invoice .invoice-payments div {
  gap: 5px 12px;
}

.ledger-invoice .invoice-payments span,
.ledger-invoice .invoice-payments strong {
  font-size: 11px;
  font-weight: 900;
}

.invoice-notice {
  color: #6d4a1e;
  background: #fff8eb;
  border-color: #eadbc4;
  font-weight: 800;
}

.invoice-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

.modern-invoice .invoice-totals div {
  padding: 7px 9px;
  border-bottom: 1px solid #d7ddd4;
}

.ledger-invoice .invoice-totals div {
  border-color: #dbe4da;
  font-size: 11.5px;
}

.invoice-totals .grand {
  border: 0;
  background: #f0f4ee;
  border-radius: var(--radius);
  padding: 12px;
  color: var(--primary);
  font-size: 18px;
}

.modern-invoice .invoice-totals .grand {
  border-radius: 0;
  background: var(--primary-dark);
  color: #fff;
  font-size: 15px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ledger-invoice .invoice-totals .grand {
  background: #123d34;
  font-size: 14px;
}

.invoice-footer {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  color: var(--muted);
  direction: ltr;
  font-size: 10px;
  line-height: 1.2;
}

.invoice-footer strong {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.invoice-policy {
  margin-top: 14px;
  border: 1px solid #d7ddd4;
  border-radius: 6px;
  background: #fbfcfa;
  padding: 9px 11px;
  color: #323a33;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.55;
  break-inside: avoid;
  page-break-inside: avoid;
}

.invoice-policy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.invoice-policy ul {
  margin: 0;
  padding: 0 18px 0 0;
}

.invoice-policy li {
  margin: 2px 0;
}

.thermal-print-body {
  background: #fff;
  padding: 0;
  width: 80mm;
  min-height: 0;
  height: auto;
  margin: 0;
  overflow: visible;
}

.thermal-receipt {
  width: 80mm;
  max-width: 80mm;
  margin: 0 auto;
  padding: 5mm 4mm;
  background: #fff;
  color: #000;
  direction: rtl;
  font-family: Arial, Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.42;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  break-before: avoid;
  break-after: avoid;
  break-inside: avoid;
  page-break-before: avoid;
  page-break-after: avoid;
  page-break-inside: avoid;
  overflow: visible;
}

.thermal-head,
.thermal-meta,
  .thermal-items,
  .thermal-item,
  .thermal-totals,
  .thermal-payments,
  .thermal-policy,
  .thermal-footer {
  break-inside: avoid;
  page-break-inside: avoid;
}

.thermal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1.5px dashed #000;
  padding-bottom: 8px;
}

.thermal-head-centered {
  display: block;
  text-align: center;
}

.thermal-head .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 900;
}

.thermal-document-info strong,
.thermal-document-info span,
.thermal-document-info small {
  display: block;
  text-align: left;
}

.thermal-head-centered .thermal-document-info {
  width: 100%;
  min-width: 0;
}

.thermal-head-centered .thermal-document-info strong,
.thermal-head-centered .thermal-document-info span,
.thermal-head-centered .thermal-document-info small {
  text-align: center;
}

.thermal-document-info strong {
  color: #000;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

.thermal-document-info small {
  margin-top: 1px;
  color: #000;
  direction: ltr;
  font-size: 9px;
  font-weight: 900;
}

.thermal-document-info span,
.thermal-meta span,
.thermal-item small {
  color: #000;
  font-size: 10px;
  font-weight: 900;
}

.thermal-meta {
  display: grid;
  gap: 5px;
  padding: 8px 0;
  border-bottom: 1.5px dashed #000;
}

.thermal-meta div,
.thermal-item div,
.thermal-totals div,
.thermal-payments div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.thermal-meta strong,
.thermal-item b,
.thermal-totals strong,
.thermal-payments b {
  direction: ltr;
  font-weight: 900;
  color: #000;
}

.thermal-items {
  display: grid;
}

.thermal-item {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1.5px dashed #000;
}

.thermal-item > strong {
  color: #000;
  font-size: 13px;
  font-weight: 900;
}

.thermal-item small {
  display: block;
}

.thermal-item .thermal-item-note {
  font-size: 11px;
  line-height: 1.35;
  font-weight: 900;
}

.thermal-item-total {
  color: #000;
  font-size: 12px;
  font-weight: 900;
}

.thermal-totals,
.thermal-payments {
  display: grid;
  gap: 4px;
  padding-top: 8px;
}

.thermal-totals .grand {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 2px solid #000;
  color: #000;
  font-size: 15px;
  font-weight: 900;
}

.thermal-payments {
  margin-top: 8px;
  border-top: 1.5px dashed #000;
}

.thermal-payments > strong {
  color: #000;
  font-size: 13px;
  font-weight: 900;
}

.thermal-policy {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1.5px dashed #000;
  color: #000;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  break-inside: avoid;
  page-break-inside: avoid;
}

.thermal-policy strong {
  display: block;
  margin-bottom: 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
}

.thermal-policy ul {
  margin: 0;
  padding: 0 15px 0 0;
}

.thermal-policy li {
  margin: 2px 0;
}

.thermal-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1.5px dashed #000;
  color: #000;
  direction: rtl;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 40;
  max-width: min(440px, calc(100vw - 44px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(23, 34, 31, 0.96);
  color: #fff;
  box-shadow: 0 18px 42px rgba(17, 43, 39, 0.24);
  padding: 12px 14px;
  font-weight: 900;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 180ms ease-out;
}

.account-password-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(12, 32, 29, 0.38);
  backdrop-filter: blur(7px);
  animation: premiumReveal 140ms ease-out;
}

.account-password-dialog {
  width: min(450px, 100%);
  overflow: hidden;
  border: 1px solid rgba(23, 111, 95, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(17, 43, 39, 0.28);
}

.account-password-dialog header {
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(238, 247, 243, 0.96), rgba(255, 252, 246, 0.96));
}

.account-password-dialog h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.account-password-dialog small {
  color: var(--muted);
  font-weight: 800;
}

.dialog-close-button {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(23, 111, 95, 0.14);
}

.account-password-dialog form {
  padding: 18px 20px 20px;
  display: grid;
  gap: 13px;
}

.account-password-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.account-password-dialog input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  color: var(--text);
  font-weight: 800;
}

.account-password-dialog input:focus {
  border-color: rgba(23, 111, 95, 0.55);
  outline: 3px solid rgba(23, 111, 95, 0.1);
}

.account-password-note {
  margin: 2px 0 0;
  border: 1px solid rgba(194, 122, 28, 0.18);
  border-radius: 10px;
  background: #fff8eb;
  color: #79552f;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.8;
}

.account-password-actions {
  margin-top: 2px;
}

.toast span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 16px;
  line-height: 1;
}

.toast strong {
  min-width: 0;
  line-height: 1.6;
}

.toast.success {
  background: rgba(19, 91, 72, 0.98);
}

.toast.warning {
  background: rgba(132, 82, 17, 0.98);
}

.toast.error {
  background: rgba(141, 43, 36, 0.98);
}

@keyframes premiumReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dragCardLift {
  from {
    opacity: 0.78;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes freshInvoicePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(23, 111, 95, 0.22), 0 14px 28px rgba(17, 43, 39, 0.08);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(23, 111, 95, 0), 0 14px 28px rgba(17, 43, 39, 0.08);
  }
}

@keyframes verifiedGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 126, 105, 0.24);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(36, 126, 105, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.print-body {
  background: #fff;
  padding: 24px;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }

  .topbar-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 0;
  }

  .global-search {
    width: 100%;
    min-width: 220px;
    flex: 1 1 260px;
  }

  .branch-switcher {
    max-width: 260px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .branch-switcher button {
    padding-inline: 8px;
  }

	  .cloud-chip {
	    min-width: 72px;
	    padding: 6px 8px;
	    min-height: 42px;
	    align-content: center;
	  }

  .account-password-button {
    min-width: 42px;
    min-height: 42px;
    padding: 7px 9px;
  }

  .account-password-button span {
    display: none;
  }
	
	  .user-chip {
	    min-width: 118px;
    max-width: 150px;
    padding: 7px 9px;
    min-height: 42px;
    align-content: center;
  }

  .cloud-chip small,
  .user-chip small {
    display: none;
  }

	  .two-column,
	  .split-layout,
	  .split-layout.reverse,
	  .settings-layout,
	  .invoice-reference-layout,
	  .reference-layout,
	  .sales-layout {
	    grid-template-columns: 1fr !important;
	  }

  .resizable-split-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .split-resizer {
    display: none;
  }

	  .form-panel,
	  .product-picker,
	  .invoice-list-panel,
	  .reference-list-panel {
	    position: static;
	  }

  .customer-analysis-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-analysis-filters .form-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .product-similarity-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .product-similarity-item button {
    grid-column: 1 / -1;
  }

  .branch-select-page {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .branch-select-hero {
    min-height: 360px;
    padding: 28px;
  }

  .branch-card-grid {
    grid-template-columns: 1fr;
  }

  .login-page {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .login-brand-panel {
    min-height: 420px;
    padding: 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    width: 100%;
    max-width: 100vw;
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar-collapsed .sidebar {
    align-items: stretch;
    padding: 10px 12px;
  }

  .sidebar-collapsed .sidebar-head {
    display: flex;
    justify-items: stretch;
  }

  .brand-area {
    padding: 0;
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-label {
    display: block;
  }

  .sidebar-toggle,
  .sidebar-expand-button {
    display: none;
  }

  .brand-area .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
  }

  .brand-area strong {
    font-size: 14px;
  }

  .brand-area span {
    font-size: 10px;
  }

  .nav-list {
    display: flex;
    max-width: 100%;
    gap: 8px;
    margin-inline: -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .sidebar-collapsed .nav-item {
    width: auto;
    height: auto;
    min-height: 38px;
    padding: 8px 10px;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .sidebar-collapsed .nav-icon {
    width: 24px;
    height: 24px;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 16px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .global-search {
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
  }

  .chat-widget {
    inset-inline-start: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 90px));
  }

  .chat-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .chat-users {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-users button {
    min-width: 150px;
    margin-bottom: 0;
  }

  .system-health-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 16px;
  }

  .hero-band,
  .report-head,
  .invoice-header,
  .invoice-customer,
  .invoice-footer {
    display: grid;
  }

  .hero-signature {
    min-width: 0;
  }

	  .form-grid,
	  .form-grid.compact,
    .price-rule-grid,
    .composite-component-row,
	  .permission-grid,
	  .permission-options,
  .metric-grid,
  .payment-grid,
	  .delivery-toolbar,
	  .delivery-customer-summary,
	  .invoice-customer,
	  .return-search,
	  .picker-filters,
      .invoice-product-picker-row,
      .invoice-status-panel,
	  .reference-filters,
	  .reference-meta,
		  .daily-statement {
		    grid-template-columns: 1fr;
		  }

  .invoice-product-entry-head,
  .invoice-product-entry-hint {
    display: grid;
  }

  .invoice-product-entry-hint b {
    white-space: normal;
  }

  .modern-invoice .invoice-customer {
    grid-template-columns: repeat(2, minmax(0, 150px));
  }

  .modern-invoice .invoice-bottom {
    grid-template-columns: 1fr;
  }

.invoice-lines.sale-lines {
  max-height: 64vh;
  scroll-padding-bottom: 220px;
}

  .saved-sale-draft-card,
  .saved-sale-drafts-head {
    align-items: stretch;
    flex-direction: column;
  }

  .saved-sale-draft-actions {
    justify-content: flex-start;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-box,
  .toolbar-filter,
  .product-export-strip,
  .product-pagination,
  .date-range,
  .segmented {
    width: 100%;
  }

  .product-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .product-export-strip {
    justify-content: stretch;
  }

  .product-export-strip button {
    flex: 1 1 auto;
  }

  .activity-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .activity-row time {
    grid-column: 2;
  }

	  .date-range label,
	  .discount-row label {
	    min-width: 100%;
	  }

  .customer-analysis-filters {
    grid-template-columns: 1fr;
  }

  .customer-analysis-filters .form-actions {
    white-space: normal;
  }

  .topbar-actions {
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .branch-switcher {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .branch-switcher button {
    flex: 1 0 auto;
  }

  .sale-sticky-checkout {
    position: static;
    box-shadow: none;
    padding-top: 0;
  }
}

@media (max-width: 800px) {
  .performance-hero {
    min-height: 0;
    align-items: start;
  }

  .performance-hero::after {
    display: none;
  }

  .performance-badge {
    width: 120px;
  }

  .performance-day-row {
    grid-template-columns: 1fr;
  }

  .performance-day-row i {
    min-width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .form-actions,
	  button,
	  .account-password-backdrop,
	  .toast {
	    display: none !important;
	  }

  .app-shell {
    display: block;
  }

  .sale-sticky-checkout {
    position: static;
    box-shadow: none;
  }

  .page,
  .print-body {
    padding: 0;
  }

  .panel,
  .report-head,
  .metric-card {
    box-shadow: none;
    break-inside: avoid;
  }

  .invoice-paper {
    padding: 0;
  }

  .ledger-invoice {
    padding: 9mm 8mm 7mm !important;
    border: 0;
    border-radius: 0;
  }

  .ledger-invoice::before {
    height: 3px;
  }

  .invoice-ledger-head {
    grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.45fr) !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
  }

  .invoice-ledger-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .invoice-ledger-parties {
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr) !important;
    gap: 9px !important;
    margin-bottom: 10px !important;
  }

  .ledger-invoice .invoice-table th,
  .ledger-invoice .invoice-table td {
    padding: 6px 8px !important;
  }

  .ledger-invoice .invoice-ledger-bottom {
    grid-template-columns: minmax(0, 1fr) 310px !important;
    gap: 12px !important;
  }

  .invoice-header {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  .invoice-title-block {
    grid-column: 2 !important;
    justify-self: end !important;
  }

  .invoice-seller {
    grid-column: 1 !important;
    justify-self: start !important;
  }

  .invoice-customer {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 180px)) !important;
    justify-content: start !important;
  }

  .invoice-payments {
    width: fit-content !important;
  }

  .modern-invoice .invoice-hero {
    display: flex !important;
  }

  .modern-invoice .invoice-customer {
    grid-template-columns: repeat(2, minmax(0, 170px)) !important;
  }

  .modern-invoice .invoice-bottom {
    grid-template-columns: minmax(0, 1fr) 330px !important;
  }

  .modern-invoice .invoice-payments {
    width: 100% !important;
  }

  .invoice-policy {
    font-size: 9.5px;
    line-height: 1.45;
    padding: 8px 10px;
  }

  .invoice-policy strong {
    font-size: 10px;
  }

  .thermal-print-body {
    width: 80mm;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .thermal-receipt {
    width: 76mm;
    max-width: 76mm;
    margin: 0;
    padding: 0;
    color: #000 !important;
    font-family: Arial, Tahoma, sans-serif !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }
}
