:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-soft: #eef3eb;
  --ink: #1f2a24;
  --muted: #647067;
  --line: #dce3da;
  --accent: #1f7a4d;
  --accent-strong: #135f3a;
  --danger: #b42318;
  --warning: #a15c07;
  --shadow: 0 18px 42px rgba(28, 43, 34, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

button.secondary:hover {
  background: var(--surface-soft);
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #8f1b12;
}

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

button.danger:disabled:hover {
  background: var(--danger);
}

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-strong);
}

.button-link.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-link.secondary:hover {
  background: var(--surface-soft);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.eye-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

textarea {
  min-height: 108px;
  padding: 10px 12px;
  resize: vertical;
}

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

.field-help {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-help a {
  color: var(--accent-strong);
}

.hidden {
  display: none !important;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.login-brand {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  background:
    linear-gradient(145deg, rgba(31, 122, 77, 0.92), rgba(31, 42, 36, 0.94)),
    url("https://images.unsplash.com/photo-1556742502-ec7c0e9f34b1?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
  color: white;
}

.brand-mark {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 800;
}

.sidebar .brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 1.12rem;
}

.brand-logo-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #15935a, #087643);
  color: #fff;
  box-shadow: 0 10px 20px rgba(8, 127, 73, 0.28);
}

.brand-logo-icon .icon {
  width: 24px;
  height: 24px;
}

.login-brand h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.6;
}

.login-panel {
  display: grid;
  align-content: center;
  padding: 48px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.login-card h2,
.page-title h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0;
}

.login-card p,
.page-title p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-login {
  position: relative;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.09fr) minmax(520px, 0.91fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.98), rgba(246, 247, 244, 0.76) 33%, transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(246, 247, 244, 0.96), rgba(246, 247, 244, 0.35) 32%, transparent 33%),
    linear-gradient(90deg, #f5f6f3, #ffffff);
}

.auth-login::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 210px;
  height: 100%;
  content: "";
  background-image: radial-gradient(rgba(30, 42, 53, 0.11) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity: 0.46;
  pointer-events: none;
}

.auth-hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 48px 72px 72px;
  overflow: hidden;
  justify-content: space-between;
  background:
    linear-gradient(90deg, rgba(2, 28, 27, 0.96), rgba(0, 91, 54, 0.86)),
    url("assets/login-pos-bg.png");
  background-position: center;
  background-size: cover;
  clip-path: polygon(0 0, 86% 0, 100% 47%, 84% 100%, 0 100%);
}

.auth-hero::before,
.auth-hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-hero::before {
  inset: 0;
  background:
    radial-gradient(circle at 70% 90%, rgba(255, 255, 255, 0.09), transparent 24%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.28));
}

.auth-hero::after {
  right: 8.5%;
  bottom: -8%;
  width: 38%;
  height: 34%;
  border-top-left-radius: 100%;
  background: rgba(255, 255, 255, 0.07);
}

.auth-brand-mark,
.auth-copy {
  position: relative;
  z-index: 1;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border-radius: 999px;
  padding: 16px 24px 16px 18px;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.auth-brand-mark .brand-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #18b56a, #0a8b53);
  color: white;
}

.auth-brand-mark .icon {
  width: 22px;
  height: 22px;
}

.auth-copy {
  max-width: 650px;
  padding-left: 8px;
}

.auth-copy h1 {
  display: grid;
  gap: 2px;
  margin: 0;
  color: white;
  font-size: clamp(3.8rem, 6.4vw, 7rem);
  line-height: 0.96;
  text-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.auth-copy .mobile-title {
  display: none;
}

.auth-copy p {
  position: relative;
  max-width: 520px;
  margin: 26px 0 0;
  padding-left: 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.45rem;
  line-height: 1.35;
}

.auth-copy p::before {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 4px;
  content: "";
  border-radius: 999px;
  background: #0fb76b;
}

.auth-panel {
  position: relative;
  z-index: 1;
  align-content: center;
  padding: 34px min(7vw, 78px) 34px 22px;
}

.auth-panel .login-card {
  max-width: 640px;
  padding: 44px 54px 46px;
  border: 1px solid rgba(14, 30, 37, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(22, 31, 37, 0.16);
  backdrop-filter: blur(18px);
}

.login-card-icon,
.login-footer span {
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 137, 79, 0.12);
  border-radius: 50%;
  background: #eff8f2;
  color: #0c9a59;
}

.login-card-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.54);
}

.login-card-icon .icon {
  width: 34px;
  height: 34px;
  stroke-width: 3.4;
}

.auth-panel .login-card h2 {
  color: #101d2d;
  font-size: 2.25rem;
  line-height: 1.04;
  text-align: center;
}

.auth-panel .login-card > p {
  margin: 12px 0 0;
  color: #66717f;
  font-size: 1.06rem;
  text-align: center;
}

.auth-panel .form-stack {
  gap: 18px;
  margin-top: 28px;
}

.auth-panel label {
  gap: 10px;
  color: #142130;
  font-size: 1rem;
}

.input-with-icon {
  position: relative;
  display: block;
}

.input-with-icon > .icon {
  position: absolute;
  top: 50%;
  left: 22px;
  z-index: 1;
  width: 23px;
  height: 23px;
  color: #67727e;
  transform: translateY(-50%);
}

.auth-panel input[type="email"],
.auth-panel input[type="password"],
.auth-panel input[type="text"] {
  min-height: 56px;
  border-color: #d9dee4;
  border-radius: 10px;
  background: rgba(250, 251, 252, 0.92);
  color: #142130;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(16, 29, 45, 0.02);
}

.input-with-icon input {
  padding-left: 66px;
}

.auth-panel input::placeholder {
  color: #172334;
  opacity: 1;
}

.auth-panel .password-field input {
  padding-right: 66px;
}

.auth-panel .password-toggle {
  right: 16px;
  width: 42px;
  min-height: 42px;
  color: #697580;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #626c78;
  font-size: 1rem;
}

.remember-option {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 12px;
  color: #626c78;
  font-weight: 500;
}

.remember-option input {
  position: relative;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  appearance: none;
  background: #0b9858;
  box-shadow: 0 8px 20px rgba(0, 137, 79, 0.22);
}

.remember-option input::after {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 7px;
  height: 13px;
  content: "";
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.login-options a {
  color: #008a50;
  font-weight: 600;
  text-decoration: none;
}

.login-submit {
  min-height: 60px;
  margin-top: 4px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0aaa63, #078746);
  font-size: 1.12rem;
  box-shadow: 0 16px 28px rgba(0, 137, 79, 0.24);
}

.login-submit:hover {
  background: linear-gradient(135deg, #0a9a59, #05783d);
}

.login-footer {
  display: none;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.error {
  min-height: 24px;
  color: var(--danger);
  font-weight: 700;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #18231d;
  color: white;
  padding: 24px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.brand-short,
.sidebar-collapse-toggle {
  display: none;
}

.nav-hover-toast {
  position: fixed;
  z-index: 200;
  max-width: 220px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #102118;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-hover-toast.visible {
  opacity: 1;
  transform: translate(0, -50%);
}

.sidebar-close,
.menu-toggle,
.menu-backdrop {
  display: none;
}

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

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 12px;
  text-decoration: none;
}

.nav-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.nav-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

@media (min-width: 981px) {
  .app-shell {
    transition: grid-template-columns 180ms ease;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: padding 180ms ease;
  }

  .sidebar-collapse-toggle {
    display: inline-flex;
    position: fixed;
    top: 50%;
    left: 264px;
    z-index: 130;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid #c8e2d4;
    border-radius: 999px;
    background: #fff;
    color: #087f49;
    box-shadow: 0 7px 18px rgba(21, 49, 34, 0.16);
    transform: translateY(-50%) rotate(90deg);
    transition: background 140ms ease, color 140ms ease, transform 180ms ease;
  }

  .sidebar-collapse-toggle .icon {
    width: 16px;
    height: 16px;
  }

  .sidebar-collapse-toggle:hover {
    background: #edf8f1;
    color: #087f49;
  }

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

  .sidebar-collapsed .sidebar {
    padding: 18px 12px;
  }

  .sidebar-collapsed .sidebar-header {
    justify-content: center;
    margin-bottom: 26px;
  }

  .sidebar-collapsed .brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
  }

  .sidebar-collapsed .brand-full {
    display: none;
  }

  .sidebar-collapsed .brand-short {
    display: none;
  }

  .sidebar-collapsed .brand-logo-icon {
    width: 38px;
    height: 38px;
  }

  .sidebar-collapsed .sidebar-collapse-toggle {
    left: 86px;
    transform: translateY(-50%) rotate(-90deg);
  }

  .sidebar-collapsed .nav-list {
    gap: 8px;
  }

  .sidebar-collapsed .nav-item {
    position: relative;
    justify-content: center;
    min-height: 46px;
    padding: 0;
  }

  .sidebar-collapsed .nav-label {
    gap: 0;
  }

  .sidebar-collapsed .nav-label > span:last-child {
    display: none;
  }

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

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-title {
  min-width: 0;
  flex: 1 1 280px;
}

.mobile-app-name {
  display: none;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 4px 10px 4px 4px;
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
  border-color: var(--line);
  background: var(--surface);
}

.user-menu-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 25;
  display: none;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(28, 43, 34, 0.16);
  padding: 8px;
}

.user-menu.open .user-menu-panel {
  display: block;
}

.user-menu-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.user-menu-profile div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-menu-profile strong,
.user-menu-profile span {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-profile span {
  color: #4f5e55;
  font-size: 0.86rem;
}

.user-menu-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #102118;
  font-weight: 700;
  padding: 0 10px;
  text-decoration: none;
}

.user-menu-item .icon {
  color: #102118;
}

.user-menu-item:hover {
  background: var(--surface-soft);
}

.user-menu-form {
  margin: 0;
}

.settings-page {
  display: grid;
  max-width: 760px;
}

.settings-card {
  box-shadow: none;
}

.admin-card {
  overflow: hidden;
}

.admin-shortcuts {
  margin-top: 18px;
}

.admin-toolbar {
  grid-template-columns: minmax(240px, 1fr) 46px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-actions form {
  margin: 0;
}

.admin-link {
  min-width: 116px;
  white-space: nowrap;
}

.users-table {
  min-width: 860px;
  border-radius: 0;
  background: transparent;
}

.users-table code {
  display: inline-block;
  border: 1px solid #dce8e1;
  border-radius: 999px;
  background: #f5f8f6;
  color: #183027;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 9px;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-form {
  margin: 0;
}

.permission-cell {
  font-size: 0.82rem;
}

.permission-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px;
  border: 1px solid #cbe8d8;
  border-radius: 999px;
  background: #edf8f1;
  color: #087f49;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 10px;
}

.permissions-heading {
  margin-top: 24px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.permission-group > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}

.permission-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.permission-check input {
  width: auto;
  min-height: auto;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff !important;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 26px 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.metric {
  color: var(--accent-strong);
  font-size: 1.8rem;
  font-weight: 850;
}

.dashboard-page {
  display: grid;
  gap: 18px;
}

.dashboard-filter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.dashboard-filter {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) 46px;
  gap: 10px;
  width: min(100%, 620px);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quick-actions .button-link,
.dashboard-filter button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

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

.dashboard-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-kpi {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.dashboard-kpi-icon {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #eaf7ef;
  color: var(--accent);
}

.dashboard-kpi h3 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-kpi strong {
  display: block;
  color: var(--ink);
  font-size: clamp(1.18rem, 2vw, 1.72rem);
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.dashboard-kpi span:not(.dashboard-kpi-icon) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-kpi-profit {
  border-color: #bfe2cc;
  background: #f4fbf7;
}

.dashboard-kpi-profit .dashboard-kpi-icon {
  background: #d9f3e3;
  color: #087643;
}

.dashboard-kpi-expense,
.dashboard-kpi-negative {
  border-color: #f0d0d0;
  background: #fff8f8;
}

.dashboard-kpi-expense .dashboard-kpi-icon,
.dashboard-kpi-negative .dashboard-kpi-icon {
  background: #fbe6e6;
  color: #b42318;
}

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

.dashboard-alert {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-decoration: none;
}

.dashboard-alert.is-active {
  border-color: #ffe0ad;
  background: #fff7e8;
  color: #7a4300;
}

.dashboard-alert .icon {
  width: 22px;
  min-width: 22px;
  height: 22px;
}

.dashboard-alert span {
  font-size: 0.88rem;
  font-weight: 700;
}

.dashboard-alert strong {
  font-size: 1rem;
}

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

.dashboard-panel {
  min-width: 0;
}

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

.dashboard-performance-grid .dashboard-chart {
  margin-top: 0;
}

.capital-composition-grid,
.capital-total-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.capital-composition-grid > div,
.capital-total-row > div {
  min-width: 0;
  padding: 14px 16px;
}

.capital-composition-grid > div + div,
.capital-total-row > div + div {
  border-left: 1px solid var(--line);
}

.capital-composition-grid span,
.capital-total-row span,
.capital-composition-grid small,
.capital-total-row small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.capital-composition-grid strong,
.capital-total-row strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.capital-total-row {
  margin-top: 12px;
  background: #fff;
}

.capital-total-row .is-primary {
  background: #eaf7ef;
}

.capital-total-row .is-primary span,
.capital-total-row .is-primary strong {
  color: #087643;
}

.dashboard-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dashboard-mini-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.dashboard-mini-grid strong {
  display: block;
  font-size: 1.18rem;
  font-weight: 900;
}

.dashboard-mini-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.dashboard-chart {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.dashboard-chart h3 {
  margin: 0;
  font-size: 0.92rem;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.35fr) minmax(0, 1fr) minmax(76px, auto);
  align-items: center;
  gap: 10px;
}

.chart-row > span,
.chart-row > strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chart-row > strong {
  color: var(--ink);
  text-align: right;
}

.chart-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebe5;
}

.chart-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #22a163);
}

.dashboard-table {
  min-width: 0;
  table-layout: fixed;
}

.dashboard-table th,
.dashboard-table td {
  padding: 11px 9px;
}

.dashboard-table th:nth-child(2),
.dashboard-table td:nth-child(2),
.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(3) {
  width: 110px;
  text-align: right;
  white-space: nowrap;
}

.dashboard-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.dashboard-list strong {
  overflow-wrap: anywhere;
}

.dashboard-list span {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-list b {
  grid-row: 1 / span 2;
  grid-column: 2;
  white-space: nowrap;
}

.distributor-dashboard {
  gap: 16px;
}

.distributor-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.distributor-route-head h2 {
  margin: 3px 0 5px;
  font-size: 1.45rem;
}

.distributor-route-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.distributor-route-eyebrow {
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.distributor-route-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.distributor-route-actions .status-pill {
  min-height: 42px;
}

.distributor-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.distributor-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
}

.distributor-dashboard-lower {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.distributor-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e9e4;
}

.distributor-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.distributor-next-clients {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.distributor-next-clients h3 {
  margin-bottom: 6px;
}

.distributor-next-clients > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.distributor-next-clients > div:last-child {
  border-bottom: 0;
}

.distributor-stop-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eaf7ef;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.distributor-next-clients p,
.distributor-next-clients strong,
.distributor-next-clients p span {
  display: block;
  min-width: 0;
  margin: 0;
}

.distributor-next-clients p span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.distributor-money-list {
  display: grid;
}

.distributor-money-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.distributor-money-list span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.distributor-money-list strong {
  white-space: nowrap;
}

.distributor-money-list .total {
  margin-top: 4px;
  border-bottom: 0;
  border-radius: 8px;
  background: #edf8f1;
  padding: 12px;
}

.distributor-money-list .total span,
.distributor-money-list .total strong {
  color: var(--accent-strong);
  font-weight: 900;
}

.distributor-load-table th:not(:first-child),
.distributor-load-table td:not(:first-child) {
  width: 96px;
  text-align: right;
  white-space: nowrap;
}

.distributor-recent-sales {
  display: grid;
}

.distributor-recent-sales > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 0;
  text-decoration: none;
}

.distributor-recent-sales > a:last-child {
  border-bottom: 0;
}

.distributor-recent-sales > a:hover strong {
  color: var(--accent-strong);
}

.distributor-recent-sales span,
.distributor-recent-sales strong,
.distributor-recent-sales small {
  display: block;
  min-width: 0;
}

.distributor-recent-sales small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.distributor-recent-sales b {
  white-space: nowrap;
}

.distributor-recent-sales .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.distributor-dashboard-empty {
  display: grid;
  gap: 16px;
}

.distributor-empty-state {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.distributor-empty-state h2,
.distributor-empty-state p {
  margin: 0;
}

.distributor-empty-state p {
  margin-top: 4px;
}

.distributor-empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: #eaf7ef;
  color: var(--accent-strong);
}

.distributor-empty-icon .icon {
  width: 26px;
  height: 26px;
}

@media (max-width: 980px) {
  .distributor-route-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .distributor-route-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .distributor-dashboard-grid,
  .distributor-dashboard-lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .distributor-kpi-grid {
    grid-template-columns: 1fr;
  }

  .distributor-route-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .distributor-route-actions .status-pill {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .distributor-route-actions .button-link {
    width: 100%;
    justify-content: center;
  }

  .distributor-empty-state {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .distributor-empty-state > .button-link {
    grid-column: 1 / -1;
    width: 100%;
  }

  .distributor-load-table th:not(:first-child),
  .distributor-load-table td:not(:first-child) {
    width: auto;
  }
}

.route-map-page {
  display: grid;
  gap: 14px;
}

.route-map-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.route-map-page-head h2 {
  margin: 3px 0 5px;
  font-size: 1.55rem;
}

.route-map-page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.route-map-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.route-map-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.55fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.route-map-search {
  position: relative;
}

.route-map-search .icon {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transform: translateY(-50%);
}

.route-map-search input {
  min-height: 48px;
  padding-left: 46px;
}

.route-map-zone-filter {
  display: grid;
  gap: 5px;
}

.route-map-zone-filter > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.route-map-zone-filter select {
  min-height: 48px;
}

.route-map-result-count {
  display: grid;
  min-width: 118px;
  min-height: 48px;
  align-content: center;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.route-map-result-count strong,
.route-map-result-count span {
  display: block;
}

.route-map-result-count strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.route-map-result-count span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.route-map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 14px;
  min-height: 620px;
}

.route-map-panel,
.route-store-registry {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.route-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 620px;
}

.route-map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.route-map-controls .map-control.active {
  background: var(--accent);
  color: #fff;
}

.route-map-legend {
  position: absolute;
  bottom: 58px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 10px;
  box-shadow: 0 8px 20px rgba(28, 43, 34, 0.14);
}

.route-map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.route-map-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.route-map-legend .pending {
  background: #1666d8;
}

.route-map-legend .visited {
  background: #16804b;
}

.route-map-legend .current {
  background: #0f8a4b;
  box-shadow: 0 0 0 2px #bce7ce;
}

.route-map-status {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(28, 43, 34, 0.14);
}

.route-map-unavailable {
  display: grid;
  min-height: 620px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: var(--surface-soft);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.route-map-unavailable .icon {
  width: 38px;
  height: 38px;
  color: var(--accent-strong);
}

.route-map-unavailable strong {
  color: var(--ink);
}

.route-store-registry {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.route-store-registry-head {
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
}

.route-store-registry-head h3,
.route-store-registry-head p {
  margin: 0;
}

.route-store-registry-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.route-store-groups {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 12px 14px;
}

.route-store-zone[hidden],
.route-store-item[hidden] {
  display: none;
}

.route-store-zone h4 {
  position: sticky;
  top: -8px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  background: var(--surface);
  padding: 12px 2px 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.route-store-zone h4 span {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.7rem;
}

.route-store-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px;
}

.route-store-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20, 133, 76, 0.12);
}

.route-store-item.is-visited {
  background: #f4faf6;
}

.route-store-select {
  display: grid;
  grid-template-columns: 28px 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.route-store-select:hover {
  background: transparent;
  color: var(--accent-strong);
  transform: none;
}

.route-store-order {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e7f0ff;
  color: #135dbf;
  font-size: 0.72rem;
  font-weight: 900;
}

.route-store-item.is-visited .route-store-order {
  background: #def2e6;
  color: #126c40;
}

.route-store-select img,
.route-store-photo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.route-store-photo-placeholder {
  display: grid;
  place-items: center;
  background: #eef2f0;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.route-store-copy,
.route-store-copy strong,
.route-store-copy small,
.route-store-copy em {
  display: block;
  min-width: 0;
}

.route-store-copy strong,
.route-store-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-store-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.route-store-copy em {
  margin-top: 4px;
  color: #135dbf;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.route-store-item.is-visited .route-store-copy em {
  color: #126c40;
}

.route-store-item > .button-link {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
}

.route-store-empty {
  margin: 14px 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.route-map-info {
  display: grid;
  grid-template-columns: 62px minmax(180px, 1fr);
  gap: 10px;
  max-width: 340px;
  padding: 4px 2px 2px;
  color: #17221c;
}

.route-map-info > img {
  width: 62px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}

.route-map-info strong,
.route-map-info span {
  display: block;
}

.route-map-info strong {
  font-size: 0.92rem;
}

.route-map-info span {
  margin-top: 2px;
  color: #617066;
  font-size: 0.72rem;
  font-weight: 700;
}

.route-map-info p {
  margin: 7px 0;
  color: #47564c;
  font-size: 0.76rem;
}

.route-map-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-map-info-actions a {
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
}

.route-map-info-sale {
  background: #14854c;
  color: #fff;
}

.route-map-info-directions {
  border: 1px solid #cfd9d2;
  background: #fff;
  color: #17221c;
}

@media (max-width: 1050px) {
  .route-map-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  }
}

@media (max-width: 820px) {
  .route-map-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-map-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .route-map-toolbar,
  .route-map-workspace {
    grid-template-columns: 1fr;
  }

  .route-map-result-count {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 9px;
    padding-left: 0;
  }

  .route-map-workspace {
    min-height: 0;
  }

  .route-map-canvas,
  .route-map-unavailable {
    height: 56vh;
    min-height: 390px;
    max-height: 600px;
  }

  .route-store-registry {
    max-height: 620px;
  }
}

@media (max-width: 540px) {
  .route-map-page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .route-map-page-actions .button-link {
    width: 100%;
    justify-content: center;
  }

  .route-map-toolbar {
    padding: 10px;
  }

  .route-map-canvas,
  .route-map-unavailable {
    height: 52vh;
    min-height: 360px;
  }

  .route-map-legend {
    right: 12px;
  }

  .route-map-status {
    font-size: 0.72rem;
  }

  .route-store-groups {
    padding-right: 8px;
    padding-left: 8px;
  }

  .route-store-item {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .route-store-select {
    grid-template-columns: 26px 42px minmax(0, 1fr);
    gap: 6px;
  }

  .route-store-select img,
  .route-store-photo-placeholder {
    width: 42px;
    height: 42px;
  }
}

.positive-text {
  color: var(--accent-strong);
}

.muted {
  color: var(--muted);
}

.users-section,
.split-section {
  margin-top: 32px;
}

.split-section {
  display: grid;
  gap: 18px;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.toolbar label {
  min-width: 180px;
}

.data-form {
  box-shadow: none;
}

.data-form h2,
.card h2 {
  margin-top: 0;
}

.topbar .menu-toggle {
  flex: 0 0 auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading p {
  margin: 6px 0 0;
}

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

.full-span {
  grid-column: 1 / -1;
}

.narrow-form {
  max-width: 760px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.clients-table th:first-child,
.clients-table td:first-child {
  width: 80px;
}

.clients-table th:last-child,
.clients-table td:last-child {
  width: 190px;
  min-width: 190px;
}

.categories-table th:last-child,
.categories-table td:last-child {
  width: 220px;
}

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

.action-row form {
  margin: 0;
}

.clients-page {
  display: grid;
  gap: 0;
  min-width: 0;
}

.clients-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(14, 30, 37, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 38px rgba(28, 43, 34, 0.1);
  padding: 20px 24px;
}

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

.clients-card-head h2,
.clients-card-head p {
  margin: 0;
}

.clients-card-head h2 {
  color: #101d2d;
  font-size: 1.72rem;
}

.clients-card-head p {
  margin-top: 8px;
  color: #767f89;
}

.clients-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, 46px);
  align-items: center;
  gap: 10px;
  min-width: min(100%, 500px);
}

.clients-toolbar.compact-toolbar {
  grid-template-columns: minmax(180px, 1fr) repeat(2, 46px);
  min-width: min(100%, 380px);
}

.clients-toolbar.inventory-toolbar {
  grid-template-columns: minmax(180px, 1fr) repeat(6, 46px);
  min-width: min(100%, 620px);
}

.clients-toolbar.inactive-toolbar {
  grid-template-columns: minmax(180px, 1fr) 46px;
  min-width: min(100%, 340px);
}

.client-search {
  position: relative;
  display: block;
  min-width: 0;
}

.client-search-form {
  display: block;
  min-width: 0;
}

.client-search-form .client-search {
  width: 100%;
}

.client-search .icon {
  position: absolute;
  top: 50%;
  left: 18px;
  z-index: 1;
  width: 20px;
  height: 20px;
  color: #66717c;
  transform: translateY(-50%);
}

.client-search input {
  min-height: 52px;
  padding-left: 50px;
  border-color: #dce2e7;
  border-radius: 8px;
  color: #101d2d;
  font-weight: 500;
}

.clients-toolbar .button-link,
.clients-toolbar button.button-link {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  border-radius: 8px;
  padding: 0;
  white-space: nowrap;
}

.icon-only {
  position: relative;
  width: 46px;
  min-width: 46px;
  padding: 0;
}

.has-tooltip::after {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #102118;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 6px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.has-tooltip::before {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 4px);
  z-index: 21;
  width: 10px;
  height: 10px;
  background: #102118;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 6px) rotate(45deg);
  transition: opacity 140ms ease, transform 140ms ease;
}

.has-tooltip:hover::after,
.has-tooltip:focus-visible::after,
.has-tooltip:hover::before,
.has-tooltip:focus-visible::before {
  opacity: 1;
  transform: translate(50%, 0);
}

.clients-toolbar .button-link.secondary,
.clients-toolbar button.button-link.secondary {
  border-color: #dce8e1;
  color: #183027;
}

.clients-toolbar .button-link:not(.secondary) {
  background: linear-gradient(135deg, #0b9858, #087643);
  box-shadow: 0 12px 24px rgba(0, 137, 79, 0.18);
}

.clients-card .table-wrap {
  overflow-x: auto;
}

.client-card-list {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.customer-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid #e3ebe5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 43, 34, 0.08);
}

.customer-photo {
  grid-row: span 4;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, #d9ede2, #eff8f2);
  color: #087f49;
  font-size: 1.25rem;
  font-weight: 900;
}

.customer-name {
  grid-column: 2 / -1;
  min-width: 0;
  color: #101d2d;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.15;
}

.customer-field {
  min-width: 0;
  color: #1b232c;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.customer-field small,
.customer-reference small {
  display: block;
  margin-bottom: 2px;
  color: #7c8b82;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-reference {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f5f8f6;
  color: #3d4a43;
  font-size: 0.86rem;
  line-height: 1.35;
}

.customer-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.customer-actions form {
  margin: 0;
}

.customer-actions .button-link,
.customer-actions button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 13px;
  padding: 0;
}

.client-empty-state {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
}

.customer-card[hidden],
.client-card-list [hidden],
.category-card-list [hidden],
.zone-card-list [hidden],
.sale-product-card[hidden],
.sale-empty-products[hidden],
.sale-credit-summary[hidden],
.sale-confirm-overlay[hidden],
.sale-client-results[hidden],
.sale-client-results [hidden],
.sale-selected-client[hidden] {
  display: none !important;
}

.product-visual-list [hidden] {
  display: none !important;
}

.client-detail-card {
  overflow: hidden;
}

.client-detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.client-detail-photo-wrap {
  min-width: 0;
}

.client-detail-photo {
  display: grid;
  width: 100%;
  min-height: 260px;
  aspect-ratio: 4 / 3;
  place-items: center;
  border: 1px solid #dcefe5;
  border-radius: 18px;
  background: linear-gradient(135deg, #d9ede2, #eff8f2);
  color: #087f49;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(28, 43, 34, 0.1);
}

.client-detail-initials {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
}

.client-detail-grid {
  margin: 0;
}

.client-detail-note {
  grid-column: 1 / -1;
}

.client-view-page {
  display: grid;
  gap: 18px;
}

.client-view-card {
  border: 1px solid rgba(14, 30, 37, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 38px rgba(28, 43, 34, 0.09);
  padding: 22px;
}

.client-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.client-view-head h2 {
  margin: 0;
  color: #101d2d;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.client-view-head p {
  margin: 8px 0 0;
  color: #5f6c64;
  line-height: 1.45;
}

.client-view-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.client-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.client-photo-panel {
  border: 1px solid #e0e7e1;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.client-photo-panel img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #edf3ee;
}

.client-photo-placeholder {
  display: grid;
  width: 100%;
  height: 260px;
  place-items: center;
  background: linear-gradient(135deg, #d9ede2, #eff8f2);
  color: #087f49;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
}

.client-photo-caption {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #f8faf8;
}

.client-photo-caption strong {
  color: #101d2d;
  font-size: 1rem;
}

.client-photo-caption span {
  color: #647067;
  font-size: 0.88rem;
  font-weight: 650;
}

.client-summary-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #e0e7e1;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #f7faf8);
}

.client-name-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e4ebe5;
}

.client-initial {
  display: grid;
  width: 58px;
  min-width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: #eaf7ef;
  color: #087f49;
  font-size: 1.2rem;
  font-weight: 900;
}

.client-name-block h3 {
  margin: 0;
  color: #101d2d;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.client-name-block p {
  margin: 5px 0 0;
  color: #647067;
  font-weight: 700;
}

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

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid #e0e7e1;
  border-radius: 14px;
  background: #ffffff;
}

.info-icon {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #eef7f1;
  color: #087f49;
}

.info-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.info-text strong {
  color: #68746d;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-text span {
  color: #101d2d;
  font-size: 1rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.section-title {
  margin: 0 0 10px;
  color: #101d2d;
  font-size: 1.15rem;
}

.section-subtitle {
  margin: -4px 0 12px;
  color: #647067;
  font-weight: 650;
}

.map-card {
  border: 1px solid #e0e7e1;
  border-radius: 14px;
  overflow: hidden;
  background: #eef3eb;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #dce3da;
  background: #ffffff;
}

.map-toolbar strong {
  color: #101d2d;
}

.map-toolbar span {
  color: #647067;
  font-size: 0.88rem;
  font-weight: 700;
}

.map-frame {
  position: relative;
  width: 100%;
  min-height: 360px;
  background: #e9eddf;
}

.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-coordinate-chip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  max-width: calc(100% - 28px);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(220, 227, 218, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #233129;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 9px 12px;
  box-shadow: 0 12px 28px rgba(28, 43, 34, 0.18);
  backdrop-filter: blur(10px);
}

.reference-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #e0e7e1;
  border-radius: 14px;
  background: #ffffff;
}

.reference-card strong {
  color: #68746d;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-card p {
  margin: 0;
  color: #1f2a24;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.5;
}

.category-card-list,
.zone-card-list,
.brand-card-list,
.supplier-card-list {
  display: none;
  gap: 12px;
}

.category-card,
.zone-card,
.brand-card,
.supplier-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid #e3ebe5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 43, 34, 0.08);
}

.category-icon,
.zone-icon,
.brand-icon,
.supplier-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: linear-gradient(135deg, #eaf7ef, #dff1e6);
  color: #087f49;
  box-shadow: inset 0 0 0 1px rgba(8, 127, 73, 0.08);
}

.brand-icon img {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  object-fit: cover;
}

.brand-icon span {
  color: #087f49;
  font-size: 1.1rem;
  font-weight: 900;
}

.category-main,
.zone-main,
.brand-main,
.supplier-main {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 6px;
}

.category-name,
.zone-name,
.brand-name,
.supplier-name {
  color: #101d2d;
  font-size: 1.06rem;
  font-weight: 850;
  line-height: 1.15;
}

.category-count,
.zone-count,
.brand-count,
.supplier-count {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #cbe8d8;
  border-radius: 999px;
  background: #edf8f1;
  color: #087f49;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.category-description,
.zone-description,
.brand-description,
.supplier-description {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f5f8f6;
  color: #3d4a43;
  font-size: 0.88rem;
  line-height: 1.35;
}

.category-description small,
.zone-description small,
.brand-description small,
.supplier-description small {
  display: block;
  margin-bottom: 4px;
  color: #7c8b82;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.supplier-status {
  grid-column: 1 / -1;
}

.category-actions,
.zone-actions,
.brand-actions,
.supplier-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.category-actions form,
.zone-actions form,
.brand-actions form,
.supplier-actions form {
  margin: 0;
}

.category-actions .button-link,
.category-actions button,
.zone-actions .button-link,
.zone-actions button,
.brand-actions .button-link,
.brand-actions button,
.supplier-actions .button-link,
.supplier-actions button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 13px;
  padding: 0;
}

.category-empty-state,
.zone-empty-state,
.brand-empty-state,
.supplier-empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed #dce3da;
  border-radius: 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.inventory-mobile-fab {
  display: none;
}

.inventory-capital-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-capital-summary > div {
  min-width: 0;
  padding: 14px 16px;
}

.inventory-capital-summary > div + div {
  border-left: 1px solid var(--line);
}

.inventory-capital-summary span,
.inventory-capital-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.inventory-capital-summary strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.clients-table {
  width: 100%;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  table-layout: fixed;
}

.products-table {
  min-width: 1180px;
  border-radius: 0;
  background: transparent;
}

.inventory-products-table {
  min-width: 0;
  table-layout: fixed;
}

.inventory-products-table th,
.inventory-products-table td {
  padding: 12px 9px;
}

.inventory-products-table th:first-child,
.inventory-products-table td:first-child {
  width: 18%;
}

.inventory-products-table th:nth-child(2),
.inventory-products-table td:nth-child(2) {
  width: 14%;
}

.inventory-products-table th:nth-child(3),
.inventory-products-table td:nth-child(3) {
  width: 10%;
}

.inventory-products-table th:nth-child(4),
.inventory-products-table td:nth-child(4),
.inventory-products-table th:nth-child(5),
.inventory-products-table td:nth-child(5),
.inventory-products-table th:nth-child(6),
.inventory-products-table td:nth-child(6),
.inventory-products-table th:nth-child(7),
.inventory-products-table td:nth-child(7) {
  width: 10%;
  white-space: nowrap;
}

.inventory-products-table th:nth-child(8),
.inventory-products-table td:nth-child(8),
.inventory-products-table th:last-child,
.inventory-products-table td:last-child {
  width: 108px;
}

.inventory-products-table-wrap {
  display: none;
}

.product-visual-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid #e4ebe6;
}

.product-empty-state {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
}

.product-visual-card {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #e4ebe6;
  background: #fff;
}

.product-visual-media {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.product-unit-ribbon {
  display: grid;
  align-self: stretch;
  min-height: 96px;
  place-items: center;
  border-radius: 8px;
  background: #0f9a5d;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.product-visual-photo {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #eef7f2, #ffffff);
  color: #087f49;
  font-size: 1.6rem;
  font-weight: 900;
  object-fit: contain;
  box-shadow: 0 16px 34px rgba(28, 43, 34, 0.08);
}

.product-visual-body {
  min-width: 0;
}

.product-visual-body h3 {
  margin: 0;
  color: #101d2d;
  font-size: 1.08rem;
  line-height: 1.18;
}

.product-visual-meta,
.product-visual-description {
  margin: 6px 0 0;
  color: #647067;
  font-weight: 800;
}

.product-visual-description {
  font-weight: 700;
}

.product-visual-price {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  color: #087f49;
  font-size: 1.12rem;
  font-weight: 900;
}

.product-visual-stock {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 8px;
  color: #101d2d;
  font-size: 0.92rem;
  font-weight: 850;
}

.product-visual-stock span {
  color: #647067;
}

.product-visual-stock strong span,
.product-visual-stock b {
  color: #087f49;
}

.product-visual-card.is-low-stock .product-visual-stock strong span {
  color: #dc2626;
}

.product-visual-capital {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e4ebe6;
}

.product-visual-capital span,
.product-visual-capital small {
  color: #647067;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-visual-capital strong {
  color: #101d2d;
  font-size: 1.08rem;
  font-weight: 900;
}

.product-visual-capital small {
  flex-basis: 100%;
}

.product-low-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-top: 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 900;
}

.product-visual-actions .row-actions {
  justify-content: flex-end;
}

.product-visual-footer {
  margin-top: 18px;
  color: #647067;
  font-weight: 850;
}

.suppliers-table {
  min-width: 980px;
}

.purchases-table {
  min-width: 0;
  table-layout: fixed;
}

.purchases-table th,
.purchases-table td {
  padding: 12px 10px;
}

.purchases-table th:first-child,
.purchases-table td:first-child {
  width: 80px;
}

.purchases-table th:nth-child(2),
.purchases-table td:nth-child(2) {
  width: 138px;
}

.purchases-table th:nth-child(4),
.purchases-table td:nth-child(4) {
  width: 116px;
  white-space: nowrap;
}

.purchases-table th:nth-child(5),
.purchases-table td:nth-child(5),
.purchases-table th:nth-child(6),
.purchases-table td:nth-child(6) {
  width: 104px;
  white-space: nowrap;
}

.purchases-table th:nth-child(7),
.purchases-table td:nth-child(7) {
  width: 150px;
}

.purchases-table th:last-child,
.purchases-table td:last-child {
  width: 90px;
}

.purchases-table td {
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}

.purchases-table td strong {
  display: block;
}

.purchases-table .status-pill {
  min-height: 34px;
  max-width: 100%;
  padding: 0 10px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.sales-history-table th:nth-child(4),
.sales-history-table td:nth-child(4) {
  width: 260px;
  white-space: normal;
}

.sales-history-table th:nth-child(5),
.sales-history-table td:nth-child(5),
.sales-history-table th:nth-child(6),
.sales-history-table td:nth-child(6) {
  width: 92px;
}

.sales-history-table th:nth-child(7),
.sales-history-table td:nth-child(7) {
  width: 126px;
}

.sales-history-table th:last-child,
.sales-history-table td:last-child {
  width: 72px;
}

.sales-history-table td[data-label="Pago"] strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.purchase-page-card {
  display: grid;
  gap: 16px;
}

.purchase-toolbar {
  align-items: stretch;
  grid-template-columns: minmax(280px, 1fr) 56px 56px;
}

.purchase-filter-trigger {
  display: none;
}

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

.purchase-summary-row div {
  min-height: 78px;
  border: 1px solid #dce8e1;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdfc, #f4f8f5);
  padding: 14px;
}

.purchase-summary-row span {
  display: block;
  color: #647067;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.purchase-summary-row strong {
  display: block;
  margin-top: 8px;
  color: #101d2d;
  font-size: 1.2rem;
  line-height: 1.1;
}

.purchase-quick-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 10px;
  margin: -2px 0 0;
}

.purchase-list-card {
  border-radius: 18px;
  background: #fff;
}

.cash-table {
  min-width: 0;
  table-layout: fixed;
}

.cash-table th,
.cash-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

.cash-table th:first-child,
.cash-table td:first-child {
  width: 116px;
}

.cash-table th:nth-child(2),
.cash-table td:nth-child(2) {
  width: 170px;
}

.cash-table th:nth-child(4),
.cash-table td:nth-child(4),
.cash-table th:nth-child(5),
.cash-table td:nth-child(5),
.cash-table th:nth-child(6),
.cash-table td:nth-child(6) {
  width: 112px;
  text-align: right;
  white-space: nowrap;
}

.cash-table td strong {
  display: block;
  overflow-wrap: anywhere;
}

.cash-table .table-subtext {
  overflow-wrap: anywhere;
}

.debts-table {
  min-width: 0;
  table-layout: fixed;
}

.debts-table th,
.debts-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

.debts-table th:first-child,
.debts-table td:first-child {
  width: 22%;
}

.debts-table th:nth-child(2),
.debts-table td:nth-child(2) {
  width: 18%;
}

.debts-table th:nth-child(3),
.debts-table td:nth-child(3) {
  width: 14%;
}

.debts-table th:nth-child(4),
.debts-table td:nth-child(4) {
  width: 10%;
}

.debts-table th:nth-child(5),
.debts-table td:nth-child(5) {
  width: 18%;
}

.debts-table th:last-child,
.debts-table td:last-child {
  width: 78px;
}

.debts-table th,
.debts-table td {
  overflow-wrap: anywhere;
}

.debts-table td strong {
  display: block;
  overflow-wrap: anywhere;
}

.receivables-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(132px, 0.8fr) minmax(132px, 0.8fr) minmax(112px, auto) minmax(104px, auto);
  align-items: center;
  gap: 10px;
  max-width: none;
  margin: 0 0 16px;
}

.filter-button {
  min-width: 104px;
  padding-inline: 12px;
}

.receivables-table {
  min-width: 0;
  table-layout: fixed;
}

.receivables-table th,
.receivables-table td {
  padding: 12px 9px;
  vertical-align: middle;
}

.receivables-table th:first-child,
.receivables-table td:first-child {
  width: 19%;
}

.receivables-table th:nth-child(2),
.receivables-table td:nth-child(2) {
  width: 8%;
  white-space: nowrap;
}

.receivables-table th:nth-child(3),
.receivables-table td:nth-child(3),
.receivables-table th:nth-child(4),
.receivables-table td:nth-child(4) {
  width: 12%;
}

.receivables-table th:nth-child(5),
.receivables-table td:nth-child(5),
.receivables-table th:nth-child(6),
.receivables-table td:nth-child(6) {
  width: 10%;
  white-space: nowrap;
}

.receivables-table th:nth-child(7),
.receivables-table td:nth-child(7) {
  width: 11%;
}

.receivables-table th:nth-child(8),
.receivables-table td:nth-child(8) {
  width: 12%;
}

.receivables-table th:last-child,
.receivables-table td:last-child {
  width: 96px;
}

.receivables-table td strong {
  display: block;
  overflow-wrap: normal;
}

.receivables-table td:first-child strong {
  word-break: normal;
  overflow-wrap: break-word;
}

.receivables-table .row-actions {
  gap: 6px;
}

.receivables-table .row-actions .button-link {
  width: 40px;
  min-width: 40px;
  min-height: 42px;
}

.table-subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.clients-table th,
.clients-table td,
.products-table th,
.products-table td,
.users-table th,
.users-table td {
  border-bottom-color: #e7ebef;
  padding: 14px 10px;
  vertical-align: middle;
}

.clients-table th,
.products-table th,
.users-table th {
  color: #3f6657;
  font-size: 0.78rem;
  font-weight: 800;
}

.clients-table tbody tr:hover,
.products-table tbody tr:hover,
.users-table tbody tr:hover {
  background: #fbfdfc;
}

.search-empty-row td {
  padding: 22px 16px;
  text-align: center;
}

.clients-table td,
.users-table td {
  color: #1b232c;
  font-weight: 500;
}

.clients-table th:first-child,
.clients-table td:first-child {
  width: 6%;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
  width: 24%;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
  width: 10%;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
  width: 9%;
}

.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
  width: 10%;
}

.clients-table th:nth-child(6),
.clients-table td:nth-child(6) {
  width: 7%;
}

.clients-table th:nth-child(7),
.clients-table td:nth-child(7) {
  width: 21%;
  max-width: 21%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-table th:nth-child(8),
.clients-table td:nth-child(8) {
  width: 13%;
  min-width: 154px;
}

.products-table td {
  color: #1b232c;
  font-weight: 500;
}

.low-stock-row {
  background: #fffaf0;
}

.stock-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 8px;
  background: #edf8f1;
  color: #087f49;
  font-weight: 800;
  padding: 0 10px;
}

.stock-pill.low {
  background: #fff2df;
  color: #a15c07;
}

.inline-filter {
  max-width: 280px;
  margin: 0 0 14px;
}

.purchase-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) 46px;
  gap: 10px;
  max-width: none;
}

.sales-filter-trigger,
.purchase-filter-trigger,
.sales-quick-filters,
.purchase-quick-filters,
.sales-mobile-list,
.purchase-mobile-list,
.sales-mobile-fab,
.filter-sheet-backdrop,
.filter-sheet-handle,
.filter-sheet-head {
  display: none;
}

.sales-filter-sheet {
  display: block;
  max-width: none;
}

.purchase-quick-filters {
  display: grid;
}

.sales-filter-sheet .filter-sheet-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto auto;
  gap: 10px;
}

.sales-filter-sheet label {
  display: grid;
  gap: 0;
  color: #68746d;
  font-size: 0;
  line-height: 0;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sales-filter-sheet label select,
.sales-filter-sheet label input {
  min-height: 46px;
  color: #101d2d;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  line-height: normal;
}

.filter-sheet-actions {
  display: contents;
}

.filter-sheet-actions .button-link,
.filter-sheet-actions button {
  min-height: 46px;
}

.cash-filters {
  grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) 46px;
}

.expense-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(118px, 0.8fr) minmax(132px, 0.8fr) minmax(132px, 0.8fr) 46px;
  gap: 10px;
  max-width: none;
}

.expense-report-filters {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(180px, 1fr) 46px;
  gap: 10px;
  max-width: none;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.distribution-header-fields {
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  margin: 16px 0;
}

.distribution-list-head > div {
  min-width: 0;
}

.distribution-list-head > .button-link {
  flex: 0 0 46px;
}

.distribution-list-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.distribution-list-table {
  min-width: 1240px;
  table-layout: fixed;
}

.distribution-list-table th:nth-child(1),
.distribution-list-table td:nth-child(1) {
  width: 9%;
}

.distribution-list-table th:nth-child(2),
.distribution-list-table td:nth-child(2) {
  width: 12%;
}

.distribution-list-table th:nth-child(3),
.distribution-list-table td:nth-child(3) {
  width: 11%;
}

.distribution-list-table th:nth-child(4),
.distribution-list-table td:nth-child(4) {
  width: 11%;
}

.distribution-list-table th:nth-child(5),
.distribution-list-table td:nth-child(5) {
  width: 8%;
}

.distribution-list-table th:nth-child(6),
.distribution-list-table td:nth-child(6) {
  width: 8%;
}

.distribution-list-table th:nth-child(7),
.distribution-list-table td:nth-child(7) {
  width: 25%;
}

.distribution-list-table th:nth-child(8),
.distribution-list-table td:nth-child(8) {
  width: 16%;
}

.distribution-status-link {
  text-decoration: none;
  cursor: pointer;
}

.distribution-list-money {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.distribution-list-money span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.distribution-list-money strong {
  color: var(--ink);
  white-space: nowrap;
}

.distribution-list-money .total {
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
  color: var(--accent-strong);
  font-weight: 900;
}

.distribution-list-money .total strong {
  color: var(--accent-strong);
}

.distribution-list-money .shortage,
.distribution-card-money .shortage,
.distribution-list-money .shortage strong,
.distribution-card-money .shortage strong {
  color: #b42318;
}

.distribution-list-money .surplus,
.distribution-card-money .surplus,
.distribution-list-money .surplus strong,
.distribution-card-money .surplus strong {
  color: #1d4ed8;
}

.distribution-card-status {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.distribution-settlement-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.distribution-card-status .distribution-settlement-note {
  margin-top: 0;
}

.distribution-builder-form {
  gap: 14px;
}

.distribution-summary-panel {
  align-content: start;
}

.distribution-money-input {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.distribution-money-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 154, 93, 0.12);
}

.distribution-money-input span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
}

.distribution-money-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.distribution-money-input input:focus {
  box-shadow: none;
}

.distribution-field-help {
  margin: -4px 0 2px;
  font-size: 0.82rem;
}

.distribution-load-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.distribution-load-totals span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.distribution-load-totals small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.distribution-load-totals strong {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
}

.distribution-product-table input[type="number"],
.distribution-detail-table input[type="number"] {
  width: 112px;
  min-width: 92px;
}

.distribution-product-table th:last-child,
.distribution-product-table td:last-child,
.distribution-detail-table th:not(:first-child),
.distribution-detail-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.distribution-detail-page {
  gap: 18px;
}

.distribution-cash-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.distribution-cash-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.distribution-cash-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.distribution-cash-summary strong {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 900;
}

.distribution-other-payments > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.distribution-payment-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  color: var(--accent-strong);
  box-shadow: none;
}

.distribution-payment-help:hover,
.distribution-payment-help:focus-visible {
  background: #e2f2e8;
  color: var(--accent-strong);
  box-shadow: none;
}

.distribution-payment-help .icon {
  width: 17px;
  height: 17px;
}

.distribution-payment-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: -4px;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 210px;
  max-width: min(280px, 75vw);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #17231d;
  padding: 12px;
  color: #fff;
  text-align: left;
  text-transform: none;
  box-shadow: 0 12px 28px rgb(15 23 42 / 20%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}

.distribution-payment-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 10px;
  width: 9px;
  height: 9px;
  background: #17231d;
  transform: rotate(45deg);
}

.distribution-payment-tooltip > b {
  color: #fff;
  font-size: 0.8rem;
}

.distribution-payment-tooltip > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #dce8e1;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: none;
}

.distribution-payment-tooltip em {
  font-style: normal;
}

.distribution-payment-tooltip strong {
  color: #fff;
  font-size: 0.82rem;
  white-space: nowrap;
}

.distribution-payment-help:hover .distribution-payment-tooltip,
.distribution-payment-help:focus-visible .distribution-payment-tooltip,
.distribution-payment-help:focus .distribution-payment-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.distribution-cash-summary .distribution-cash-total {
  border-color: #b7dfc8;
  background: #edf8f1;
}

.distribution-cash-summary .distribution-cash-total span,
.distribution-cash-summary .distribution-cash-total strong {
  color: var(--accent-strong);
}

.distribution-cash-summary .distribution-cash-shortage {
  border-color: #fecaca;
  background: #fff1f2;
}

.distribution-cash-summary .distribution-cash-shortage span,
.distribution-cash-summary .distribution-cash-shortage strong {
  color: #b42318;
}

.distribution-cash-summary .distribution-cash-surplus {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.distribution-cash-summary .distribution-cash-surplus span,
.distribution-cash-summary .distribution-cash-surplus strong {
  color: #1d4ed8;
}

.distribution-return-money {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
  background: #edf8f1;
  padding: 14px 16px;
}

.distribution-return-money > div {
  display: grid;
  gap: 4px;
}

.distribution-return-money span {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.distribution-return-money strong {
  color: var(--accent-strong);
  font-size: 1.45rem;
}

.distribution-return-money p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: right;
}

.distribution-close-form {
  max-width: 720px;
}

.distribution-close-form [hidden] {
  display: none;
}

.distribution-settlement-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
  background: #edf8f1;
  padding: 12px 14px;
  color: var(--accent-strong);
}

.distribution-settlement-result.is-shortage {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.distribution-settlement-result.is-surplus {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.distribution-settlement-result span,
.distribution-settlement-result strong {
  color: inherit;
  font-weight: 900;
}

.distribution-debt-card {
  display: grid;
  gap: 18px;
}

.distribution-debt-reason {
  margin: 0;
  color: var(--muted);
}

.distribution-debt-payment {
  max-width: 720px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.distribution-payroll-page {
  display: grid;
  gap: 18px;
}

.distribution-payroll-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 0.8fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
}

.distribution-payroll-filter label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.distribution-payroll-filter button {
  min-height: 48px;
}

.payroll-debt-overview,
.payroll-summary-grid,
.payroll-calculation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payroll-debt-overview {
  margin-bottom: 18px;
}

.payroll-debt-overview > span,
.payroll-summary-grid > div,
.payroll-calculation > span {
  display: grid;
  gap: 5px;
  min-height: 76px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px 14px;
}

.payroll-debt-overview small,
.payroll-summary-grid small,
.payroll-calculation small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payroll-debt-overview strong,
.payroll-summary-grid strong,
.payroll-calculation strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.payroll-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.payroll-summary-grid .is-net,
.payroll-calculation .is-net {
  border-color: #b7dfc8;
  background: #edf8f1;
}

.payroll-summary-grid .is-net small,
.payroll-summary-grid .is-net strong,
.payroll-calculation .is-net small,
.payroll-calculation .is-net strong {
  color: var(--accent-strong);
}

.payroll-empty-debts,
.payroll-observation {
  margin: 0;
}

.payroll-observation,
.payroll-applied-debts {
  margin-top: 18px;
}

.payroll-debt-check {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.payroll-debt-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.payroll-origin-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #b7dfc8;
  border-radius: 999px;
  background: #edf8f1;
  color: var(--accent-strong);
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.payroll-origin-badge.is-prior {
  border-color: #d7dce0;
  background: #f5f6f7;
  color: #59636c;
}

.payroll-amount-input {
  display: grid;
  grid-template-columns: auto minmax(88px, 120px);
  align-items: center;
  gap: 6px;
}

.payroll-amount-input span {
  color: var(--muted);
  font-weight: 800;
}

.payroll-amount-input input {
  min-width: 0;
}

.payroll-amount-input input:disabled {
  opacity: 0.55;
}

.distribution-payroll-form {
  display: grid;
  gap: 18px;
}

.payroll-calculation {
  padding-top: 4px;
}

.payroll-calculation.is-invalid .is-net {
  border-color: #fecaca;
  background: #fff1f2;
}

.payroll-calculation.is-invalid .is-net small,
.payroll-calculation.is-invalid .is-net strong {
  color: #b42318;
}

.payroll-history-table .table-subtext {
  display: block;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .distribution-payroll-filter,
  .payroll-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .distribution-payroll-filter button,
  .payroll-summary-grid .is-net {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .distribution-payroll-filter,
  .payroll-debt-overview,
  .payroll-summary-grid,
  .payroll-calculation {
    grid-template-columns: 1fr;
  }

  .distribution-payroll-filter button,
  .payroll-summary-grid .is-net {
    grid-column: auto;
  }

  .payroll-amount-input {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.report-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 16px;
  text-decoration: none;
}

.report-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--surface);
}

.report-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-strong);
}

.report-card strong {
  font-size: 1rem;
}

.report-card span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.sales-product-day-filters {
  display: grid;
  grid-template-columns: minmax(140px, 0.75fr) minmax(140px, 0.75fr) minmax(220px, 1.4fr) 46px;
  gap: 10px;
  max-width: none;
}

.sales-product-day-table th:first-child,
.sales-product-day-table td:first-child {
  width: 120px;
}

.sales-product-day-table th:nth-child(4),
.sales-product-day-table td:nth-child(4),
.sales-product-day-table th:nth-child(5),
.sales-product-day-table td:nth-child(5),
.sales-product-day-table th:last-child,
.sales-product-day-table td:last-child {
  width: 132px;
  text-align: right;
  white-space: nowrap;
}

.sales-product-day-table td strong,
.sales-product-day-table .table-subtext {
  overflow-wrap: anywhere;
}

.zone-profit-report-page {
  gap: 18px;
}

.zone-profit-filters {
  display: grid;
  grid-template-columns: minmax(145px, 0.7fr) minmax(145px, 0.7fr) minmax(230px, 1.4fr) 46px;
  gap: 10px;
  max-width: none;
}

.zone-profit-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.zone-profit-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zone-profit-stats .expense-metric {
  min-width: 0;
}

.zone-profit-stats .metric {
  overflow-wrap: anywhere;
}

.zone-profit-stats .expense-metric > span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.zone-profit-client-toolbar {
  grid-template-columns: minmax(240px, 1fr);
  min-width: min(100%, 380px);
}

.zone-concentration-alert {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
  background: #edf8f1;
  padding: 14px 16px;
}

.zone-concentration-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #d8f0e2;
  color: var(--accent-strong);
}

.zone-concentration-alert small,
.zone-concentration-alert strong,
.zone-concentration-alert p {
  display: block;
}

.zone-concentration-alert small {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.zone-concentration-alert strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 1rem;
}

.zone-concentration-alert p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.zone-concentration-alert.risk-medio {
  border-color: #f4d38a;
  background: #fff9e8;
}

.zone-concentration-alert.risk-medio .zone-concentration-icon {
  background: #ffefbd;
  color: #8a5a00;
}

.zone-concentration-alert.risk-medio small {
  color: #8a5a00;
}

.zone-concentration-alert.risk-alto {
  border-color: #fecaca;
  background: #fff1f2;
}

.zone-concentration-alert.risk-alto .zone-concentration-icon {
  background: #fee2e2;
  color: #b42318;
}

.zone-concentration-alert.risk-alto small {
  color: #b42318;
}

.zone-profit-table,
.client-profit-table {
  min-width: 1120px;
}

.zone-profit-table th:not(:first-child),
.zone-profit-table td:not(:first-child),
.client-profit-table th:nth-child(n + 4),
.client-profit-table td:nth-child(n + 4) {
  text-align: right;
}

.zone-profit-table td:last-child,
.zone-profit-table th:last-child {
  text-align: left;
}

.profit-share {
  display: grid;
  min-width: 112px;
  gap: 5px;
  justify-items: end;
}

.profit-share > span {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8e4;
}

.profit-share i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.dominant-client-row {
  background: #fff7f7;
}

.dominant-client-row .profit-share i {
  background: #dc2626;
}

@media (max-width: 900px) {
  .zone-profit-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .zone-profit-filters,
  .zone-profit-stats {
    grid-template-columns: 1fr;
  }

  .zone-profit-filters button {
    width: 100%;
  }
}

.expenses-table {
  min-width: 0;
  table-layout: fixed;
}

.expenses-table th,
.expenses-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

.expenses-table th:first-child,
.expenses-table td:first-child {
  width: 116px;
}

.expenses-table th:nth-child(2),
.expenses-table td:nth-child(2) {
  width: 150px;
}

.expenses-table th:nth-child(4),
.expenses-table td:nth-child(4) {
  width: 112px;
  text-align: right;
  white-space: nowrap;
}

.expenses-table th:nth-child(5),
.expenses-table td:nth-child(5) {
  width: 132px;
}

.expenses-table th:nth-child(6),
.expenses-table td:nth-child(6) {
  width: 118px;
}

.expenses-table th:last-child,
.expenses-table td:last-child {
  width: 96px;
}

.expenses-table td strong,
.expenses-table .table-subtext {
  overflow-wrap: anywhere;
}

.expense-categories-table th:nth-child(2),
.expense-categories-table td:nth-child(2),
.expense-categories-table th:nth-child(3),
.expense-categories-table td:nth-child(3),
.expense-categories-table th:last-child,
.expense-categories-table td:last-child {
  width: 128px;
}

.expense-stats {
  margin: 14px 0 18px;
}

.expense-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.expense-metric h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.expense-report-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.expense-report-grid h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.detail-grid div,
.stock-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

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

.detail-grid strong {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.detail-grid span {
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
}

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

.client-initials {
  border-style: solid;
  border-color: #dcefe5;
  background: #eaf7ef;
  color: #078047;
  font-size: 1.25rem;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #cbe8d8;
  border-radius: 8px;
  background: #edf8f1;
  color: #087f49;
  font-weight: 700;
  padding: 0 12px;
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.inactive {
  border-color: #f2d5d5;
  background: #fff2f2;
  color: #b42318;
}

.status-pill.status-anulada {
  border-color: #f2d5d5;
  background: #fff2f2;
  color: #b42318;
}

.status-pill.status-anulado {
  border-color: #f2d5d5;
  background: #fff2f2;
  color: #b42318;
}

.status-pill.status-pendiente {
  border-color: #ffe0ad;
  background: #fff7e8;
  color: #a15c07;
}

.status-pill.status-parcial {
  border-color: #cfe0ff;
  background: #edf4ff;
  color: #2453a6;
}

.status-pill.status-pagada {
  border-color: #cbe8d8;
  background: #edf8f1;
  color: #087f49;
}

.purchase-entry-card {
  overflow: hidden;
  border: 1px solid #dce8e1;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(28, 43, 34, 0.1);
  padding: 0;
}

.purchase-entry-heading {
  margin: 0;
  border-bottom: 1px solid #e4ece6;
  background: linear-gradient(180deg, #ffffff, #f7faf8);
  padding: 22px 24px;
}

.purchase-entry-heading h2 {
  color: #101d2d;
  font-size: 1.55rem;
}

.purchase-meta-grid {
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr);
  gap: 14px;
  margin: 0;
  border-bottom: 1px solid #e8efe9;
  background: #fbfdfc;
  padding: 20px 24px;
}

.purchase-meta-grid label,
.purchase-line label {
  gap: 8px;
  color: #3f5d50;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.purchase-meta-grid select,
.purchase-meta-grid input,
.purchase-line select,
.purchase-line input {
  min-height: 46px;
  border-radius: 14px;
  background: #fff;
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.purchase-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 20px 24px 4px;
}

.purchase-lines-head h3 {
  margin: 0;
  color: #101d2d;
  font-size: 1.15rem;
}

.purchase-lines-head p {
  margin: 4px 0 0;
}

.purchase-lines-head .stock-preview {
  min-width: 190px;
  border-color: #cbe8d8;
  background: #edf8f1;
  color: #087f49;
  text-align: right;
}

.purchase-lines {
  display: grid;
  gap: 14px;
  margin-top: 0;
  padding: 14px 24px 18px;
}

.purchase-line {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) 64px repeat(5, minmax(108px, 0.38fr)) minmax(128px, auto) 46px;
  align-items: end;
  gap: 12px;
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(28, 43, 34, 0.07);
  padding: 14px;
}

.purchase-line .product-line-preview {
  align-self: end;
  min-height: 46px;
}

.purchase-line .product-line-preview img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.purchase-line.sale-line {
  grid-template-columns: minmax(220px, 1fr) minmax(96px, 0.28fr) minmax(110px, 0.32fr) minmax(92px, 0.28fr) minmax(116px, auto) 46px;
}

.line-subtotal {
  display: grid;
  min-height: 52px;
  align-content: center;
  border: 1px solid #dce8e1;
  border-radius: 14px;
  background: #f7faf8;
  color: #647067;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 10px;
  text-transform: uppercase;
}

.line-subtotal strong {
  color: #101d2d;
  font-size: 1rem;
}

.line-subtotal em {
  color: var(--muted);
  font-style: normal;
}

.line-subtotal span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.line-subtotal b {
  color: #087f49;
}

.purchase-total-row,
.purchase-save-row {
  margin: 0;
  padding: 0 24px 22px;
}

.purchase-total-row {
  justify-content: flex-start;
}

.purchase-total-row button {
  min-height: 48px;
  border-radius: 14px;
}

.purchase-save-row {
  justify-content: flex-end;
  border-top: 1px solid #e8efe9;
  background: #fbfdfc;
  padding-top: 18px;
}

.purchase-entry-page {
  max-width: 1180px;
  margin-inline: auto;
}

.purchase-entry-card {
  display: grid;
  gap: 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.purchase-meta-panel,
.purchase-products-panel {
  border: 1px solid #dce8e1;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(28, 43, 34, 0.08);
  padding: 24px;
}

.purchase-meta-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr) minmax(180px, 0.55fr);
  align-items: end;
  gap: 24px;
  border: 0;
  background: transparent;
  padding: 0;
}

.purchase-select-label,
.purchase-payment-field,
.purchase-due-date {
  display: grid;
  gap: 10px;
  color: #315f4a;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.purchase-search-select,
.purchase-product-select,
.purchase-picker,
.purchase-product-picker {
  position: relative;
}

.purchase-search-select,
.purchase-product-select {
  display: flex;
  align-items: center;
}

.purchase-search-select svg,
.purchase-product-select svg {
  position: absolute;
  left: 16px;
  z-index: 1;
  color: #66717c;
  pointer-events: none;
}

.purchase-search-select select,
.purchase-product-select select {
  width: 100%;
  min-height: 58px;
  border: 1px solid #d9e3de;
  border-radius: 16px;
  background: #fff;
  color: #1d2923;
  font-size: 1rem;
  font-weight: 800;
  padding-left: 48px;
}

.purchase-payment-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d9e3de;
  border-radius: 14px;
  background: #f8fafc;
}

.purchase-payment-toggle button {
  min-height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #66717c;
  box-shadow: none;
  display: grid;
  place-items: center;
  gap: 4px;
  font-weight: 900;
}

.purchase-payment-toggle button.active {
  background: linear-gradient(135deg, rgba(11, 152, 88, 0.12), rgba(255, 255, 255, 0.92));
  color: #087f49;
  box-shadow: inset 0 0 0 1px #0f9f60;
}

.purchase-payment-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 22px;
  border: 1px solid #e2ebe5;
  border-radius: 14px;
  background: #fbfdfc;
  overflow: hidden;
}

.purchase-payment-summary > div {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}

.purchase-payment-summary > div + div {
  border-left: 1px solid #e2ebe5;
}

.purchase-payment-summary span {
  color: #65746d;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.purchase-payment-summary strong:not(.status-pill) {
  color: #087f49;
  font-size: 1.05rem;
  font-weight: 950;
}

.purchase-picker-results {
  z-index: 35;
}

.purchase-picker-results button span {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-global-product-picker {
  position: relative;
}

.purchase-global-product-picker .sale-search input {
  min-height: 46px;
  font-size: 0.92rem;
}

.purchase-global-product-picker .purchase-picker-results button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.purchase-result-photo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e7f6ed;
  color: #087f49;
  overflow: hidden;
}

.purchase-result-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.purchase-result-photo b {
  font-size: 0.78rem;
  font-weight: 950;
}

.purchase-global-product-picker .purchase-picker-results button > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: none;
}

.purchase-global-product-picker .purchase-picker-results button small {
  color: #65746d;
  font-size: 0.72rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-global-product-picker .purchase-picker-results button em {
  color: #087f49;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.purchase-products-panel {
  padding: 24px;
}

.purchase-lines-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: center;
  padding: 0 0 18px;
}

.purchase-lines-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #315f4a;
  font-size: 0.95rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.purchase-lines-head h3 svg {
  color: #0f9f60;
}

.purchase-lines {
  gap: 22px;
  padding: 0;
}

.purchase-line {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  border: 1px solid #dce8e1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(28, 43, 34, 0.06);
  padding: 18px;
}

.purchase-line-header {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
}

.purchase-line.is-empty {
  display: none;
}

.purchase-line.is-compact {
  gap: 0;
  padding: 16px;
}

.purchase-line.is-compact .purchase-line-header {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.purchase-line:not(.is-compact) .purchase-remove-line,
.purchase-line:not(.is-compact) .purchase-edit-line {
  display: none;
}

.purchase-line.is-compact .purchase-done-line {
  display: none;
}

.purchase-line.is-compact .purchase-editing-title {
  display: none;
}

.purchase-editing-title {
  display: none;
}

.purchase-line.is-compact .purchase-product-picker,
.purchase-line.is-compact .purchase-product-overview,
.purchase-line.is-compact .purchase-line-fields,
.purchase-line.is-compact .line-subtotal {
  display: none;
}

.purchase-compact-summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding-right: 108px;
}

.purchase-compact-summary[hidden] {
  display: none;
}

.purchase-compact-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.purchase-compact-photo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #dce8e1;
  border-radius: 12px;
  background: #e9f5ee;
  color: #087f49;
  overflow: hidden;
  font-weight: 950;
}

.purchase-compact-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.purchase-compact-summary strong {
  color: #101d2d;
  font-size: 1.08rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-compact-summary small {
  color: #65746d;
  font-size: 0.86rem;
  font-weight: 800;
}

.purchase-compact-total {
  display: grid;
  gap: 4px;
  text-align: right;
}

.purchase-compact-total span {
  color: #65746d;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.purchase-compact-total strong {
  color: #087f49;
  font-size: 1.05rem;
}

.purchase-product-overview {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-right: 108px;
}

.purchase-line .product-line-preview {
  display: grid;
  place-items: center;
  width: 92px;
  min-height: 92px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 20%, #ffffff 0, #f8fafc 45%, #e8f1ec 100%);
  border: 1px solid #e2ebe5;
}

.purchase-line .product-line-preview[hidden] {
  display: none;
}

.purchase-line .product-line-preview img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.16));
}

.purchase-line .product-line-preview span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  background: #e1f5e9;
  color: #087f49;
  font-size: 1.3rem;
  font-weight: 950;
}

.purchase-product-summary {
  display: grid;
  gap: 6px;
}

.purchase-brand-pill {
  width: fit-content;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #dcfce7;
  color: #087f49;
  font-size: 0.82rem;
  font-weight: 950;
  padding: 6px 12px;
  text-transform: uppercase;
}

.purchase-product-summary strong {
  color: #101d2d;
  font-size: 1.1rem;
  font-weight: 950;
  line-height: 1.1;
}

.purchase-product-summary small {
  color: #5f728b;
  font-size: 0.86rem;
  font-weight: 750;
}

.purchase-line-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr;
  gap: 12px;
}

.purchase-line-fields label {
  display: grid;
  gap: 9px;
  color: #315f4a;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purchase-line-fields input {
  min-height: 46px;
  border-radius: 14px;
  font-size: 0.92rem;
}

.purchase-remove-line {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff5f5;
  color: #ff2d2d;
  box-shadow: inset 0 0 0 1px #ffc9c9;
}

.purchase-edit-line {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dce8e1;
  border-radius: 12px;
  background: #fff;
  color: #087f49;
  box-shadow: none;
}

.purchase-done-line {
  min-width: 86px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #11864f, #087643);
  color: #fff;
  font-size: 0.96rem;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(8, 127, 73, 0.2);
}

.purchase-edit-line[hidden] {
  display: none;
}

.purchase-done-line[hidden] {
  display: none;
}

.line-subtotal {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 0;
  border-radius: 14px;
  background: #fbfdfc;
  padding: 0;
  overflow: hidden;
}

.line-subtotal > div {
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 12px 14px;
}

.line-subtotal > div + div {
  border-left: 1px solid #e2ebe5;
}

.line-subtotal span {
  margin: 0;
  color: #65746d;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.line-subtotal strong,
.line-subtotal b {
  color: #087f49;
  font-size: 1.18rem;
  font-weight: 950;
}

.line-subtotal small {
  color: #65746d;
  font-size: 0.82rem;
  font-weight: 750;
}

.purchase-total-row {
  display: block;
  padding: 20px 0 0;
}

.purchase-total-row button {
  width: 100%;
  min-height: 54px;
  border-style: dashed;
  border-color: #0f9f60;
  background: #fff;
  color: #087f49;
  font-size: 1rem;
  font-weight: 950;
}

.purchase-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 22px;
  border: 1px solid #e2ebe5;
  border-radius: 14px;
  background: #fbfdfc;
  padding: 18px;
}

.purchase-grand-total {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.purchase-grand-total span {
  color: #101d2d;
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.purchase-grand-total strong {
  color: #087f49;
  font-size: 1.75rem;
  font-weight: 950;
}

.purchase-save-row button {
  min-height: 54px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  font-size: 1rem;
}

.purchase-save-note {
  margin: 10px 0 0;
  color: #78847d;
  font-size: 0.86rem;
}

.credit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.credit-summary span,
.credit-debt-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 12px;
}

.credit-debt-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.credit-debt-link:hover {
  background: var(--surface);
}

.credit-debt-link.debt-warning {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.credit-debt-link.debt-warning:hover {
  background: #fee2e2;
}

.credit-summary strong {
  color: var(--ink);
}

.sale-general-discount {
  max-width: 220px;
}

.sale-builder-page {
  display: block;
}

.sale-builder-form {
  display: grid;
  gap: 18px;
}

.sale-builder-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sale-builder-heading h2 {
  margin: 0;
  color: #101d2d;
  font-size: 1.9rem;
}

.sale-builder-heading.compact-heading {
  justify-content: flex-end;
}

.sale-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid #e3e8ee;
  border-radius: 14px;
  background: #fff;
}

.sale-product-panel,
.sale-summary-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 28px;
}

.sale-summary-panel {
  border-left: 1px solid #e6ebf1;
  background: #f8fafc;
}

.sale-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sale-step-title .icon {
  color: #2563eb;
}

.sale-search {
  position: relative;
  display: block;
}

.sale-search .icon {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 22px;
  height: 22px;
  color: #94a3b8;
  transform: translateY(-50%);
}

.sale-search input {
  min-height: 60px;
  border-radius: 14px;
  padding-left: 52px;
  font-size: 1rem;
}

.sale-search.compact input {
  min-height: 50px;
}

.sale-client-picker {
  position: relative;
  display: grid;
  gap: 10px;
}

.sale-client-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 8px;
  align-items: stretch;
}

.sale-client-search-row .sale-search {
  min-width: 0;
}

.sale-client-search-row .button-link {
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  padding: 0;
}

.sale-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sale-client-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 20;
  display: grid;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #dfe7f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.sale-client-results button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  padding: 10px 14px;
  background: #fff;
  color: #101d2d;
  text-align: left;
}

.sale-client-results button:hover,
.sale-client-results button:focus-visible {
  background: #f0fdf4;
  color: #087f49;
}

.sale-client-results button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-client-results button span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 800;
}

.sale-client-empty {
  margin: 0;
  padding: 14px;
  text-align: center;
}

.sale-selected-client {
  border: 1px solid #cbe8d8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #edf8f1;
  color: #087f49;
  font-weight: 900;
}

.sale-client-rewards {
  display: grid;
  gap: 8px;
  border: 1px solid #e8cf8b;
  border-radius: 8px;
  padding: 12px;
  background: #fff9e8;
}

.sale-client-rewards[hidden],
.sale-client-reward[hidden] {
  display: none;
}

.sale-client-rewards-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #785500;
}

.sale-client-rewards-head svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.sale-client-rewards-head div,
.sale-client-reward span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sale-client-rewards-head span,
.sale-client-reward small {
  color: #6c6758;
  font-size: 0.78rem;
}

.sale-client-reward {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-top: 1px solid rgba(120, 85, 0, 0.16);
  padding-top: 8px;
  cursor: pointer;
}

.sale-client-reward input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #087f49;
}

.distribution-reward-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.distribution-reward-actions form {
  margin: 0;
}

.sale-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.sale-product-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px 14px;
  padding: 16px;
  border: 1px solid #dfe7f0;
  border-radius: 14px;
  background: #fbfdff;
}

.sale-product-card.selected {
  border-color: rgba(15, 154, 93, 0.65);
  box-shadow: 0 14px 32px rgba(15, 154, 93, 0.13);
}

.sale-product-photo {
  grid-row: span 2;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 16px;
  background: #fef3c7;
  color: #0f7a49;
  font-weight: 900;
  object-fit: cover;
}

.sale-product-info {
  min-width: 0;
}

.sale-product-info span {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sale-product-info strong {
  display: block;
  color: #0f172a;
  font-size: 1.08rem;
  line-height: 1.25;
}

.sale-product-info p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.sale-product-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e6edf4;
  padding-top: 12px;
  color: #94a3b8;
  font-weight: 800;
}

.sale-product-meta strong {
  color: #0f9a5d;
}

.sale-product-meta .sale-product-points {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a5a00;
  white-space: nowrap;
}

.sale-product-points .icon,
.sale-points-earned .icon {
  width: 17px;
  height: 17px;
}

.sale-product-add {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 48px minmax(60px, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.sale-product-add input {
  min-height: 48px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 900;
}

.sale-summary-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dfe7f0;
  border-radius: 14px;
  background: #fff;
}

.sale-credit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 1px solid #d8eadf;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(135deg, #f7fbf8, #edf8f1);
}

.sale-credit-summary span,
.sale-credit-summary .credit-debt-link {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(8, 127, 73, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #647067;
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.15;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sale-credit-summary .credit-debt-link {
  text-decoration: none;
}

.sale-credit-summary strong {
  display: block;
  color: #102018;
  font-size: 1.05rem;
  line-height: 1.1;
}

.sale-credit-summary .credit-debt-link.debt-warning {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.sale-credit-summary .credit-debt-link.debt-warning strong,
.sale-credit-summary .danger-text {
  color: #e11d48;
}

.sale-due-date {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.sale-due-date.hidden {
  display: none;
}

.sale-flow-message {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  border-radius: 12px;
  background: #fff7e8;
  color: #a15c07;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.sale-flow-message[hidden] {
  display: none;
}

.sale-cart-list {
  display: grid;
  gap: 10px;
}

.sale-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  padding: 8px 0;
}

.sale-cart-item strong,
.sale-cart-item span {
  display: block;
}

.sale-cart-item span {
  color: #64748b;
  font-size: 0.88rem;
}

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

.sale-payment-toggle button {
  min-height: 56px;
  border: 2px solid #dfe7f0;
  background: #fff;
  color: #334155;
}

.sale-payment-toggle button.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.sale-initial-payment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d8eadf;
  border-radius: 14px;
  background: #f7fbf8;
}

.sale-initial-payment.hidden {
  display: none;
}

.sale-initial-payment label {
  display: grid;
  gap: 6px;
  color: #647067;
  font-size: 0.82rem;
  font-weight: 800;
}

.sale-initial-payment input,
.sale-initial-payment select {
  min-height: 46px;
}

.sale-initial-payment p {
  grid-column: 1 / -1;
  margin: 0;
  color: #647067;
  font-weight: 800;
}

.sale-initial-payment strong {
  color: var(--accent);
}

.sale-payment-methods {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8eadf;
  border-radius: 8px;
  background: #f7fbf8;
}

.sale-payment-methods.hidden {
  display: none;
}

.sale-payment-methods-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
}

.sale-payment-methods-head .icon-only {
  width: 38px;
  min-width: 38px;
  height: 38px;
}

.sale-payment-rows {
  display: grid;
  gap: 8px;
}

.sale-payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.75fr) 42px;
  gap: 8px;
  align-items: end;
}

.sale-payment-row label {
  display: grid;
  gap: 5px;
  color: #647067;
  font-size: 0.78rem;
  font-weight: 800;
}

.sale-payment-row select,
.sale-payment-row input {
  min-height: 44px;
}

.sale-payment-row > .icon-only {
  width: 42px;
  min-width: 42px;
  height: 44px;
}

.sale-payment-row > button.secondary.danger {
  border-color: var(--danger);
  color: #fff;
}

.sale-payment-methods > p {
  margin: 0;
  color: #647067;
  font-weight: 800;
}

.sale-payment-methods > p strong {
  color: var(--accent);
}

.distribution-detail-page .distribution-route-clients {
  padding: 0;
  overflow: hidden;
}

.distribution-route-clients > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
}

.distribution-route-clients > summary::-webkit-details-marker {
  display: none;
}

.distribution-route-clients-copy {
  display: grid;
  gap: 5px;
}

.distribution-route-clients-copy strong {
  color: #101d2d;
  font-size: 1.35rem;
}

.distribution-route-clients-copy small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.distribution-route-clients-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.distribution-route-clients-toggle .icon {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.distribution-route-clients[open] > summary {
  border-bottom: 1px solid var(--line);
}

.distribution-route-clients[open] .distribution-route-clients-toggle .icon {
  transform: rotate(180deg);
}

.distribution-route-clients-content {
  padding: 0 24px 20px;
}

@media (max-width: 600px) {
  .distribution-route-clients > summary {
    align-items: flex-start;
    padding: 16px;
  }

  .distribution-route-clients-copy strong {
    font-size: 1.15rem;
  }

  .distribution-route-clients-toggle {
    font-size: 0.78rem;
  }

  .distribution-route-clients-content {
    padding: 0 16px 16px;
  }
}

.sale-change-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 0.8fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dfe7f0;
  border-radius: 14px;
  background: #f8fafc;
}

.sale-change-calculator.hidden {
  display: none;
}

.sale-change-calculator label {
  display: grid;
  gap: 6px;
  color: #647067;
  font-size: 0.82rem;
  font-weight: 800;
}

.sale-change-calculator input {
  min-height: 46px;
}

.sale-change-calculator div {
  display: grid;
  gap: 4px;
  min-height: 46px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid #d8eadf;
  border-radius: 12px;
  background: #fff;
}

.sale-change-calculator span {
  color: #647067;
  font-size: 0.76rem;
  font-weight: 800;
}

.sale-change-calculator strong {
  color: #0f8a51;
  font-size: 1rem;
}

.sale-checkout-sheet {
  display: grid;
  gap: 14px;
}

.sale-sheet-handle {
  display: none;
}

.sale-checkout-head {
  display: none;
}

.sale-checkout-backdrop,
.sale-quick-cart {
  display: none;
}

.sale-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  border-top: 1px solid #dfe7f0;
  padding-top: 20px;
  color: #64748b;
  font-weight: 900;
  text-transform: uppercase;
}

.sale-total-bar strong {
  color: #0f172a;
  font-size: 2rem;
  text-transform: none;
}

.sale-total-bar small,
.sale-confirm-total small {
  color: #8a5a00;
  font-size: 0.82rem;
  text-transform: none;
}

.sale-points-earned {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8a5a00;
  font-weight: 800;
}

.product-points-config {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dce5df;
  border-radius: 8px;
  background: #f7faf7;
}

.product-points-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  color: #8a5a00;
  font-size: 0.82rem;
  font-weight: 800;
}

.product-points-badge .icon {
  width: 16px;
  height: 16px;
}

.product-points-head,
.product-points-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.product-points-head {
  justify-content: space-between;
}

.product-points-head > div,
.product-points-preview,
.product-points-result {
  display: grid;
  gap: 3px;
}

.product-points-head span,
.product-points-preview span,
.product-points-result span {
  color: #64748b;
  font-size: 0.82rem;
}

.product-points-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.product-points-toggle input {
  width: 20px;
  min-height: 20px;
}

.product-points-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.product-points-use-suggested {
  align-self: end;
  min-height: 44px;
}

.client-points-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.client-points-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #d8e5dc;
  border-radius: 8px;
  background: #f5f9f5;
}

.client-points-summary span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.client-points-summary strong {
  color: #16221b;
  font-size: 1.1rem;
}

.client-points-main {
  grid-template-columns: auto 1fr;
  align-items: center;
  background: #fff7db !important;
  border-color: #ead594 !important;
}

.client-points-main .icon {
  grid-row: span 2;
  color: #8a5a00;
}

.client-points-main strong {
  color: #8a5a00;
}

.client-points-history {
  margin-top: 22px;
  border-top: 1px solid #dfe7e2;
  padding-top: 20px;
}

.client-points-history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.client-points-history-head h3,
.client-points-history-head p {
  margin: 0;
}

.client-points-history-head p {
  margin-top: 4px;
  color: #64748b;
}

.client-points-history-head > strong,
.points-value.positive {
  color: #087443;
}

.points-value.negative {
  color: #b42318;
}

@media (max-width: 1100px) {
  .product-points-body {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 700px) {
  .product-points-head,
  .client-points-history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-points-body,
  .client-points-summary {
    grid-template-columns: 1fr;
  }
}

.rewards-page {
  gap: 20px;
}

.rewards-head {
  align-items: flex-start;
}

.reward-confirmation-count {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: #fff4cf;
  color: #785500;
  font-weight: 900;
}

.reward-confirmation-list {
  display: grid;
  gap: 10px;
}

.reward-confirmation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: center;
  border: 1px solid #e8cf8b;
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}

.reward-confirmation-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.reward-confirmation-copy > span,
.reward-confirmation-copy small {
  color: #6c6758;
  font-size: 0.78rem;
  font-weight: 700;
}

.reward-confirmation-copy p {
  margin: 0;
  color: #39423c;
}

.reward-confirmation-actions {
  display: grid;
  gap: 8px;
}

.reward-confirmation-actions form,
.reward-rejection-form {
  margin: 0;
}

.reward-confirmation-actions > form:first-child button {
  width: 100%;
}

.reward-rejection-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 8px;
}

.reward-rejection-form input {
  min-width: 0;
  min-height: 44px;
}

.reward-rejection-form.compact {
  min-width: 320px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.reward-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px 0;
}

.reward-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid #dce5df;
  border-radius: 8px;
  background: #fff;
}

.reward-card.is-unavailable {
  background: #f7f8f7;
}

.reward-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fff4cf;
  color: #8a5a00;
}

.reward-card-copy {
  min-width: 0;
}

.reward-card-copy > span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-card-copy h3,
.reward-card-copy p {
  margin: 0;
}

.reward-card-copy h3 {
  margin-top: 3px;
  color: #15231a;
  font-size: 1rem;
}

.reward-card-copy p {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.84rem;
}

.reward-card-points {
  display: grid;
  justify-items: end;
  color: #8a5a00;
}

.reward-card-points strong {
  font-size: 1.15rem;
}

.reward-card-points span {
  font-size: 0.72rem;
  font-weight: 800;
}

.reward-card-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px;
  margin: 0;
}

.reward-card-meta > div {
  padding: 9px;
  border-radius: 6px;
  background: #f4f7f4;
}

.reward-card-meta dt {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reward-card-meta dd {
  margin: 3px 0 0;
  color: #15231a;
  font-size: 0.82rem;
  font-weight: 700;
}

.reward-card-state {
  grid-column: 1 / 3;
  align-self: center;
}

.reward-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.reward-card-actions form,
.rewards-history-table form {
  margin: 0;
}

.reward-history-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
}

.distribution-pending-rewards {
  display: grid;
  gap: 8px;
}

.distribution-pending-reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #dce5df;
  border-radius: 6px;
  background: #f8faf8;
}

.distribution-pending-reward span {
  display: grid;
  min-width: 0;
}

.distribution-pending-reward small {
  color: #64748b;
}

.status-pill.requested {
  border-color: #f2d58a;
  background: #fff8df;
  color: #8a5a00;
}

.status-pill.requested span {
  background: #c68400;
}

.status-pill.reserved {
  border-color: #bdd6ee;
  background: #eef7ff;
  color: #245d8f;
}

.status-pill.reserved span {
  background: #2f78b7;
}

.reward-form {
  max-width: 1100px;
}

.reward-form [hidden] {
  display: none !important;
}

.redemption-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8e5dc;
  border-radius: 8px;
  background: #f5f9f5;
}

.redemption-preview > div {
  display: grid;
  gap: 4px;
}

.redemption-preview span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.redemption-preview strong {
  color: #15231a;
}

@media (max-width: 1180px) {
  .reward-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .reward-confirmation-item {
    grid-template-columns: 1fr;
  }

  .redemption-preview {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 700px) {
  .reward-grid,
  .redemption-preview {
    grid-template-columns: 1fr;
  }

  .reward-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .reward-card-points {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .reward-card-meta {
    grid-template-columns: 1fr;
  }

  .reward-card-state {
    grid-column: 1 / 2;
  }

  .reward-confirmation-item,
  .reward-rejection-form,
  .reward-rejection-form.compact {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}

.reward-accounting-filters {
  display: grid;
  grid-template-columns: minmax(140px, 0.75fr) minmax(140px, 0.75fr) minmax(220px, 1.2fr) 46px;
  gap: 10px;
  max-width: none;
}

.reward-pending-accounting-note {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid #e8cf8b;
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}

.reward-pending-accounting-note div {
  display: grid;
  gap: 3px;
}

.reward-pending-accounting-note span,
.reward-pending-accounting-note p {
  color: #6c6758;
  font-size: 0.82rem;
}

.reward-pending-accounting-note strong {
  color: #785500;
  font-size: 1.35rem;
}

.reward-pending-accounting-note p {
  margin: 0;
}

@media (max-width: 760px) {
  .reward-accounting-filters,
  .reward-pending-accounting-note {
    grid-template-columns: 1fr;
  }

  .reward-accounting-filters button {
    width: 100%;
  }
}

.sale-review-button {
  min-height: 64px;
  border-radius: 14px;
  background: #0f9a5d;
  font-size: 1.05rem;
}

.sale-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.sale-confirm-modal {
  width: min(720px, 100%);
  padding: 28px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
}

.sale-confirm-head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.sale-confirm-head > span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
}

.sale-confirm-head h2 {
  margin: 0;
}

.sale-confirm-head p {
  margin: 4px 0 0;
  color: #64748b;
}

.sale-confirm-box {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #dfe7f0;
  border-radius: 16px;
  background: #f8fafc;
}

.sale-confirm-box > div,
.sale-confirm-item,
.sale-confirm-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e6edf4;
  padding-bottom: 10px;
}

.sale-confirm-box h3 {
  color: #94a3b8;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sale-confirm-rewards {
  display: grid;
  gap: 8px;
  border: 1px solid #e8cf8b;
  border-radius: 8px;
  padding: 12px;
  background: #fff9e8;
}

.sale-confirm-rewards[hidden] {
  display: none;
}

.sale-confirm-rewards h3,
.sale-confirm-rewards p {
  margin: 0;
}

.sale-confirm-rewards p {
  color: #785500;
  font-size: 0.78rem;
  font-weight: 700;
}

.sale-confirm-reward-item {
  display: grid;
  gap: 2px;
  border-top: 1px solid rgba(120, 85, 0, 0.16);
  padding-top: 8px;
}

.sale-confirm-reward-item span {
  color: #5f5a4e;
  font-size: 0.86rem;
}

.sale-confirm-total {
  border-bottom: 0;
  align-items: center;
}

.sale-confirm-total strong {
  color: #2563eb;
  font-size: 1.6rem;
}

.sale-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sale-empty-products {
  padding: 18px;
  border: 1px dashed #dbe4ee;
  border-radius: 14px;
  text-align: center;
}

.sale-product-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.9rem;
  text-align: center;
}

.sale-product-hint[hidden] {
  display: none;
}

.sale-load-more-products {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: center;
  border: 1px solid #dce8e1;
  border-radius: 999px;
  background: #fff;
  color: #087f49;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(28, 43, 34, 0.08);
}

.sale-load-more-products[hidden] {
  display: none;
}

.sale-load-more-products .icon {
  width: 18px;
  height: 18px;
}

.sale-hidden-lines {
  display: none;
}

.compact-check {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.compact-check input {
  width: auto;
}

.purchase-total-row {
  justify-content: space-between;
}

.nested-table-card {
  box-shadow: none;
}

.sale-mobile-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid #dce3da;
  overflow: hidden;
}

.sale-mobile-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
  min-width: 0;
}

.sale-mobile-number {
  color: #101d2d;
  font-size: 1.08rem;
  font-weight: 900;
}

.sale-mobile-info {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

.sale-mobile-info h3 {
  margin: 0;
  color: #1f2a24;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.25;
}

.sale-mobile-info p {
  margin: 8px 0 0;
  color: #68746d;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-mobile-info p span {
  margin: 0 6px;
}

.sale-mobile-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 12px;
}

.sale-mobile-total {
  color: #101d2d;
  font-size: 1.1rem;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.sale-mobile-balance {
  color: #1f2a24;
  font-size: 0.9rem;
}

.sale-mobile-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
  align-content: start;
}

.sale-mobile-actions .button-link,
.sale-mobile-actions button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-height: 52px;
  border-radius: 12px;
  padding: 0;
  color: #0f2b22;
}

  .sales-mobile-footer {
    flex-wrap: wrap;
    display: flex;
    justify-content: space-between;
    gap: 14px;
  padding: 18px 0 0;
  color: #68746d;
  font-size: 0.88rem;
}

.sales-mobile-footer strong {
  color: #087f49;
}

.sales-empty-state {
  margin: 0;
  padding: 18px 0;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.row-actions form {
  margin: 0;
}

.row-actions .button-link,
.row-actions button {
  width: 44px;
  min-width: 44px;
  min-height: 48px;
  border-radius: 8px;
  padding: 0;
}

.row-actions .edit-action {
  border-color: #dfe8e2;
  color: #087f49;
}

.row-actions .icon-button {
  width: 48px;
  min-width: 48px;
  padding: 0;
  border: 1px solid #ffc9c9;
  background: #fff;
  color: #f02d2d;
}

.row-actions .icon-button:hover {
  background: #fff1f1;
}

.clients-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  color: #4f5964;
}

.pagination-lite {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pagination-lite > span,
.pagination-lite strong,
.pagination-lite button,
.pagination-lite .button-link {
  min-height: 46px;
  border-radius: 8px;
}

.pagination-lite > span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dfe4e8;
  padding: 0 18px;
}

.pagination-lite strong {
  display: inline-grid;
  width: 42px;
  place-items: center;
  background: #09824a;
  color: white;
}

.pagination-lite button {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.pagination-lite .button-link,
.pagination-disabled {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  place-items: center;
}

.pagination-disabled {
  border: 1px solid #e4e9e6;
  color: #9aa4a0;
}

.clients-table img.client-photo,
.client-photo {
  display: block;
  width: 54px;
  max-width: 54px;
  height: 54px;
  max-height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.photo-placeholder {
  display: inline-grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.product-photo-thumb,
.product-line-preview img,
.product-photo-current img,
.product-detail-photo {
  display: block;
  border: 1px solid #e3ebe5;
  background: #f5f8f6;
  object-fit: cover;
}

.product-photo-thumb,
.product-line-preview img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
}

.product-line-preview {
  align-self: end;
  display: grid;
  place-items: center;
  min-height: 54px;
}

.product-photo-current {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-photo-current img {
  width: 96px;
  height: 96px;
  border-radius: 18px;
}

.product-detail-photo {
  width: 180px;
  height: 180px;
  margin-bottom: 18px;
  border-radius: 22px;
}

.photo-picker {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.photo-preview {
  display: grid;
  width: 150px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  overflow: hidden;
  text-align: center;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-picker-content {
  display: grid;
  align-content: center;
  gap: 8px;
}

.photo-picker-content strong {
  font-size: 1rem;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.file-action {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  width: auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  padding: 0 16px;
}

.file-action.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.map-picker {
  display: grid;
  gap: 12px;
}

.map-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-picker-header div {
  display: grid;
  gap: 4px;
}

.map-picker-header span,
.map-empty,
.map-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.map-status {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(28, 43, 34, 0.16);
}

.map-shell {
  position: relative;
}

.client-map,
.map-empty {
  width: 100%;
  height: 460px;
  min-height: 360px;
  max-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.client-map > div {
  height: 100% !important;
  max-height: inherit !important;
}

.client-map-view {
  width: 100%;
  height: 360px;
  min-height: 360px;
  border: 0;
  border-radius: 0;
}

.map-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.map-actions {
  position: absolute;
  top: 12px;
  right: auto;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.map-control {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(28, 43, 34, 0.18);
}

.map-control:hover,
.map-control.active {
  background: var(--accent);
  color: white;
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sale-builder-heading {
    align-items: center;
    padding: 0 2px;
  }

  .sale-builder-page {
    padding-bottom: 92px;
  }

  .sale-builder-heading h2 {
    font-size: 1.45rem;
  }

  .sale-builder-heading p {
    display: none;
  }

  .sale-builder-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .sale-product-panel,
  .sale-summary-panel {
    padding: 16px 0;
  }

  .sale-summary-panel {
    display: contents;
    border-left: 0;
    background: transparent;
  }

  .sale-summary-panel .sale-summary-card:nth-of-type(1) {
    order: 1;
  }

  .sale-product-panel {
    order: 2;
  }

  .sale-summary-panel .sale-summary-card:nth-of-type(2) {
    order: 3;
  }

  .sale-summary-panel .sale-summary-card:nth-of-type(3) {
    order: 4;
  }

  .sale-total-bar {
    order: 5;
  }

  .sale-review-button {
    order: 6;
  }

  .sale-product-grid {
    grid-template-columns: 1fr;
  }

  .sale-product-card {
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 14px;
  }

  .sale-product-photo {
    width: 68px;
    height: 68px;
  }

  .sale-product-info strong {
    font-size: 1rem;
  }

  .sale-credit-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sale-total-bar {
    position: sticky;
    bottom: 86px;
    z-index: 4;
    margin: 0 -16px;
    padding: 12px 16px;
    background: #f8fafc;
  }

  .sale-review-button {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    box-shadow: 0 16px 28px rgba(15, 154, 93, 0.22);
  }

  .sale-checkout-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    max-height: 78vh;
    overflow-y: auto;
    padding: 8px 14px 16px;
    border-radius: 26px 26px 0 0;
    background: #fff;
    box-shadow: 0 -24px 64px rgba(15, 23, 42, 0.28);
    transform: translateY(calc(100% + 18px));
    transition: transform 180ms ease;
  }

  .sale-builder-form.checkout-open .sale-checkout-sheet {
    transform: translateY(0);
  }

  .sale-sheet-handle {
    display: block;
    width: 44px;
    height: 5px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .sale-checkout-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .sale-checkout-head strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-size: 1rem;
  }

  .sale-checkout-backdrop {
    position: fixed;
    inset: 0;
    z-index: 69;
    display: block;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sale-builder-form.checkout-open .sale-checkout-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sale-checkout-sheet .sale-total-bar,
  .sale-checkout-sheet .sale-review-button {
    position: static;
    margin: 0;
  }

  .sale-checkout-sheet .sale-total-bar {
    border-top: 0;
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #94a3b8;
  }

  .sale-checkout-sheet .sale-total-bar strong {
    color: #fff;
  }

  .sale-quick-cart {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.28);
  }

  .sale-builder-form.checkout-open .sale-quick-cart {
    opacity: 0;
    pointer-events: none;
  }

  .sale-quick-cart span {
    display: block;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .sale-quick-cart strong {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: 1.28rem;
    line-height: 1;
  }

  .sale-quick-cart button {
    min-height: 44px;
    border-radius: 15px;
    background: #10b981;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.28);
    font-weight: 1000;
  }

  .sale-quick-cart.is-empty {
    opacity: 0.78;
  }

  .sale-confirm-modal {
    max-height: calc(100vh - 32px);
    overflow: auto;
  }

  .product-visual-card {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 18px;
  }

  .product-visual-actions {
    grid-column: 1 / -1;
  }

  .product-visual-actions .row-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  .product-visual-actions .row-actions form,
  .product-visual-actions .row-actions button,
  .product-visual-actions .row-actions .button-link {
    width: 100%;
  }

  .login-brand {
    min-height: 42vh;
    padding: 32px;
  }

  .auth-login {
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 50% 45%, #ffffff 0 34%, transparent 35%),
      linear-gradient(180deg, #018c4f 0 47%, #f6f7f4 47% 100%);
  }

  .auth-login::after {
    display: none;
  }

  .auth-hero {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: flex-start;
    padding: 28px 36px 76px;
    background:
      linear-gradient(90deg, rgba(0, 79, 48, 0.94), rgba(0, 110, 64, 0.72)),
      url("assets/login-pos-bg.png");
    background-position: center top;
    clip-path: none;
  }

  .auth-hero::before {
    background:
      radial-gradient(ellipse at 50% 118%, #10a864 0 34%, transparent 35%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 55, 36, 0.24));
  }

  .auth-hero::after {
    right: -9%;
    bottom: -12%;
    width: 118%;
    height: 34%;
    border-radius: 50% 50% 0 0;
    background: rgba(1, 159, 87, 0.78);
    transform: rotate(-6deg);
  }

  .auth-brand-mark {
    margin: 0 auto;
    padding: 14px 24px 14px 16px;
    font-size: 1.65rem;
  }

  .auth-brand-mark .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
  }

  .auth-brand-mark .icon {
    width: 25px;
    height: 25px;
  }

  .auth-copy {
    display: none;
  }

  .auth-copy h1 {
    gap: 8px;
    font-size: 2.82rem;
    line-height: 1.06;
  }

  .auth-copy .desktop-title {
    display: none;
  }

  .auth-copy .mobile-title {
    display: block;
  }

  .auth-copy .mobile-title-soft {
    color: rgba(255, 255, 255, 0.68);
    font-weight: 500;
  }

  .auth-copy p {
    display: none;
  }

  .auth-panel {
    display: grid;
    align-content: start;
    margin-top: -62px;
    padding: 0 48px 24px;
  }

  .auth-panel .login-card {
    max-width: none;
    padding: 42px 62px 46px;
    border-radius: 32px;
    box-shadow: 0 24px 60px rgba(22, 31, 37, 0.16);
  }

  .login-footer {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-top: 16px;
    color: #66717f;
    font-size: 1.22rem;
  }

  .login-footer span {
    width: 48px;
    height: 48px;
  }

  .login-footer .icon {
    width: 25px;
    height: 25px;
  }

  .login-footer p {
    margin: 0;
  }

  .login-panel,
  .main {
    padding: 24px;
  }

  .auth-panel.login-panel {
    padding: 0 48px 24px;
  }

  body.menu-open {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    width: min(86vw, 320px);
    overflow-y: auto;
    padding: 18px;
    border-right: 0;
    box-shadow: 18px 0 42px rgba(0, 0, 0, 0.28);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-toggle {
    display: inline-flex;
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .sidebar-close {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
  }

  .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.14);
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    width: 100%;
    min-height: 100vh;
    padding: 0;
    border-radius: 0;
    background: rgba(15, 23, 18, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .menu-open .menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-open .sale-quick-cart,
  .menu-open .sale-checkout-sheet,
  .menu-open .sale-checkout-backdrop,
  .menu-open .sales-mobile-fab,
  .menu-open .inventory-mobile-fab,
  .menu-open .purchase-save-row,
  .menu-open .purchase-picker-results {
    display: none !important;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    margin: -4px -4px 18px;
    padding: 6px 2px 14px;
    border-bottom: 1px solid rgba(31, 42, 36, 0.08);
  }

  .page-title {
    flex: 1 1 auto;
  }

  .page-title h1 {
    font-size: 1.35rem;
    line-height: 1.05;
  }

  .mobile-app-name {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
  }

  .user-menu {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .user-menu-trigger {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    justify-content: center;
    padding: 0;
    border: 0;
  }

  .user-menu-trigger:hover,
  .user-menu.open .user-menu-trigger {
    border-color: transparent;
    background: transparent;
  }

  .user-menu-name,
  .user-menu-trigger > .icon {
    display: none;
  }

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

  .dashboard-filter-card {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filter {
    width: 100%;
  }

  .quick-actions {
    justify-content: flex-start;
  }

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

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

  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .dashboard-performance-grid {
    grid-template-columns: 1fr;
  }

  .capital-composition-grid,
  .capital-total-row,
  .inventory-capital-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capital-composition-grid > div:nth-child(3),
  .capital-total-row > div:nth-child(3),
  .inventory-capital-summary > div:nth-child(3) {
    border-left: 0;
  }

  .capital-composition-grid > div:nth-child(n + 3),
  .capital-total-row > div:nth-child(n + 3),
  .inventory-capital-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .clients-toolbar {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .clients-toolbar .client-search {
    min-width: 160px;
  }

  .toolbar {
    display: grid;
  }

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

  .map-picker-header {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading .button-link {
    width: 100%;
  }

  .form-actions {
    display: grid;
  }

  .client-map {
    height: 460px !important;
    min-height: 420px !important;
    max-height: 560px !important;
  }

  .client-hero {
    grid-template-columns: 1fr;
  }

  .client-photo-panel img,
  .client-photo-placeholder {
    height: 320px;
  }
}

@media (max-width: 900px) {
  .clients-card {
    padding: 16px;
    border-radius: 22px;
  }

  .clients-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    margin-bottom: 16px;
  }

  .distribution-list-head {
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
  }

  .distribution-list-head > .button-link {
    width: 48px;
    min-width: 48px;
    justify-self: end;
  }

  .distribution-cash-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .distribution-return-money {
    align-items: flex-start;
    flex-direction: column;
  }

  .distribution-return-money p {
    text-align: left;
  }

  .clients-toolbar,
  .client-search {
    width: 100%;
  }

  .clients-page .clients-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    gap: 10px;
  }

  .clients-page .clients-toolbar .client-search-form,
  .clients-page .clients-toolbar .client-search {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .clients-page .client-search input {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    border-radius: 14px;
  }

  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) {
    width: 100%;
    grid-template-columns: repeat(4, 56px) minmax(0, 1fr);
    justify-content: start;
    justify-self: stretch;
    gap: 8px;
  }

  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) .client-search-form,
  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) .client-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) .button-link,
  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) button.button-link {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 14px;
  }

  .clients-page .clients-toolbar.category-toolbar {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) 56px 56px;
    align-items: center;
    overflow: visible;
  }

  .clients-page .clients-toolbar.category-toolbar .client-search-form,
  .clients-page .clients-toolbar.category-toolbar .client-search {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .clients-page .clients-toolbar.category-toolbar .button-link,
  .clients-page .clients-toolbar.category-toolbar button.button-link {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 14px;
  }

  .clients-page .clients-toolbar.inventory-toolbar {
    width: 100%;
    grid-template-columns: repeat(6, 56px) minmax(0, 1fr);
    justify-content: start;
    justify-self: stretch;
    gap: 8px;
  }

  .clients-page .clients-toolbar.inventory-toolbar .client-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .clients-page .clients-toolbar.inventory-toolbar .button-link,
  .clients-page .clients-toolbar.inventory-toolbar button.button-link {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 14px;
  }

  .clients-page .sales-toolbar {
    grid-template-columns: minmax(0, 1fr) 56px;
  }

  .clients-page .sales-toolbar .client-search {
    grid-column: auto;
  }

  .sales-toolbar > .button-link,
  .sales-toolbar > a.button-link {
    display: none;
  }

  .sales-toolbar > a[href*="receivables"] {
    display: none !important;
  }

  .sales-toolbar .sales-filter-trigger,
  .sales-toolbar .purchase-filter-trigger {
    display: grid;
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 14px;
  }

  .sales-quick-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 100%;
    gap: 10px;
    margin: 6px 0 16px;
    overflow: hidden;
    scrollbar-width: none;
  }

  .sales-quick-filters::-webkit-scrollbar {
    display: none;
  }

  .sales-chip {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 6px;
    border: 1px solid #dce8e1;
    border-radius: 14px;
    background: #fff;
    color: #087f49;
    font-size: 0.86rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
  }

  .sales-chip.active {
    border-color: transparent;
    background: linear-gradient(135deg, #0b9858, #087643);
    color: #fff;
    box-shadow: 0 12px 24px rgba(0, 137, 79, 0.18);
  }

  .client-table-wrap,
  .category-table-wrap,
  .zone-table-wrap,
  .brand-table-wrap,
  .supplier-table-wrap,
  .sales-table-wrap,
  .purchase-table-wrap {
    display: none;
  }

  .client-card-list,
  .category-card-list,
  .zone-card-list,
  .brand-card-list,
  .supplier-card-list,
  .sales-mobile-list,
  .purchase-mobile-list {
    display: grid;
    min-width: 0;
  }

  .client-card-list {
    grid-template-columns: 1fr;
  }

  .sales-mobile-list,
  .purchase-mobile-list {
    overflow: hidden;
  }

  .nested-table-card:has(.sales-mobile-list) {
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .sale-mobile-item {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 180px);
    gap: 18px;
    overflow: visible;
  }

  .sale-mobile-actions {
    width: 100%;
    min-width: 0;
    justify-items: end;
  }

  .sale-mobile-total {
    max-width: none;
    overflow: visible;
    font-size: 1.16rem;
  }

  .sale-mobile-actions .button-link,
  .sale-mobile-actions button {
    justify-self: end;
  }

  .sales-mobile-fab {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 28;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b9858, #087643);
    color: #fff;
    box-shadow: 0 18px 34px rgba(0, 137, 79, 0.28);
  }

  body.filter-sheet-open {
    overflow: hidden;
  }

  .sales-filter-sheet {
    display: block;
    margin: 0;
  }

  .sales-filter-sheet .filter-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sales-filter-sheet .filter-sheet-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 81;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: 30px 30px 0 0;
    background: #fff;
    padding: 24px 20px 22px;
    box-shadow: 0 -22px 55px rgba(2, 6, 23, 0.25);
    transform: translateY(calc(100% + 12px));
    transition: transform 210ms ease;
  }

  .sales-filter-sheet.is-open .filter-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sales-filter-sheet.is-open .filter-sheet-panel {
    transform: translateY(0);
  }

  .filter-sheet-handle,
  .filter-sheet-head {
    display: block;
  }

  .filter-sheet-handle {
    grid-column: 1 / -1;
    width: 54px;
    height: 6px;
    margin: -12px auto 8px;
    border-radius: 999px;
    background: #d4ddd7;
  }

  .filter-sheet-head {
    grid-column: 1 / -1;
  }

  .filter-sheet-head h3 {
    margin: 0;
    font-size: 1.35rem;
  }

  .filter-sheet-head button {
    position: absolute;
    top: 18px;
    right: 20px;
  }

  .filter-sheet-actions {
    grid-column: 1 / -1;
  }

  .filter-sheet-actions button,
  .filter-sheet-actions .button-link {
    width: 100%;
  }

  .purchase-entry-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .purchase-entry-card {
    width: 100%;
    min-width: 0;
    gap: 18px;
    overflow: visible;
  }

  .purchase-meta-panel,
  .purchase-products-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 18px;
    overflow: visible;
  }

  .purchase-meta-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding: 0;
  }

  .purchase-due-date {
    grid-column: 1 / -1;
  }

  .purchase-payment-summary {
    min-width: 0;
  }

  .purchase-payment-summary > div {
    min-width: 0;
  }

  .purchase-lines-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    padding: 0 0 14px;
  }

  .purchase-lines-head > *,
  .purchase-global-product-picker,
  .purchase-global-product-picker .sale-search,
  .purchase-global-product-picker .sale-search input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .purchase-lines {
    min-width: 0;
    padding-right: 0;
    padding-left: 0;
  }

  .purchase-save-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    align-items: center;
    gap: 14px;
    padding-right: 0;
    padding-left: 0;
  }

  .purchase-grand-total {
    min-width: 0;
  }

  .purchase-grand-total strong {
    font-size: clamp(1.25rem, 4vw, 2rem);
    white-space: nowrap;
  }

  .purchase-save-row button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  button {
    min-height: 40px;
    padding: 0 12px;
  }

  .clients-toolbar.inventory-toolbar {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    overflow-x: visible;
  }

  .clients-toolbar.inventory-toolbar .client-search {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .clients-toolbar.inventory-toolbar .client-search input {
    width: 100%;
    min-width: 0;
  }

  .clients-toolbar.inventory-toolbar .button-link,
  .clients-toolbar.inventory-toolbar button.button-link {
    width: 100%;
    min-width: 0;
    height: 52px;
    min-height: 52px;
    border-radius: 14px;
  }

  .clients-toolbar.inventory-toolbar .button-link:first-of-type {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 24px rgba(0, 137, 79, 0.18);
  }

  .clients-toolbar.inventory-toolbar .inventory-toolbar-add {
    display: none;
  }

  .clients-toolbar.inventory-toolbar .inventory-category-action {
    display: none;
  }

  .inventory-mobile-fab {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 30;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b9858, #087643);
    color: #fff;
    box-shadow: 0 18px 34px rgba(0, 137, 79, 0.28);
  }

  .inventory-mobile-fab svg {
    width: 24px;
    height: 24px;
  }

  .sale-builder-form {
    gap: 12px;
  }

  .sale-builder-heading {
    gap: 10px;
  }

  .sale-builder-heading .button-link {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .sale-step-title {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
  }

  .sale-search input {
    min-height: 52px;
    padding-left: 46px;
    font-size: 0.94rem;
  }

  .sale-search .icon {
    left: 15px;
    width: 20px;
    height: 20px;
  }

  .sale-product-panel,
  .sale-summary-panel {
    gap: 14px;
    padding: 12px 0;
  }

  .sale-product-grid {
    gap: 8px;
  }

  .sale-product-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 8px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.055);
  }

  .sale-product-photo {
    grid-row: span 3;
    width: 86px;
    height: 108px;
    border-radius: 15px;
    object-fit: contain;
    background: radial-gradient(circle at 50% 20%, #ffffff 0, #f8fafc 42%, #e2e8f0 100%);
  }

  .sale-product-info span {
    display: inline-flex;
    max-width: 92px;
    overflow: hidden;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 3px 7px;
    background: #ecfdf5;
    color: #047857;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sale-product-info strong {
    margin-top: 4px;
    font-size: 0.92rem;
    line-height: 1.15;
  }

  .sale-product-info p {
    font-size: 0.78rem;
  }

  .sale-product-meta {
    grid-column: 2;
    align-items: end;
    border-top: 0;
    padding-top: 0;
    font-size: 0.78rem;
  }

  .sale-product-meta strong {
    display: block;
    font-size: 0.98rem;
  }

  .sale-product-add {
    grid-column: 2;
    grid-template-columns: 42px minmax(42px, 1fr) 42px;
    gap: 4px;
    padding: 3px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
  }

  .sale-product-add input,
  .sale-product-add button {
    min-height: 38px;
    border-radius: 10px;
  }

  .sale-product-add input {
    border: 0;
    background: transparent;
    font-size: 0.95rem;
  }

  .sale-summary-card {
    padding: 14px;
    border-radius: 16px;
  }

  .sale-credit-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
  }

  .sale-credit-summary span,
  .sale-credit-summary .credit-debt-link {
    min-height: 48px;
    padding: 7px 6px;
    border-radius: 12px;
    font-size: 0.66rem;
    text-align: center;
  }

  .sale-credit-summary strong {
    margin-top: 2px;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sale-cart-item {
    grid-template-columns: minmax(0, 1fr) auto 38px;
    gap: 8px;
  }

  .sale-payment-toggle button {
    min-height: 52px;
    font-size: 0.9rem;
  }

  .sale-payment-toggle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .sale-initial-payment {
    grid-template-columns: 1fr;
  }

  .sale-payment-row {
    grid-template-columns: minmax(0, 1fr) minmax(95px, 0.8fr) 42px;
  }

  .sale-change-calculator {
    grid-template-columns: 1fr;
  }

  .sale-total-bar {
    bottom: auto;
  }

  .sale-total-bar strong {
    font-size: 1.65rem;
  }

  .sale-review-button {
    min-height: 58px;
    font-size: 0.98rem;
  }

  .sale-confirm-overlay {
    align-items: end;
    padding: 10px;
  }

  .sale-confirm-modal {
    padding: 18px;
    border-radius: 20px;
  }

  .sale-confirm-head {
    align-items: flex-start;
  }

  .sale-confirm-head > span {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
  }

  .sale-confirm-head h2 {
    font-size: 1.15rem;
  }

  .sale-confirm-box {
    margin: 16px 0;
    padding: 14px;
  }

  .sale-confirm-box > div,
  .sale-confirm-item,
  .sale-confirm-total {
    gap: 10px;
  }

  .sale-confirm-total strong {
    font-size: 1.35rem;
  }

  .sale-confirm-actions {
    grid-template-columns: 1fr;
  }

  .product-visual-list {
    gap: 0;
    margin-top: 14px;
  }

  .product-visual-card {
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
  }

  .product-visual-media {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .product-unit-ribbon {
    min-height: 104px;
    border-radius: 7px;
    font-size: 0.58rem;
  }

  .product-visual-photo {
    width: 92px;
    height: 104px;
    border-radius: 16px;
    font-size: 1.25rem;
  }

  .product-visual-body h3 {
    font-size: 0.98rem;
  }

  .product-visual-meta,
  .product-visual-description {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .product-visual-price {
    font-size: 1rem;
  }

  .product-visual-stock {
    gap: 3px 6px;
    font-size: 0.8rem;
  }

  .product-low-badge {
    min-height: 24px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .product-visual-actions {
    grid-column: 1 / -1;
  }

  .product-visual-actions .row-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .product-visual-actions .row-actions .icon-only,
  .product-visual-actions .row-actions .icon-button {
    min-height: 46px;
    border-radius: 12px;
  }

  input,
  select {
    min-height: 40px;
  }

  textarea {
    min-height: 92px;
  }

  .auth-hero {
    min-height: 230px;
    padding: 24px 20px 64px;
  }

  .auth-brand-mark {
    gap: 10px;
    padding: 10px 18px 10px 12px;
    font-size: 1.35rem;
  }

  .auth-brand-mark .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .auth-brand-mark .icon {
    width: 23px;
    height: 23px;
  }

  .auth-copy {
    margin-top: 66px;
  }

  .auth-copy h1 {
    font-size: 2.16rem;
  }

  .auth-panel.login-panel {
    margin-top: -48px;
    padding: 0 16px 20px;
  }

  .auth-panel .login-card {
    padding: 30px 24px 28px;
    border-radius: 24px;
  }

  .login-card-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
  }

  .login-card-icon .icon {
    width: 28px;
    height: 28px;
  }

  .auth-panel .login-card h2 {
    font-size: 1.9rem;
  }

  .auth-panel .login-card > p {
    margin-top: 8px;
    font-size: 0.98rem;
  }

  .auth-panel .form-stack {
    gap: 16px;
    margin-top: 24px;
  }

  .auth-panel input[type="email"],
  .auth-panel input[type="password"],
  .auth-panel input[type="text"] {
    min-height: 52px;
    font-size: 0.96rem;
  }

  .input-with-icon > .icon {
    left: 18px;
    width: 22px;
    height: 22px;
  }

  .input-with-icon input {
    padding-left: 58px;
  }

  .login-options {
    gap: 12px;
    font-size: 0.92rem;
  }

  .login-submit {
    min-height: 56px;
    font-size: 1.05rem;
  }

  .main {
    padding: 16px;
  }

  .data-form h2,
  .card h2 {
    font-size: 1.2rem;
  }

  .form-grid {
    margin: 12px 0;
  }

  .map-picker {
    gap: 8px;
  }

  .map-picker-header {
    gap: 8px;
  }

  .map-status {
    right: 8px;
    bottom: 8px;
    left: 8px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .photo-picker {
    grid-template-columns: 1fr;
  }

  .photo-preview {
    width: 100%;
  }

  .photo-actions,
  .photo-actions .file-action {
    width: 100%;
  }

  .map-actions {
    top: 8px;
    right: auto;
    left: 8px;
  }

  .client-map {
    height: 520px !important;
    min-height: 500px !important;
    max-height: 620px !important;
  }

  .client-map > div {
    height: 520px !important;
    max-height: 620px !important;
  }

  .map-empty {
    min-height: 120px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .clients-card {
    padding: 16px;
    border-radius: 22px;
  }

  .clients-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    margin-bottom: 16px;
  }

  .clients-card-head h2 {
    font-size: 1.38rem;
  }

  .clients-toolbar,
  .client-search {
    width: 100%;
  }

  .admin-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    width: 100%;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .admin-actions .icon-only {
    width: 100%;
  }

  .admin-link {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .clients-page .clients-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    gap: 10px;
  }

  .clients-page .clients-toolbar .client-search-form,
  .clients-page .clients-toolbar .client-search {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .clients-page .client-search input {
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
  }

  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) {
    grid-template-columns: repeat(4, 56px) minmax(0, 1fr);
    justify-content: start;
    gap: 8px;
  }

  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) .client-search-form,
  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) .client-search {
    grid-column: 1 / -1;
  }

  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) .button-link,
  .clients-page .clients-toolbar:not(.category-toolbar):not(.inventory-toolbar):not(.sales-toolbar):not(.inactive-toolbar) button.button-link {
    width: 56px;
    min-width: 56px;
  }

  .clients-page .sales-toolbar {
    grid-template-columns: minmax(0, 1fr) 56px;
  }

  .clients-page .sales-toolbar .client-search {
    grid-column: auto;
  }

  .sales-toolbar > .button-link,
  .sales-toolbar > a.button-link {
    display: none;
  }

  .sales-toolbar > a[href*="receivables"] {
    display: none !important;
  }

  .sales-toolbar .sales-filter-trigger {
    display: grid;
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 14px;
  }

  .sales-quick-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 100%;
    gap: 10px;
    margin: 6px 0 16px;
    overflow: hidden;
    scrollbar-width: none;
  }

  .sales-quick-filters::-webkit-scrollbar {
    display: none;
  }

  .sales-chip {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dce8e1;
    border-radius: 14px;
    background: #fff;
    color: #087f49;
    min-width: 0;
    padding: 0 6px;
    font-size: 0.86rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
  }

  .sales-chip.active {
    border-color: transparent;
    background: linear-gradient(135deg, #0b9858, #087643);
    color: #fff;
    box-shadow: 0 12px 24px rgba(0, 137, 79, 0.18);
  }

  .sales-table-wrap,
  .purchase-table-wrap {
    display: none;
  }

  .sales-mobile-list,
  .purchase-mobile-list {
    display: grid;
    min-width: 0;
    overflow: hidden;
  }

  .nested-table-card:has(.sales-mobile-list) {
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .sales-mobile-fab {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 28;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b9858, #087643);
    color: #fff;
    box-shadow: 0 18px 34px rgba(0, 137, 79, 0.28);
  }

  .sales-mobile-fab svg {
    width: 24px;
    height: 24px;
  }

  body.filter-sheet-open {
    overflow: hidden;
  }

  .sales-filter-sheet {
    display: block;
    margin: 0;
  }

  .sales-filter-sheet .filter-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sales-filter-sheet .filter-sheet-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 81;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: 30px 30px 0 0;
    background: #fff;
    padding: 24px 20px 22px;
    box-shadow: 0 -22px 55px rgba(2, 6, 23, 0.25);
    transform: translateY(calc(100% + 12px));
    transition: transform 210ms ease;
  }

  .sales-filter-sheet.is-open .filter-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sales-filter-sheet.is-open .filter-sheet-panel {
    transform: translateY(0);
  }

  .filter-sheet-handle {
    grid-column: 1 / -1;
    display: block;
    width: 58px;
    height: 6px;
    margin: -2px auto 4px;
    border-radius: 999px;
    background: #cfd8d2;
  }

  .filter-sheet-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .filter-sheet-head h3 {
    margin: 0;
    color: #1f2a24;
    font-size: 1.8rem;
    line-height: 1;
  }

  .filter-sheet-head button {
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
    border-radius: 50%;
  }

  .sales-filter-sheet label {
    gap: 10px;
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .sales-filter-sheet label:first-of-type,
  .sales-filter-sheet label:nth-of-type(2) {
    grid-column: 1 / -1;
  }

  .sales-filter-sheet label select,
  .sales-filter-sheet label input {
    min-height: 58px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 850;
  }

  .filter-sheet-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
  }

  .filter-sheet-actions .button-link,
  .filter-sheet-actions button {
    width: 100%;
    min-height: 58px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 900;
  }

  .sale-mobile-item {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 156px);
    gap: 14px;
  }

  .sale-mobile-main {
    gap: 8px 10px;
  }

  .sale-mobile-actions {
    width: 100%;
    justify-items: end;
  }

  .sale-mobile-actions .button-link,
  .sale-mobile-actions button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .sale-mobile-number,
  .sale-mobile-number {
    font-size: 0.98rem;
  }

  .sale-mobile-total {
    max-width: 100%;
    font-size: 1.08rem;
    overflow: visible;
  }

  .sale-mobile-info h3 {
    font-size: 0.98rem;
  }

  .sale-mobile-info p {
    font-size: 0.82rem;
  }

  .clients-toolbar.compact-toolbar {
    grid-template-columns: minmax(0, 1fr) repeat(2, 44px);
  }

  .clients-page .sales-toolbar {
    grid-template-columns: minmax(0, 1fr) 56px;
  }

  .clients-page .sales-toolbar .client-search {
    grid-column: auto;
  }

  .clients-page .sales-toolbar > a.button-link {
    display: none !important;
  }

  .clients-page .sales-toolbar .sales-filter-trigger,
  .clients-page .sales-toolbar .purchase-filter-trigger {
    display: grid !important;
  }

  .clients-page .clients-toolbar.category-toolbar {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) 52px 52px;
    gap: 8px;
  }

  .clients-page .clients-toolbar.category-toolbar .client-search-form,
  .clients-page .clients-toolbar.category-toolbar .client-search {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .clients-page .clients-toolbar.category-toolbar .button-link,
  .clients-page .clients-toolbar.category-toolbar button.button-link {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .clients-page .clients-toolbar.inventory-toolbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: visible;
  }

  .clients-page .clients-toolbar.inventory-toolbar .client-search {
    grid-column: 1 / -1;
  }

  .clients-page .clients-toolbar.inventory-toolbar .inventory-toolbar-add {
    display: none;
  }

  .inventory-mobile-fab {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 30;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b9858, #087643);
    color: #fff;
    box-shadow: 0 18px 34px rgba(0, 137, 79, 0.28);
  }

  .inventory-mobile-fab svg {
    width: 24px;
    height: 24px;
  }

  .clients-page .clients-toolbar.inactive-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-card-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .client-table-wrap {
    display: none;
  }

  .category-table-wrap {
    display: none;
  }

  .zone-table-wrap {
    display: none;
  }

  .brand-table-wrap,
  .supplier-table-wrap {
    display: none;
  }

  .category-card-list,
  .zone-card-list,
  .brand-card-list,
  .supplier-card-list {
    display: grid;
  }

  .customer-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 6px 12px;
    border-radius: 18px;
  }

  .customer-photo {
    grid-row: span 5;
    width: 68px;
    height: 68px;
  }

  .customer-name {
    grid-column: 2;
    align-self: center;
  }

  .customer-field {
    grid-column: 2;
  }

  .customer-reference small {
    display: inline;
    margin-bottom: 0;
  }

  .client-view-page {
    padding: 0;
  }

  .client-view-card {
    padding: 16px;
    border-radius: 22px;
  }

  .client-view-head {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
  }

  .client-view-head h2 {
    font-size: 1.25rem;
  }

  .client-view-head p {
    font-size: 0.92rem;
  }

  .client-view-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .client-hero {
    gap: 12px;
    margin-bottom: 12px;
  }

  .client-photo-panel {
    border-radius: 18px;
  }

  .client-photo-panel img,
  .client-photo-placeholder {
    height: 210px;
  }

  .client-photo-caption {
    padding: 12px;
  }

  .client-summary-panel {
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .client-name-block {
    gap: 12px;
    padding-bottom: 12px;
  }

  .client-initial {
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .client-name-block h3 {
    font-size: 1.22rem;
  }

  .client-name-block p {
    font-size: 0.88rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .info-item {
    min-height: 72px;
    padding: 12px;
    border-radius: 16px;
  }

  .info-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .info-text strong {
    font-size: 0.7rem;
  }

  .info-text span {
    font-size: 0.96rem;
  }

  .content-grid {
    gap: 14px;
  }

  .section-title {
    font-size: 1.05rem;
  }

  .section-subtitle {
    font-size: 0.88rem;
  }

  .map-card {
    border-radius: 18px;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
  }

  .map-frame {
    min-height: 330px;
  }

  .client-map-view {
    height: 330px;
    min-height: 330px;
  }

  .map-coordinate-chip {
    right: 10px;
    bottom: 10px;
    left: 10px;
    justify-content: center;
    border-radius: 14px;
    font-size: 0.76rem;
  }

  .reference-card {
    border-radius: 18px;
    padding: 14px;
  }

  .category-card,
  .zone-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .category-actions .button-link,
  .category-actions button,
  .zone-actions .button-link,
  .zone-actions button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .has-tooltip::before,
  .has-tooltip::after {
    display: none;
  }

  .purchase-filters,
  .receivables-filters,
  .purchase-line {
    grid-template-columns: 1fr;
  }

  .purchase-entry-card {
    border-radius: 22px;
  }

  .purchase-entry-heading {
    display: grid;
    gap: 12px;
    padding: 18px;
  }

  .purchase-entry-heading h2 {
    font-size: 1.35rem;
  }

  .purchase-entry-heading .button-link {
    width: 100%;
  }

  .purchase-meta-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .purchase-lines-head {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 16px 4px;
  }

  .purchase-lines-head .stock-preview {
    min-width: 0;
    text-align: left;
  }

  .purchase-lines {
    padding: 12px 16px 16px;
  }

  .purchase-line {
    padding: 12px;
    border-radius: 18px;
  }

  .purchase-line .product-line-preview {
    justify-content: flex-start;
  }

  .purchase-total-row,
  .purchase-save-row {
    padding-right: 16px;
    padding-left: 16px;
  }

  .purchase-save-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .purchase-entry-page {
    max-width: 100%;
    --purchase-mobile-gutter: 14px;
    padding-bottom: 112px;
  }

  .purchase-entry-card {
    gap: 16px;
    overflow: visible;
  }

  .purchase-meta-panel,
  .purchase-products-panel {
    border-radius: 20px;
    box-sizing: border-box;
    width: 100%;
    padding: var(--purchase-mobile-gutter);
  }

  .purchase-products-panel {
    overflow: visible;
    padding: 0;
  }

  .purchase-meta-grid {
    gap: 14px;
    padding: 0;
  }

  .purchase-payment-summary {
    display: none;
  }

  .purchase-lines-head {
    position: relative;
    z-index: 60;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
    padding: var(--purchase-mobile-gutter) var(--purchase-mobile-gutter) 12px;
    border-bottom: 1px solid #e2ebe5;
  }

  .purchase-lines-head h3 {
    gap: 8px;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0.03em;
  }

  .purchase-lines-head h3 .icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .purchase-global-product-picker .sale-search input {
    width: 100%;
    min-height: 52px;
    padding-right: 12px;
    font-size: 0.96rem;
  }

  .purchase-global-product-picker .purchase-picker-results {
    z-index: 95;
    right: 0;
    left: 0;
    max-height: 320px;
  }

  .purchase-global-product-picker .purchase-picker-results button {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    min-height: 72px;
    padding: 10px 12px;
  }

  .purchase-result-photo {
    width: 46px;
    height: 46px;
  }

  .purchase-global-product-picker .purchase-picker-results button strong {
    font-size: 0.92rem;
  }

  .purchase-global-product-picker .purchase-picker-results button small {
    font-size: 0.76rem;
  }

  .purchase-global-product-picker .purchase-picker-results button em {
    font-size: 0.9rem;
  }

  .purchase-lines {
    gap: 0;
    padding: 0 var(--purchase-mobile-gutter) var(--purchase-mobile-gutter);
  }

  .purchase-line {
    box-sizing: border-box;
    width: 100%;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e2ebe5;
    border-radius: 14px;
    box-shadow: none;
    margin-top: 12px;
  }

  .purchase-line:not(.is-compact):not(.is-empty) {
    border-left: 5px solid #1f7a4d;
    background: #effbf5;
    padding: 44px 12px 12px;
  }

  .purchase-line-header {
    top: 14px;
    right: 14px;
    gap: 8px;
  }

  .purchase-line:not(.is-compact) .purchase-line-header {
    top: 10px;
    right: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    justify-content: initial;
    align-items: center;
  }

  .purchase-line:not(.is-compact) .purchase-remove-line {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
  }

  .purchase-line:not(.is-compact) .purchase-editing-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    color: #1f7a4d;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .purchase-line:not(.is-compact) .purchase-editing-title .icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }

  .purchase-line:not(.is-compact) .purchase-done-line {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 10px 18px rgba(8, 127, 73, 0.2);
  }

  .purchase-line:not(.is-compact) .purchase-done-line span {
    display: none;
  }

  .purchase-line:not(.is-compact) .purchase-done-line .icon {
    width: 18px;
    height: 18px;
  }

  .purchase-line.is-compact .purchase-line-header {
    top: 12px;
    right: 10px;
  }

  .purchase-line.is-compact .purchase-remove-line,
  .purchase-line.is-compact .purchase-edit-line {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .purchase-compact-summary {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    padding-right: 82px;
  }

  .purchase-compact-total {
    grid-column: 2;
    text-align: left;
  }

  .purchase-compact-total span {
    display: none;
  }

  .purchase-compact-total strong {
    font-size: 0.96rem;
  }

  .purchase-compact-photo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .purchase-compact-summary strong {
    font-size: 0.9rem;
  }

  .purchase-compact-summary small {
    font-size: 0.74rem;
  }

  .purchase-compact-summary .purchase-brand-pill {
    max-width: 92px;
    padding: 4px 9px;
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .purchase-search-select select,
  .purchase-product-select select {
    min-height: 52px;
    font-size: 0.92rem;
  }

  .purchase-product-overview {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding-right: 0;
  }

  .purchase-line:not(.is-compact) .purchase-product-overview {
    display: none;
  }

  .purchase-line .product-line-preview {
    width: 96px;
    min-height: 96px;
    justify-content: center;
  }

  .purchase-line .product-line-preview img {
    width: 72px;
    height: 72px;
  }

  .purchase-product-summary strong {
    font-size: 1.05rem;
  }

  .purchase-product-summary small {
    font-size: 0.86rem;
  }

  .purchase-line-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding-right: 0;
  }

  .purchase-line-fields label {
    gap: 5px;
    font-size: 0.62rem;
    letter-spacing: 0.07em;
  }

  .purchase-line-fields label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .purchase-line-fields input {
    min-height: 39px;
    border-radius: 11px;
    text-align: center;
    font-size: 0.82rem;
  }

  .purchase-line-fields label:nth-child(4),
  .purchase-line-fields label:nth-child(5) {
    margin-top: 8px;
    padding: 9px;
    background: #f1f5f9;
  }

  .purchase-line-fields label:nth-child(4) {
    border-radius: 12px 0 0 12px;
  }

  .purchase-line-fields label:nth-child(5) {
    border-radius: 0 12px 12px 0;
  }

  .line-subtotal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 14px;
    border: 1px solid #cef4dd;
    background: #fff;
    padding: 10px 12px;
  }

  .line-subtotal > div {
    gap: 4px;
    padding: 0;
    border: 0;
  }

  .line-subtotal > div:first-child,
  .line-subtotal > div:nth-child(3) {
    text-align: right;
  }

  .line-subtotal > div:first-child {
    grid-column: 2;
    grid-row: 1 / span 3;
    justify-content: end;
    align-content: center;
  }

  .line-subtotal > div:nth-child(2) {
    order: 1;
  }

  .line-subtotal > div:nth-child(4) {
    order: 2;
  }

  .line-subtotal > div:nth-child(3) {
    order: 3;
    text-align: left;
  }

  .line-subtotal span {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  .line-subtotal strong,
  .line-subtotal b {
    font-size: 0.9rem;
    line-height: 1.05;
  }

  .line-subtotal > div:nth-child(2) strong,
  .line-subtotal > div:nth-child(2) b,
  .line-subtotal > div:nth-child(3) strong,
  .line-subtotal > div:nth-child(3) b,
  .line-subtotal > div:nth-child(4) strong,
  .line-subtotal > div:nth-child(4) b {
    color: #334155;
    font-weight: 700;
  }

  .line-subtotal > div:first-child strong,
  .line-subtotal > div:first-child b {
    font-size: 1.08rem;
  }

  .line-subtotal small {
    font-size: 0.62rem;
  }

  .line-subtotal > div:nth-child(3) {
    border-left: 0;
    border-top: 0;
  }

  .line-subtotal > div:nth-child(4) {
    border-top: 0;
  }

  .purchase-total-row,
  .purchase-save-row {
    margin-right: var(--purchase-mobile-gutter);
    margin-left: var(--purchase-mobile-gutter);
    padding-right: 0;
    padding-left: 0;
  }

  .purchase-save-row {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 42;
    grid-template-columns: minmax(0, 0.86fr) minmax(132px, 1fr);
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(14px);
  }

  .purchase-save-note {
    display: none;
  }

  .purchase-grand-total {
    display: grid;
    gap: 2px;
    justify-content: start;
  }

  .purchase-grand-total span {
    max-width: none;
    color: #65746d;
    font-size: 0.62rem;
    line-height: 1.1;
  }

  .purchase-grand-total strong {
    font-size: 1.12rem;
    white-space: nowrap;
  }

  .purchase-save-row button {
    min-height: 48px;
    border-radius: 15px;
    font-size: 0.9rem;
  }

  .cash-filters {
    grid-template-columns: 1fr;
  }

  .expense-filters,
  .expense-report-filters,
  .sales-product-day-filters,
  .distribution-header-fields,
  .expense-report-grid,
  .dashboard-filter,
  .dashboard-mini-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi-grid,
  .dashboard-alerts {
    grid-template-columns: 1fr;
  }

  .capital-composition-grid,
  .capital-total-row,
  .inventory-capital-summary {
    grid-template-columns: 1fr;
  }

  .capital-composition-grid > div + div,
  .capital-total-row > div + div,
  .inventory-capital-summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .chart-row {
    grid-template-columns: minmax(68px, 0.42fr) minmax(0, 1fr);
  }

  .chart-row > strong {
    grid-column: 1 / -1;
    text-align: left;
  }

  .purchase-line.sale-line {
    grid-template-columns: 1fr;
  }

  .purchase-total-row {
    align-items: stretch;
    flex-direction: column;
  }

  .clients-page .clients-toolbar .button-link,
  .clients-page .clients-toolbar button.button-link {
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    border-radius: 14px;
  }

  .clients-page .sales-toolbar > a.button-link {
    display: none !important;
  }

  .clients-page .sales-toolbar .sales-filter-trigger {
    display: grid !important;
  }

  .clients-table,
  .products-table,
  .categories-table,
  .users-table,
  .clients-table thead,
  .products-table thead,
  .categories-table thead,
  .users-table thead,
  .clients-table tbody,
  .products-table tbody,
  .categories-table tbody,
  .users-table tbody,
  .clients-table tr,
  .products-table tr,
  .categories-table tr,
  .users-table tr,
  .clients-table th,
  .products-table th,
  .categories-table th,
  .users-table th,
  .clients-table td,
  .products-table td,
  .categories-table td,
  .users-table td {
    display: block;
  }

  .clients-table,
  .products-table,
  .categories-table,
  .users-table {
    min-width: 0;
    background: transparent;
  }

  .clients-card .table-wrap {
    overflow-x: visible;
  }

  .clients-table thead,
  .products-table thead,
  .categories-table thead,
  .users-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .clients-table tr,
  .products-table tr,
  .categories-table tr,
  .users-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
  }

  .clients-table td,
  .products-table td,
  .categories-table td,
  .users-table td {
    display: grid;
    grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100% !important;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .clients-table td::before,
  .products-table td::before,
  .categories-table td::before,
  .users-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .clients-table td:last-child,
  .products-table td:last-child,
  .categories-table td:last-child,
  .users-table td:last-child {
    border-bottom: 0;
  }

  .clients-table td[data-label="Foto"] {
    grid-template-columns: minmax(96px, 0.42fr) auto;
    justify-content: start;
  }

  .clients-table td[data-label="Acciones"],
  .products-table td[data-label="Acciones"],
  .categories-table td[data-label="Acciones"],
  .users-table td[data-label="Acciones"] {
    display: block;
  }

  .clients-table td[data-label="Acciones"]::before,
  .products-table td[data-label="Acciones"]::before,
  .categories-table td[data-label="Acciones"]::before,
  .users-table td[data-label="Acciones"]::before {
    display: block;
    margin-bottom: 8px;
  }

  .clients-table .action-row,
  .clients-table .row-actions,
  .products-table .row-actions,
  .categories-table .action-row,
  .categories-table .row-actions,
  .users-table .row-actions,
  .clients-table .action-row form,
  .clients-table .row-actions form,
  .products-table .row-actions form,
  .categories-table .action-row form,
  .categories-table .row-actions form,
  .users-table .row-actions form,
  .clients-table .action-row button,
  .clients-table .row-actions button,
  .products-table .row-actions button,
  .categories-table .action-row button,
  .categories-table .row-actions button,
  .users-table .row-actions button,
  .clients-table .action-row .button-link,
  .clients-table .row-actions .button-link,
  .products-table .row-actions .button-link,
  .categories-table .action-row .button-link,
  .categories-table .row-actions .button-link,
  .users-table .row-actions .button-link {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions .icon-button {
    width: 100%;
  }

  .users-table .action-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .clients-table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-lite {
    justify-content: space-between;
  }

  .topbar {
    align-items: center;
  }

  .user-menu {
    width: auto;
    margin-left: auto;
  }

  .user-menu-trigger {
    width: 46px;
    justify-content: center;
  }

  .user-menu-panel {
    right: 0;
    left: auto;
    width: min(250px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }
}

.route-form { width: min(1120px, 100%); }
.route-selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.route-selection-grid h3 { margin: 0 0 12px; font-size: 1rem; }
.route-check-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; padding-right: 4px; }
.route-check-list label, .route-client-preview { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.route-client-preview[hidden] { display: none; }
.route-check-list label { cursor: pointer; }
.route-check-list input { flex: 0 0 auto; width: 18px; height: 18px; }
.route-check-list span { display: grid; min-width: 0; }
.route-check-list strong, .route-check-list small { overflow-wrap: anywhere; }
.route-check-list small { color: var(--muted); }
@media (max-width: 760px) { .route-selection-grid { grid-template-columns: 1fr; } }

@media (max-width: 380px) {
  .sale-mobile-item {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 104px);
    gap: 10px;
  }

  .sale-mobile-total {
    font-size: 0.98rem;
  }

  .auth-hero {
    min-height: 380px;
    padding-inline: 22px;
  }

  .auth-copy h1 {
    font-size: 1.92rem;
  }

  .auth-panel.login-panel {
    padding-inline: 14px;
  }

  .auth-panel .login-card {
    padding: 38px 22px 32px;
  }

  .auth-panel .login-card h2 {
    font-size: 2rem;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-map {
    height: 480px !important;
    min-height: 460px !important;
    max-height: 560px !important;
  }

  .client-map > div {
    height: 480px !important;
    max-height: 560px !important;
  }
}

@media (max-width: 600px) {
  .distribution-cash-summary {
    grid-template-columns: 1fr;
  }
}

/* Ubicaciones y rutas: listados más claros en escritorio y tarjetas nativas en pantallas táctiles. */
.location-type-badge,
.location-client-count,
.route-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.location-type-badge {
  padding: 0 10px;
  border: 1px solid #cbe8d8;
  background: #edf8f1;
  color: #087f49;
}

.location-client-count,
.route-stat {
  min-width: 34px;
  padding: 0 9px;
  background: #f1f5f2;
  color: #273a30;
}

.location-description-cell,
.route-description-cell {
  max-width: 360px;
  color: #58655e;
  line-height: 1.4;
}

.routes-card .clients-card-head {
  align-items: flex-start;
}

.route-table th:nth-child(2),
.route-table td:nth-child(2) {
  width: 20%;
}

.route-table th:nth-child(3),
.route-table td:nth-child(3) {
  width: 12%;
}

.route-table th:nth-child(4),
.route-table td:nth-child(4) {
  width: 34%;
}

.route-table th:last-child,
.route-table td:last-child {
  width: 118px;
}

.route-table .action-group {
  justify-content: flex-end;
}

.route-table .button-link,
.route-table button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 11px;
  padding: 0;
}

.route-deactivate-button {
  border: 1px solid #f3d0ce !important;
  background: #fffafa !important;
  color: #b42318 !important;
}

.route-deactivate-button:hover {
  background: #fff0ef !important;
}

.route-card-list {
  display: none;
}

.route-empty-state {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
}

.route-form .form-actions {
  margin-top: 24px;
}

.route-selection-grid > section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e3ebe5;
  border-radius: 16px;
  background: #fbfdfb;
}

.route-selection-grid h3 {
  color: #183027;
}

.route-check-list {
  scrollbar-color: #b7c8bc transparent;
}

.route-check-list label,
.route-client-preview {
  border-radius: 12px;
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.route-check-list label:hover {
  border-color: #92c9a9;
  background: #f4fbf6;
  transform: translateY(-1px);
}

.route-check-list input:checked + span strong {
  color: #087f49;
}

@media (min-width: 701px) and (max-width: 980px) {
  .zones-page .zone-card-list,
  .routes-page .route-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .routes-page .route-table-wrap {
    display: none;
  }

  .routes-page .route-card-list {
    display: grid;
    gap: 14px;
  }
}

@media (max-width: 980px) {
  .zones-page .zone-table-wrap,
  .routes-page .route-table-wrap {
    display: none;
  }

  .routes-page .route-card-list {
    display: grid;
    gap: 12px;
  }

  .route-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid #e3ebe5;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(28, 43, 34, 0.07);
  }

  .route-card-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eaf7ef, #dff1e6);
    color: #087f49;
  }

  .route-card-main {
    min-width: 0;
  }

  .route-card-main strong {
    display: block;
    color: #101d2d;
    font-size: 1.04rem;
    line-height: 1.25;
  }

  .route-card-main p {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: #66736c;
    font-size: 0.84rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .route-card-metrics,
  .route-card-actions {
    grid-column: 1 / -1;
  }

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

  .route-card-metrics span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 8px 11px;
    border-radius: 12px;
    background: #f5f8f6;
  }

  .route-card-metrics small {
    color: #68746d;
    font-size: 0.72rem;
    font-weight: 800;
  }

  .route-card-metrics b {
    color: #087f49;
    font-size: 1.05rem;
  }

  .route-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .route-card-actions form,
  .route-card-actions .button-link,
  .route-card-actions button {
    min-width: 0;
    margin: 0;
  }

  .route-card-actions .button-link,
  .route-card-actions button {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    padding: 0 10px;
    text-decoration: none;
  }
}

@media (max-width: 600px) {
  .zones-page .zone-card-list {
    gap: 10px;
  }

  .zones-page .zone-card {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 9px 11px;
    padding: 12px;
    border-radius: 16px;
  }

  .zones-page .zone-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .zones-page .zone-name {
    font-size: 1rem;
  }

  .zones-page .zone-count {
    min-height: 27px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .zones-page .zone-description {
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  .zones-page .zone-actions {
    margin-top: -1px;
  }

  .zones-page .zone-actions .button-link,
  .zones-page .zone-actions button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 12px;
  }

  .route-selection-grid {
    gap: 14px;
    margin-top: 16px;
  }

  .route-selection-grid > section {
    padding: 13px;
    border-radius: 14px;
  }

  .route-check-list {
    max-height: 340px;
  }
}

/* Distribución: el listado financiero requiere una jerarquía propia en pantallas táctiles. */
.distribution-card-list {
  display: none;
}

.distribution-list-table tbody tr {
  transition: background 160ms ease;
}

.distribution-list-table tbody tr:hover {
  background: #fbfdfc;
}

.distribution-card-item {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid #e3ebe5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 43, 34, 0.07);
}

.distribution-card-topline,
.distribution-card-person,
.distribution-card-counts,
.distribution-card-money,
.distribution-card-detail {
  min-width: 0;
}

.distribution-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.distribution-card-id {
  color: #183027;
  font-size: 0.82rem;
  font-weight: 850;
}

.distribution-card-person {
  display: flex;
  align-items: center;
  gap: 11px;
}

.distribution-card-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #eaf7ef, #dff1e6);
  color: #087f49;
  font-weight: 900;
}

.distribution-card-person > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.distribution-card-person strong {
  color: #101d2d;
  font-size: 1rem;
}

.distribution-card-person span {
  overflow-wrap: anywhere;
  color: #68746d;
  font-size: 0.8rem;
  line-height: 1.35;
}

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

.distribution-card-counts span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 8px 11px;
  border-radius: 12px;
  background: #f5f8f6;
}

.distribution-card-counts small {
  color: #68746d;
  font-size: 0.72rem;
  font-weight: 800;
}

.distribution-card-counts b {
  color: #183027;
  font-size: 1rem;
}

.distribution-card-money {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e4ebe6;
  border-radius: 13px;
  background: #e4ebe6;
}

.distribution-card-money span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  background: #fbfdfb;
  color: #68746d;
  font-size: 0.72rem;
  font-weight: 800;
}

.distribution-card-money strong {
  overflow-wrap: anywhere;
  color: #183027;
  font-size: 0.86rem;
}

.distribution-card-money .total {
  background: #edf8f1;
  color: #087f49;
}

.distribution-card-money .total strong {
  color: #087f49;
}

.distribution-card-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  color: #087f49;
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.distribution-card-detail .icon {
  width: 18px;
  transform: rotate(-90deg);
}

.distribution-empty-state {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
}

@media (max-width: 980px) {
  .distribution-page .distribution-list-wrap {
    display: none;
  }

  .distribution-page .distribution-card-list {
    display: grid;
    gap: 12px;
  }

  .distribution-detail-page .products-table td[data-label="Producto"] {
    display: block;
    padding: 13px 12px;
  }

  .distribution-detail-page .products-table td[data-label="Producto"]::before {
    display: block;
    margin-bottom: 7px;
  }

  .distribution-detail-page .products-table td[data-label="Producto"] strong,
  .distribution-detail-page .products-table td[data-label="Producto"] .table-subtext {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .distribution-detail-page .products-table td[colspan] {
    display: block;
    padding: 20px 14px;
    text-align: center;
  }

  .distribution-detail-page .products-table td[colspan]::before {
    display: none;
  }
}

@media (min-width: 701px) and (max-width: 980px) {
  .distribution-page .distribution-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* En portátiles, las tablas extensas se reemplazan por tarjetas para evitar columnas ocultas. */
@media (min-width: 981px) and (max-width: 1500px) {
  .routes-page .route-table-wrap,
  .distribution-page .distribution-list-wrap {
    display: none;
  }

  .routes-page .route-card-list,
  .distribution-page .distribution-card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .route-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid #e3ebe5;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(28, 43, 34, 0.07);
  }

  .route-card-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #eaf7ef, #dff1e6);
    color: #087f49;
  }

  .route-card-main {
    min-width: 0;
  }

  .route-card-main strong {
    display: block;
    color: #101d2d;
    font-size: 1.04rem;
    line-height: 1.25;
  }

  .route-card-main p {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: #66736c;
    font-size: 0.84rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .route-card-metrics,
  .route-card-actions {
    grid-column: 1 / -1;
  }

  .route-card-metrics,
  .route-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .route-card-metrics span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 8px 11px;
    border-radius: 12px;
    background: #f5f8f6;
  }

  .route-card-metrics small {
    color: #68746d;
    font-size: 0.72rem;
    font-weight: 800;
  }

  .route-card-metrics b {
    color: #087f49;
    font-size: 1.05rem;
  }

  .route-card-actions form,
  .route-card-actions .button-link,
  .route-card-actions button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    border-radius: 12px;
  }
}

@media (min-width: 1501px) {
  .routes-page .route-table,
  .distribution-page .distribution-list-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .distribution-page .distribution-list-table th,
  .distribution-page .distribution-list-table td {
    padding: 13px 8px;
    overflow-wrap: anywhere;
  }

  .distribution-page .distribution-list-table th:nth-child(1),
  .distribution-page .distribution-list-table td:nth-child(1) {
    width: 7%;
  }

  .distribution-page .distribution-list-table th:nth-child(2),
  .distribution-page .distribution-list-table td:nth-child(2) {
    width: 11%;
  }

  .distribution-page .distribution-list-table th:nth-child(3),
  .distribution-page .distribution-list-table td:nth-child(3) {
    width: 10%;
  }

  .distribution-page .distribution-list-table th:nth-child(4),
  .distribution-page .distribution-list-table td:nth-child(4) {
    width: 11%;
  }

  .distribution-page .distribution-list-table th:nth-child(5),
  .distribution-page .distribution-list-table td:nth-child(5),
  .distribution-page .distribution-list-table th:nth-child(6),
  .distribution-page .distribution-list-table td:nth-child(6) {
    width: 8%;
  }

  .distribution-page .distribution-list-table th:nth-child(7),
  .distribution-page .distribution-list-table td:nth-child(7) {
    width: 31%;
  }

  .distribution-page .distribution-list-table th:nth-child(8),
  .distribution-page .distribution-list-table td:nth-child(8) {
    width: 10%;
  }

  .distribution-page .distribution-list-money span {
    gap: 5px;
  }

  .distribution-page .distribution-status-link {
    max-width: 100%;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

.client-reward-traces {
  display: grid;
  gap: 12px;
  margin: 18px 0 24px;
}

.sale-whatsapp-action {
  background: #168a52;
  border-color: #168a52;
  color: #fff;
}

.sale-whatsapp-action:hover {
  background: #0d7342;
  border-color: #0d7342;
  color: #fff;
}

.sale-share-action {
  min-height: 42px;
}

.client-reward-trace {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.client-reward-trace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-reward-trace-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.client-reward-trace-head > div > span,
.client-reward-trace-head small {
  color: #68746d;
  font-size: 0.78rem;
  font-weight: 700;
}

.client-reward-trace-head strong,
.client-reward-trace-head small {
  overflow-wrap: anywhere;
}

.client-reward-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.client-reward-steps > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e3e9e4;
  border-radius: 8px;
  background: #fff;
}

.client-reward-steps > div > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #edf1ee;
  color: #6d7871;
  font-size: 0.76rem;
  font-weight: 900;
}

.client-reward-steps > div.complete > span {
  background: #def3e7;
  color: #087f49;
}

.client-reward-steps p {
  display: grid;
  min-width: 0;
  gap: 3px;
  margin: 0;
}

.client-reward-steps small {
  color: #68746d;
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-reward-review {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-left: 3px solid #d19a19;
  background: #fff8df;
  color: #66501a;
  font-size: 0.8rem;
}

.client-points-movements-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.loyalty-report-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.loyalty-report-columns {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.2fr);
  gap: 22px;
  margin-top: 24px;
}

.loyalty-report-columns > section {
  min-width: 0;
}

.loyalty-report-columns h3 {
  margin: 0 0 12px;
}

.loyalty-movements-wrap {
  max-height: 620px;
  overflow: auto;
}

@media (max-width: 1100px) {
  .client-reward-steps,
  .loyalty-report-stats,
  .loyalty-report-columns {
    grid-template-columns: 1fr;
  }

  .loyalty-report-columns {
    gap: 26px;
  }
}

@media (max-width: 700px) {
  .client-reward-trace-head {
    display: grid;
  }

  .client-reward-trace-head .status-pill {
    justify-self: start;
  }

  .loyalty-report-filters {
    grid-template-columns: 1fr 1fr auto;
  }
}
