/* ESA × sahmrev method: clean product chrome + forest/gold (never blue). */
:root {
  color-scheme: light;
  --es-forest: #047857;
  --es-forest-deep: #065f46;
  --es-fill: #047857;
  --es-fill-hover: #065f46;
  --es-on-fill: #ffffff;
  --es-ink: #0a120c;
  --es-text: #0f1c14;
  --es-gold: #c8921a;
  --es-gold-soft: #dcae3a;
  --es-mist: #e7f5ee;
  --es-paper: #f3f6f4;
  --es-surface: #ffffff;
  --es-elevated: #f6f9f7;
  --es-input: #ffffff;
  --es-line: color-mix(in srgb, #4f6357 22%, transparent);
  --es-line-solid: #d5e0d8;
  --es-body: #1a2e22;
  --es-muted: #5a6e62;
  --es-danger: #b42318;
  --es-success: #047857;
  --es-warn: #a67c12;
  --es-warn-bg: #fbf7eb;
  --es-warn-line: color-mix(in srgb, #c8921a 40%, transparent);
  --es-ring: color-mix(in srgb, #047857 32%, transparent);
  --es-shadow-color: color-mix(in srgb, #052e20 13%, transparent);
  --es-shadow: 0 10px 28px var(--es-shadow-color);
  --es-radius: 0.85rem;
  --es-radius-sm: 0.55rem;
  /* Able Pro light → ESA */
  --bs-body-bg: #f3f6f4;
  --bs-body-bg-rgb: 243, 246, 244;
  --bs-body-color: #1a2e22;
  --bs-body-color-rgb: 26, 46, 34;
  --bs-heading-color: #0f1c14;
  --bs-secondary-color: #5a6e62;
  --bs-tertiary-color: #5a6e62;
  --bs-border-color: #d5e0d8;
  --bs-secondary-bg: #f6f9f7;
  --bs-tertiary-bg: #e8f2eb;
  --bs-light: #e8f2eb;
  --bs-light-rgb: 232, 242, 235;
  --pc-heading-color: #0f1c14;
  --pc-header-background: #ffffff;
  --pc-header-color: #5a6e62;
  --pc-active-background: #e8f2eb;
  --pc-header-submenu-background: #ffffff;
  --pc-card-box-shadow: none;
}

html[dir="rtl"] body,
html[dir="rtl"] {
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif !important;
}

html[dir="ltr"] body {
  font-family: "Inter var", Inter, system-ui, sans-serif;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

::selection {
  background: color-mix(in srgb, var(--es-forest) 28%, transparent);
}

[data-es-when]:not(.is-on) {
  display: none !important;
}

.es-caps-group {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--es-mist);
  border-radius: 8px;
}

.es-caps-group .form-check {
  min-height: 32px;
}

body {
  background: var(--es-paper);
  color: var(--es-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.form-control,
.form-select {
  background-color: var(--es-input);
  color: var(--es-body);
  border-color: var(--es-line-solid);
  border-radius: var(--es-radius-sm);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--es-forest);
  box-shadow: 0 0 0 0.2rem var(--es-ring);
  background-color: var(--es-input);
  color: var(--es-body);
}

.text-muted {
  color: var(--es-muted) !important;
}

[data-pc-preset="preset-1"] {
  --pc-sidebar-active-color: var(--es-forest);
  --bs-blue: var(--es-forest);
  --bs-primary: var(--es-forest);
  --bs-primary-rgb: 4, 120, 87;
  --bs-primary-light: var(--es-mist);
  --bs-link-color: var(--es-forest);
  --bs-link-color-rgb: 4, 120, 87;
  --bs-link-hover-color: var(--es-forest-deep);
  --bs-link-hover-color-rgb: 5, 71, 38;
  --dt-row-selected: 4, 120, 87;
  --bs-focus-ring-color: rgba(4, 120, 87, 0.25);
  --bs-success: var(--es-success);
  --bs-success-rgb: 4, 120, 87;
  --bs-warning: var(--es-gold);
  --bs-warning-rgb: 197, 150, 24;
  --bs-danger: var(--es-danger);
  --bs-danger-rgb: 180, 35, 24;
  --bs-info: var(--es-forest);
  --bs-info-rgb: 4, 120, 87;
}

[data-pc-preset="preset-1"] .bg-light-primary {
  background: var(--es-mist);
  color: var(--es-forest);
}

[data-pc-preset="preset-1"] .link-primary {
  color: var(--es-forest) !important;
}

[data-pc-preset="preset-1"] .link-primary:hover,
[data-pc-preset="preset-1"] .link-primary:focus {
  color: var(--es-forest-deep) !important;
}

[data-pc-preset="preset-1"] .btn-primary {
  --bs-btn-color: var(--es-on-fill);
  --bs-btn-bg: var(--es-fill);
  --bs-btn-border-color: var(--es-fill);
  --bs-btn-hover-color: var(--es-on-fill);
  --bs-btn-hover-bg: var(--es-fill-hover);
  --bs-btn-hover-border-color: var(--es-fill-hover);
  --bs-btn-focus-shadow-rgb: 4, 120, 87;
  --bs-btn-active-color: var(--es-on-fill);
  --bs-btn-active-bg: var(--es-fill-hover);
  --bs-btn-active-border-color: #04361d;
  --bs-btn-disabled-color: var(--es-on-fill);
  --bs-btn-disabled-bg: var(--es-fill);
  --bs-btn-disabled-border-color: var(--es-fill);
  border-radius: var(--es-radius-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--es-fill) 28%, transparent);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

[data-pc-preset="preset-1"] .btn-primary:hover {
  filter: brightness(1.04);
}

[data-pc-preset="preset-1"] .btn-primary:active {
  transform: translateY(1px);
}

[data-pc-preset="preset-1"] .btn-link {
  --bs-btn-color: var(--es-forest);
  --bs-btn-hover-color: var(--es-forest-deep);
  --bs-btn-active-color: var(--es-forest-deep);
}

[data-pc-preset="preset-1"] .text-bg-primary,
[data-pc-preset="preset-1"] .bg-primary {
  color: var(--es-on-fill) !important;
  background-color: var(--es-fill) !important;
}

[data-pc-preset="preset-1"] .btn-light-primary {
  background: var(--es-mist);
  color: var(--es-forest);
  border-color: var(--es-mist);
}

[data-pc-preset="preset-1"] .btn-light-primary:hover,
[data-pc-preset="preset-1"] .btn-light-primary:focus {
  background: var(--es-fill);
  color: var(--es-on-fill);
  border-color: var(--es-fill);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--es-forest);
  box-shadow: 0 0 0 0.2rem var(--es-ring);
}

.form-check,
[data-pc-direction="rtl"] .form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding-left: 0;
  padding-right: 0;
  min-height: 1.5rem;
}

.form-check .form-check-input,
[data-pc-direction="rtl"] .form-check .form-check-input {
  float: none;
  margin: 0.2em 0 0;
  flex-shrink: 0;
}

.form-check .form-check-label {
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.pc-head-link {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.es-head-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.75rem;
  margin: 0 2px;
  border: 0;
  border-radius: var(--es-radius-sm);
  background: transparent;
  color: var(--es-muted);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.es-head-action i {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--es-forest);
}

.pc-header .es-head-action {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
}

.pc-header .es-head-action i {
  font-size: 1.2rem;
}

.pc-header .es-head-action.es-head-lang {
  width: auto;
  min-width: 2.75rem;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid var(--es-line);
  color: var(--es-forest-deep);
}

.pc-header .es-head-action > span:not(.es-notif-n):not(.es-lang-code):not(.es-head-avatar) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pc-header .ms-auto ul {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.es-head-action:hover,
.es-head-action:focus {
  background: var(--es-mist);
  color: var(--es-forest-deep);
  text-decoration: none;
}

.es-head-action:focus-visible {
  outline: 2px solid var(--es-forest);
  outline-offset: 2px;
}

.pc-sidebar .pc-micon i {
  color: inherit;
  font-size: 1.15rem;
  vertical-align: middle;
}

.pc-sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--es-surface) !important;
  --pc-sidebar-background: var(--es-surface);
  --pc-sidebar-color: #3a4a41;
  --pc-sidebar-color-rgb: 58, 74, 65;
  --pc-sidebar-caption-color: var(--es-muted);
  --pc-sidebar-active-color: var(--es-forest);
  --pc-sidebar-user-background: var(--es-elevated);
  --pc-sidebar-border: 1px solid var(--es-line);
  --pc-sidebar-shadow: 1px 0 0 var(--es-line);
}

html[dir="rtl"] .pc-sidebar {
  --pc-sidebar-shadow: -1px 0 0 var(--es-line);
}

html[dir="rtl"] .pc-sidebar .pc-caption label {
  letter-spacing: 0;
}

.pc-sidebar .pc-caption {
  padding: 10px 16px 2px !important;
}

.pc-sidebar .pc-caption:first-child {
  padding-top: 4px !important;
}

.pc-sidebar .pc-caption label {
  color: var(--es-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
}

.pc-sidebar .pc-navbar > .pc-item > .pc-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: var(--es-radius-sm);
  margin-inline: 8px;
  transition: background 180ms ease, color 180ms ease;
}

.pc-sidebar .card.pc-user-card {
  background: transparent;
  color: var(--es-body);
  margin: 4px 12px 8px;
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  box-shadow: none;
}

.pc-sidebar .card.pc-user-card .card-body {
  padding: 10px 12px !important;
}

.pc-sidebar .card.pc-user-card h6 {
  font-size: 0.9rem;
}

.es-id-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--es-mist);
  color: var(--es-forest-deep);
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
  padding: 0;
}

.es-id-meta-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  text-align: start;
  margin-bottom: 0.85rem;
}

.es-id-meta-row i {
  font-size: 1.25rem;
  color: var(--es-forest);
  margin-top: 0.15rem;
}

.es-shortcut {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  color: var(--es-body);
  text-decoration: none;
  background: var(--es-surface);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.es-shortcut:hover {
  background: var(--es-mist);
  color: var(--es-forest-deep);
  border-color: color-mix(in srgb, var(--es-forest) 45%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px var(--es-shadow-color);
}

.es-shortcut i {
  font-size: 1.2rem;
  color: var(--es-forest);
}

.es-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.es-jump a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: var(--es-radius-sm);
  background: var(--es-surface);
  border: 1px solid var(--es-line);
  color: var(--es-body);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.es-jump a:hover {
  border-color: color-mix(in srgb, var(--es-forest) 50%, transparent);
  color: var(--es-forest-deep);
  background: var(--es-mist);
}

.es-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.es-kpi {
  background: var(--es-surface);
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: none;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.es-kpi--link {
  text-decoration: none;
  color: inherit;
}

.es-kpi--link:hover:not(.es-kpi--accent),
.es-kpi.is-on:not(.es-kpi--accent) {
  border-color: color-mix(in srgb, var(--es-forest) 45%, transparent);
  background: var(--es-mist);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px var(--es-shadow-color);
}

.es-kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--es-muted);
}

.es-kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--es-text);
}

.es-kpi--warn {
  border-color: var(--es-warn-line);
  background: var(--es-warn-bg);
}

.es-dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.es-dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.es-nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1035;
  background: rgba(10, 18, 12, 0.4);
  pointer-events: none;
}

.es-nav-overlay.is-ready {
  pointer-events: auto;
}

.es-num,
.es-kpi-value,
.es-amt-in,
.es-amt-out {
  unicode-bidi: isolate;
  direction: ltr;
}

.es-kpi--accent {
  background: var(--es-fill);
  border-color: var(--es-fill);
  color: var(--es-on-fill);
}

.es-kpi--link.es-kpi--accent:hover,
.es-kpi--accent.is-on {
  background: var(--es-fill-hover);
  border-color: var(--es-fill-hover);
  color: var(--es-on-fill);
}

.es-kpi--accent .es-kpi-label,
.es-kpi--accent .es-kpi-value,
.es-kpi--accent small,
.es-kpi--accent .text-muted {
  color: var(--es-on-fill) !important;
}

.es-kpi--accent .es-kpi-label,
.es-kpi--accent small,
.es-kpi--accent .text-muted {
  opacity: 0.88;
}

.es-wh {
  background: var(--es-surface);
  border: 1px solid var(--es-line);
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.es-wh > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  min-height: 44px;
}

.es-wh > summary::-webkit-details-marker {
  display: none;
}

.es-wh[open] > summary {
  border-bottom: 1px solid var(--es-line);
}

.es-wh-body {
  padding: 0.75rem 1rem 1rem;
}

.es-lots > summary {
  cursor: pointer;
  color: var(--es-muted);
  font-size: 0.875rem;
}

.es-amt-in {
  color: var(--es-forest);
  font-weight: 600;
}

.es-amt-out {
  color: var(--es-danger);
  font-weight: 600;
}

.es-cheque {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  vertical-align: middle;
}

.es-cheque img {
  max-height: 72px;
  max-width: 120px;
  border-radius: 6px;
  border: 1px solid var(--es-line);
  object-fit: cover;
}

.pc-content .card-header {
  background: var(--es-elevated);
  border-bottom: 1px solid var(--es-line);
}

.pc-content .card-header h5 {
  margin-bottom: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--es-text);
}

.pc-content .table td:last-child {
  white-space: nowrap;
}

.pc-sidebar .card.pc-user-card .text-muted {
  color: var(--es-muted) !important;
}

.pc-sidebar .navbar-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.pc-sidebar .m-header {
  height: auto !important;
  padding: 8px 16px 6px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--es-line);
}

.pc-sidebar .navbar-content {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: calc(100vh - 88px) !important;
  padding: 6px 0 12px;
  overflow-x: hidden;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pc-sidebar .navbar-content .simplebar-content-wrapper {
  overflow-y: auto !important;
}

.es-brand {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.es-logo-full {
  width: min(120px, 100%);
  max-height: 68px;
  height: auto;
  display: block;
  object-fit: contain;
}

.es-logo-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
}

.es-brand-text {
  color: var(--es-forest-deep);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.pc-header {
  border-bottom: 1px solid var(--es-line);
  background: color-mix(in srgb, var(--es-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.pc-content .card {
  margin-bottom: 1.25rem;
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  box-shadow: none;
  background: var(--es-surface);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.pc-content .card:hover {
  border-color: color-mix(in srgb, var(--es-forest) 28%, var(--es-line-solid));
}

.pc-content .row > [class*="col-"] > .card {
  height: calc(100% - 1.25rem);
}

.table-hover tbody tr {
  cursor: default;
}

.es-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--es-muted);
}

.page-header-actions .btn {
  min-height: 44px;
}

.page-header-title h2 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 700;
  color: var(--es-text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header-title .text-muted {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.es-card-narrow {
  max-width: 28rem;
}

.auth-form.es-auth-wide {
  max-width: 40rem;
}

.auth-form.es-auth-wide .card {
  max-width: 40rem;
}

.pc-footer {
  border-top: 1px solid var(--es-line);
  box-shadow: none;
  color: var(--es-muted);
  background: var(--es-surface);
}

.auth-main .auth-wrapper.v1 .auth-form {
  background: var(--es-ink);
  background-image: none;
}

.auth-main .auth-wrapper.v1 .auth-form .card {
  overflow: hidden;
  border: 1px solid #1d3a28;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.es-auth-hero {
  background: var(--es-elevated);
  padding: 1rem 1rem 0.4rem;
  text-align: center;
}

.es-logo-auth {
  width: min(220px, 70vw);
  height: auto;
  display: inline-block;
}

.pc-content .table thead th {
  white-space: nowrap;
  font-weight: 700;
  color: var(--es-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--es-elevated);
  border-bottom: 1px solid var(--es-line);
  vertical-align: middle;
}

.pc-content .table > :not(caption) > * > * {
  vertical-align: middle;
}

.pc-content .table tbody td {
  border-color: var(--es-line);
}

.es-col-name {
  font-weight: 600;
  min-width: 9rem;
}

.es-col-name a {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.es-col-name a:hover {
  color: var(--es-forest);
  text-decoration: underline;
}

.es-col-id {
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.es-col-id a {
  font-weight: 650;
  text-decoration: none;
}

.es-col-id a:hover {
  text-decoration: underline;
}

.es-col-money,
.es-col-qty {
  unicode-bidi: isolate;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.es-col-money {
  font-weight: 600;
}

.es-col-money.is-over,
.es-col-money.es-amt-out {
  color: var(--es-danger);
}

.es-col-money.es-amt-in {
  color: var(--es-forest);
}

.es-col-qty.is-in {
  color: var(--es-forest);
}

.es-col-qty.is-out {
  color: var(--es-danger);
}

.es-col-date {
  white-space: nowrap;
  color: var(--es-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.es-col-phone,
.es-col-ice {
  unicode-bidi: isolate;
  direction: ltr;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.es-col-status {
  white-space: nowrap;
}

.es-col-note {
  max-width: 16rem;
  color: var(--es-muted);
  font-size: 0.875rem;
}

.es-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: end;
}

.es-col-media {
  white-space: nowrap;
}

.es-who {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.es-who-txt {
  min-width: 0;
}

.es-who-txt small {
  display: block;
  font-weight: 400;
  color: var(--es-muted);
}

.es-table-lines td .form-control,
.es-table-lines td .form-select {
  min-width: 4.25rem;
}

.es-table-ledger tbody td:nth-child(3),
.es-table-ledger tbody td:nth-child(4),
.es-table-ledger tbody td:nth-child(5),
.es-table-ledger thead th:nth-child(3),
.es-table-ledger thead th:nth-child(4),
.es-table-ledger thead th:nth-child(5) {
  unicode-bidi: isolate;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.es-table-aging tbody td:not(:first-child):not(:last-child),
.es-table-aging thead th:not(:first-child):not(:last-child) {
  unicode-bidi: isolate;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html[data-pc-theme="dark"] .pc-content .table thead th {
  background: var(--es-elevated);
  border-bottom-color: var(--es-line);
}

html[data-pc-theme="dark"] .pc-content .table tbody td {
  border-color: var(--es-line);
}

.badge {
  font-weight: 500;
}

.alert {
  border-radius: 8px;
}

.invoice-paper {
  background: #fff;
  padding: 1.5rem 2rem;
  border: 1px solid #c9d6cc;
  color: var(--es-body);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(10, 18, 12, 0.06);
}

.invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.invoice-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.es-logo-invoice {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
}

.invoice-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--es-forest-deep);
  letter-spacing: 0.02em;
}

.invoice-meta,
.invoice-date {
  font-size: 0.9rem;
}

.invoice-title {
  text-align: center;
  margin: 0.5rem 0 1rem;
  font-weight: 700;
  color: var(--es-forest-deep);
}

.invoice-title::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 2px;
  margin: 0.45rem auto 0;
  background: var(--es-gold);
}

.invoice-client {
  margin-bottom: 1rem;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid #1a2e22;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.invoice-table th {
  background: var(--es-mist);
}

.invoice-totals {
  text-align: end;
  margin-bottom: 1rem;
}

.invoice-totals p {
  margin: 0.15rem 0;
}

.invoice-ttc {
  font-size: 1.1rem;
  color: var(--es-forest-deep);
}

.invoice-stop,
.invoice-words {
  margin-bottom: 0.35rem;
}

.invoice-sign {
  text-align: end;
  margin: 2.5rem 0 1.5rem;
  min-height: 4rem;
}

.invoice-foot {
  border-top: 2px solid var(--es-gold);
  padding-top: 0.5rem;
  font-size: 0.75rem;
}

/* Night: sahmrev dark structure × ESA forest (soft sage, no neon blue). */
html[data-pc-theme="dark"] {
  color-scheme: dark;
  --es-paper: #0b1210;
  --es-surface: #121a16;
  --es-elevated: #1a231e;
  --es-input: #0f1612;
  --es-mist: #243029;
  --es-ink: #080e0b;
  --es-body: #dde8e0;
  --es-text: #eef4ef;
  --es-muted: #94a89c;
  --es-line: color-mix(in srgb, #94a89c 28%, transparent);
  --es-line-solid: #314039;
  --es-gold: #d0ae42;
  --es-gold-soft: #e0c56a;
  --es-forest: #6bb890;
  --es-forest-deep: #8ecbab;
  --es-fill: #047857;
  --es-fill-hover: #0a4a2a;
  --es-on-fill: #ffffff;
  --es-danger: #e89b96;
  --es-success: #6bb890;
  --es-warn: #d0ae42;
  --es-warn-bg: #2a2618;
  --es-warn-line: color-mix(in srgb, #d0ae42 35%, transparent);
  --es-ring: color-mix(in srgb, #6bb890 42%, transparent);
  --es-shadow-color: color-mix(in srgb, #000 45%, transparent);
  --es-shadow: 0 14px 36px var(--es-shadow-color);
  --bs-body-bg: #0b1210;
  --bs-body-bg-rgb: 11, 18, 16;
  --bs-body-color: #dde8e0;
  --bs-body-color-rgb: 221, 232, 224;
  --bs-heading-color: #eef4ef;
  --bs-secondary-color: #94a89c;
  --bs-tertiary-color: #94a89c;
  --bs-emphasis-color: #eef4ef;
  --bs-border-color: #314039;
  --bs-border-color-translucent: rgba(49, 64, 57, 0.65);
  --bs-secondary-bg: #1a231e;
  --bs-tertiary-bg: #243029;
  --bs-light: #1a231e;
  --bs-light-rgb: 26, 35, 30;
  --bs-dark: #dde8e0;
  --bs-dark-rgb: 221, 232, 224;
  --bs-gray-100: #243029;
  --bs-gray-200: #1a231e;
  --bs-gray-300: #314039;
  --bs-gray-400: #5a6d61;
  --bs-gray-500: #94a89c;
  --bs-gray-600: #b8c8bc;
  --bs-gray-700: #dde8e0;
  --bs-gray-800: #eef4ef;
  --bs-gray-900: #f4f8f5;
  --pc-heading-color: #eef4ef;
  --pc-header-background: #0f1612;
  --pc-header-color: #94a89c;
  --pc-active-background: #243029;
  --pc-header-submenu-background: #1a231e;
  --pc-card-box-shadow: none;
}

html[data-pc-theme="dark"] body {
  background: var(--es-paper);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .text-muted,
html[data-pc-theme="dark"] .form-text,
html[data-pc-theme="dark"] small.text-muted {
  color: var(--es-muted) !important;
}

html[data-pc-theme="dark"] .text-dark,
html[data-pc-theme="dark"] .link-dark {
  color: var(--es-text) !important;
}

html[data-pc-theme="dark"] .bg-white,
html[data-pc-theme="dark"] .bg-body,
html[data-pc-theme="dark"] .bg-light,
html[data-pc-theme="dark"] .bg-body-tertiary,
html[data-pc-theme="dark"] .bg-body-secondary {
  background-color: var(--es-surface) !important;
  color: var(--es-body) !important;
}

html[data-pc-theme="dark"] .card,
html[data-pc-theme="dark"] .list-group,
html[data-pc-theme="dark"] .accordion-item {
  --bs-card-border-color: var(--es-line);
  --bs-card-bg: var(--es-surface);
  --bs-card-color: var(--es-body);
  --bs-list-group-bg: var(--es-surface);
  --bs-list-group-color: var(--es-body);
  --bs-list-group-border-color: var(--es-line);
  --bs-list-group-action-hover-bg: var(--es-mist);
  --bs-list-group-action-active-bg: var(--es-mist);
  --bs-accordion-bg: var(--es-surface);
  --bs-accordion-border-color: var(--es-line);
  --bs-accordion-btn-bg: var(--es-elevated);
  --bs-accordion-active-bg: var(--es-mist);
  --bs-accordion-btn-color: var(--es-body);
  --bs-accordion-active-color: var(--es-text);
  background-color: var(--es-surface);
  color: var(--es-body);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .dropdown-menu {
  --bs-dropdown-bg: var(--es-elevated);
  --bs-dropdown-color: var(--es-body);
  --bs-dropdown-link-color: var(--es-body);
  --bs-dropdown-link-hover-bg: var(--es-mist);
  --bs-dropdown-link-hover-color: var(--es-text);
  --bs-dropdown-link-active-bg: var(--es-mist);
  --bs-dropdown-divider-bg: var(--es-line);
  --bs-dropdown-border-color: var(--es-line);
  background: var(--es-elevated);
  color: var(--es-body);
  border-color: var(--es-line);
  box-shadow: var(--es-shadow);
}

html[data-pc-theme="dark"] .modal-content,
html[data-pc-theme="dark"] .offcanvas,
html[data-pc-theme="dark"] .offcanvas-xxl,
html[data-pc-theme="dark"] .offcanvas-xl,
html[data-pc-theme="dark"] .offcanvas-lg,
html[data-pc-theme="dark"] .offcanvas-md,
html[data-pc-theme="dark"] .offcanvas-sm {
  --bs-modal-bg: var(--es-surface);
  --bs-modal-color: var(--es-body);
  --bs-modal-border-color: var(--es-line);
  --bs-modal-header-border-color: var(--es-line);
  --bs-modal-footer-border-color: var(--es-line);
  --bs-offcanvas-bg: var(--es-surface);
  --bs-offcanvas-color: var(--es-body);
  background: var(--es-surface);
  color: var(--es-body);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .modal-header,
html[data-pc-theme="dark"] .modal-footer {
  background: var(--es-elevated);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .pc-sidebar {
  background: var(--es-ink) !important;
  --pc-sidebar-background: var(--es-ink);
  --pc-sidebar-color: #c2d3c8;
  --pc-sidebar-color-rgb: 194, 211, 200;
  --pc-sidebar-caption-color: var(--es-muted);
  --pc-sidebar-active-color: var(--es-forest-deep);
  --pc-sidebar-user-background: var(--es-elevated);
  --pc-sidebar-border: 1px solid var(--es-line);
  --pc-sidebar-shadow: 4px 0 24px rgba(0, 0, 0, 0.32);
}

html[dir="rtl"][data-pc-theme="dark"] .pc-sidebar {
  --pc-sidebar-shadow: -4px 0 24px rgba(0, 0, 0, 0.32);
}

html[data-pc-theme="dark"] .pc-sidebar .pc-caption label {
  color: var(--es-muted);
}

html[data-pc-theme="dark"] .es-shortcut,
html[data-pc-theme="dark"] .es-jump a,
html[data-pc-theme="dark"] .es-kpi,
html[data-pc-theme="dark"] .es-wh {
  background: var(--es-surface);
  border-color: var(--es-line);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-shortcut:hover,
html[data-pc-theme="dark"] .es-jump a:hover,
html[data-pc-theme="dark"] .es-kpi--link:hover:not(.es-kpi--accent),
html[data-pc-theme="dark"] .es-kpi.is-on:not(.es-kpi--accent) {
  background: var(--es-mist);
  border-color: color-mix(in srgb, var(--es-forest) 55%, var(--es-line));
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-kpi-value {
  color: var(--es-forest-deep);
}

html[data-pc-theme="dark"] .es-kpi--accent .es-kpi-value {
  color: var(--es-on-fill) !important;
}

html[data-pc-theme="dark"] .es-wh[open] > summary {
  border-bottom-color: var(--es-line);
}

html[data-pc-theme="dark"] .es-amt-in {
  color: var(--es-forest-deep);
}

html[data-pc-theme="dark"] .es-amt-out {
  color: var(--es-danger);
}

html[data-pc-theme="dark"] .es-id-avatar {
  background: var(--es-mist);
  color: var(--es-forest-deep);
}

html[data-pc-theme="dark"] [data-pc-preset="preset-1"] {
  --pc-sidebar-active-color: var(--es-forest-deep);
  --bs-primary: var(--es-fill);
  --bs-primary-rgb: 4, 120, 87;
  --bs-primary-light: var(--es-mist);
  --bs-link-color: var(--es-forest-deep);
  --bs-link-hover-color: #b6dfc6;
  --bs-link-color-rgb: 142, 203, 171;
  --bs-focus-ring-color: rgba(107, 184, 144, 0.35);
}

html[data-pc-theme="dark"] [data-pc-preset="preset-1"] .btn-primary {
  --bs-btn-color: var(--es-on-fill);
  --bs-btn-bg: var(--es-fill);
  --bs-btn-border-color: var(--es-fill);
  --bs-btn-hover-bg: var(--es-fill-hover);
  --bs-btn-hover-border-color: var(--es-fill-hover);
  --bs-btn-active-bg: #04361d;
  --bs-btn-disabled-bg: var(--es-fill);
}

html[data-pc-theme="dark"] [data-pc-preset="preset-1"] .bg-light-primary,
html[data-pc-theme="dark"] [data-pc-preset="preset-1"] .btn-light-primary {
  background: var(--es-mist) !important;
  color: var(--es-forest-deep) !important;
  border-color: var(--es-line) !important;
}

html[data-pc-theme="dark"] .btn-light,
html[data-pc-theme="dark"] .btn-outline-secondary,
html[data-pc-theme="dark"] .btn-outline-dark {
  --bs-btn-color: var(--es-body);
  --bs-btn-bg: var(--es-elevated);
  --bs-btn-border-color: var(--es-line);
  --bs-btn-hover-color: var(--es-text);
  --bs-btn-hover-bg: var(--es-mist);
  --bs-btn-hover-border-color: var(--es-forest);
  --bs-btn-active-bg: var(--es-mist);
  --bs-btn-active-border-color: var(--es-forest);
  color: var(--es-body);
  background: var(--es-elevated);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info) {
  --bs-btn-color: var(--es-body);
}

html[data-pc-theme="dark"] .pc-header {
  border-bottom-color: var(--es-line);
  background: var(--pc-header-background);
  box-shadow: none;
}

html[data-pc-theme="dark"] .pc-content .card {
  border-color: var(--es-line);
  background: var(--es-surface);
  box-shadow: none;
}

html[data-pc-theme="dark"] .pc-content .card-header {
  background: var(--es-elevated);
  border-bottom-color: var(--es-line);
  color: var(--es-text);
}

html[data-pc-theme="dark"] .pc-footer {
  border-top-color: var(--es-line);
  background: var(--pc-header-background);
  box-shadow: none;
  color: var(--es-muted);
}

html[data-pc-theme="dark"] .es-head-action {
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-head-action i {
  color: var(--es-gold-soft);
}

html[data-pc-theme="dark"] .es-head-action:hover,
html[data-pc-theme="dark"] .es-head-action:focus {
  background: var(--es-mist);
  color: var(--es-text);
}

html[data-pc-theme="dark"] .form-control,
html[data-pc-theme="dark"] .form-select,
html[data-pc-theme="dark"] .input-group-text,
html[data-pc-theme="dark"] .form-control:disabled,
html[data-pc-theme="dark"] .form-select:disabled {
  background-color: var(--es-input);
  color: var(--es-body);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .form-control::placeholder {
  color: color-mix(in srgb, var(--es-muted) 85%, transparent);
}

html[data-pc-theme="dark"] .form-control:focus,
html[data-pc-theme="dark"] .form-select:focus {
  border-color: var(--es-forest);
  box-shadow: 0 0 0 0.2rem rgba(107, 184, 144, 0.22);
  background-color: var(--es-input);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .form-check-input {
  background-color: var(--es-input);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .form-check-input:checked {
  background-color: var(--es-fill);
  border-color: var(--es-fill);
}

html[data-pc-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--es-body);
  --bs-table-border-color: var(--es-line);
  --bs-table-hover-bg: var(--es-mist);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-striped-color: var(--es-body);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .pc-content .table thead th {
  color: var(--es-muted);
  background: var(--es-elevated);
}

html[data-pc-theme="dark"] .page-header-title h2,
html[data-pc-theme="dark"] h1,
html[data-pc-theme="dark"] h2,
html[data-pc-theme="dark"] h3,
html[data-pc-theme="dark"] h4,
html[data-pc-theme="dark"] h5,
html[data-pc-theme="dark"] h6,
html[data-pc-theme="dark"] .h1,
html[data-pc-theme="dark"] .h2,
html[data-pc-theme="dark"] .h3,
html[data-pc-theme="dark"] .h4,
html[data-pc-theme="dark"] .h5,
html[data-pc-theme="dark"] .h6 {
  color: var(--es-text);
}

html[data-pc-theme="dark"] .auth-main .auth-wrapper.v1 .auth-form {
  background: var(--es-paper);
  background-image: none;
}

html[data-pc-theme="dark"] .auth-main .auth-wrapper.v1 .auth-form .card {
  border-color: var(--es-line);
  background: var(--es-surface);
}

html[data-pc-theme="dark"] .pc-sidebar .card.pc-user-card {
  background: var(--es-elevated);
  color: var(--es-body);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .pc-sidebar .m-header {
  border-bottom-color: var(--es-line);
}

html[data-pc-theme="dark"] .pc-sidebar .pc-navbar .pc-item > .pc-link:hover,
html[data-pc-theme="dark"] .pc-sidebar .pc-navbar .pc-item.active > .pc-link,
html[data-pc-theme="dark"] .pc-sidebar .pc-navbar .pc-hasmenu.pc-trigger > .pc-link {
  background: var(--es-mist);
  color: var(--es-text);
}

html[data-pc-theme="dark"] .es-logo-full,
html[data-pc-theme="dark"] .es-logo-auth,
html[data-pc-theme="dark"] .es-logo-mark {
  filter: brightness(1.22) contrast(1.05) saturate(1.05);
}

html[data-pc-theme="dark"] .invoice-paper {
  background: #fff;
  color: #1a2e22;
}

html[data-pc-theme="dark"] .page-link {
  background-color: var(--es-surface);
  border-color: var(--es-line);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .page-item.active .page-link {
  background-color: var(--es-fill);
  border-color: var(--es-fill);
  color: var(--es-on-fill);
}

html[data-pc-theme="dark"] .page-item.disabled .page-link {
  background-color: var(--es-elevated);
  color: var(--es-muted);
}

html[data-pc-theme="dark"] .nav-tabs {
  border-bottom-color: var(--es-line);
}

html[data-pc-theme="dark"] .nav-tabs .nav-link {
  color: var(--es-muted);
}

html[data-pc-theme="dark"] .nav-tabs .nav-link.active {
  background: var(--es-surface);
  border-color: var(--es-line) var(--es-line) var(--es-surface);
  color: var(--es-text);
}

html[data-pc-theme="dark"] .progress {
  background-color: var(--es-mist);
}

html[data-pc-theme="dark"] .breadcrumb {
  --bs-breadcrumb-divider-color: var(--es-muted);
  --bs-breadcrumb-item-active-color: var(--es-muted);
}

html[data-pc-theme="dark"] hr {
  border-color: var(--es-line);
  opacity: 1;
}

html[data-pc-theme="dark"] .border,
html[data-pc-theme="dark"] .border-top,
html[data-pc-theme="dark"] .border-bottom,
html[data-pc-theme="dark"] .border-start,
html[data-pc-theme="dark"] .border-end {
  border-color: var(--es-line) !important;
}

body {
  overscroll-behavior-y: contain;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
  max-width: 100%;
}

body.es-nav-open {
  overflow: hidden;
}

.es-offline {
  position: sticky;
  top: 0;
  z-index: 1080;
  padding: 0.7rem 1rem;
  background: var(--es-gold);
  color: var(--es-ink);
  text-align: center;
  font-weight: 600;
}

.es-offline[hidden] {
  display: none !important;
}

.btn,
.pc-link,
a {
  touch-action: manipulation;
}

.es-savebar .btn {
  min-height: 44px;
}

.pc-header {
  padding-top: env(safe-area-inset-top);
}

.es-header .header-wrapper {
  align-items: center;
  gap: 0.75rem;
  padding-inline: 1rem;
}

.es-header .es-head-start {
  flex: 1 1 auto;
  min-width: 0;
}

.es-header .es-head-start ul {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.45rem;
}

.es-header .es-head-search-item {
  flex: 1 1 auto;
  min-width: 0;
}

.es-header .es-head-end {
  flex-shrink: 0;
}

.pc-container,
.pc-content {
  min-width: 0;
  max-width: 100%;
}

.es-header .pc-head-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--es-forest);
  cursor: pointer;
  appearance: none;
}

.es-header .pc-head-link:hover,
.es-header .pc-head-link:focus {
  background: var(--es-mist);
  color: var(--es-forest-deep);
}

@media (max-width: 1024px) {
  .pc-header,
  .pc-header .pc-h-item {
    min-height: 52px;
  }

  .pc-container {
    top: 52px !important;
    min-height: calc(100vh - 52px);
  }

  .page-header {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .es-header .header-wrapper {
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding-inline: 0.5rem;
  }

  .pc-sidebar {
    left: -280px !important;
    right: auto !important;
    z-index: 1040;
  }

  .pc-sidebar.mob-sidebar-active {
    left: 0 !important;
    right: auto !important;
  }

  html[dir="rtl"] .pc-sidebar,
  [data-pc-direction="rtl"] .pc-sidebar {
    left: auto !important;
    right: -280px !important;
  }

  html[dir="rtl"] .pc-sidebar.mob-sidebar-active,
  [data-pc-direction="rtl"] .pc-sidebar.mob-sidebar-active {
    left: auto !important;
    right: 0 !important;
  }

  body.es-nav-open .pc-header {
    z-index: 1045;
  }
}

@media (max-width: 767.98px) {
  .pc-header .es-head-action {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
  }

  .es-header .es-head-end {
    padding: 0;
  }

  .pc-content {
    padding: 0.75rem 0.7rem 1.25rem;
  }

  .page-block {
    flex-direction: column;
    align-items: stretch !important;
  }

  .page-header-title {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .page-header-title h2 {
    font-size: 1.1rem;
  }

  .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  .page-header-actions .btn {
    justify-content: center;
  }

  .es-dash-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .es-dash-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .es-dash-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .es-dash-actions > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .form-control,
  .form-select,
  .btn {
    font-size: 16px;
  }

  .table {
    font-size: 0.92rem;
  }

  .es-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .es-kpi-row > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .pc-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .es-savebar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -0.7rem;
    padding: 0.65rem 0.7rem calc(0.65rem + env(safe-area-inset-bottom));
    background: var(--es-paper);
    box-shadow: 0 -6px 18px rgba(10, 18, 12, 0.08);
  }

  .es-savebar .btn {
    width: 100%;
  }

  html[data-pc-theme="dark"] .es-savebar {
    background: var(--pc-header-background);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35);
  }

  .modal-dialog {
    margin-inline: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .dropdown-menu {
    max-width: min(22rem, calc(100vw - 1rem));
  }

  /* ponytail: do NOT set overflow on .card-body — overflow-x:auto forces overflow-y:auto
     and traps vertical page scroll inside tall cards (stock.php especially). */
}

@media (max-width: 479.98px) {
  .es-login-logo {
    width: min(112px, 46vw);
  }

  .es-login-title {
    font-size: 1.28rem;
  }
}

@media (max-width: 991.98px) and (max-height: 640px) {
  .es-login-visual {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Login split: brand forest + harvest photo. Scoped so install/fournisseur keep old auth card. */
.es-login-page {
  margin: 0;
  min-height: 100dvh;
  background: var(--es-paper);
}

.es-login {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
}

.es-login-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.85rem 1.15rem calc(1.25rem + env(safe-area-inset-bottom));
  background: var(--es-paper);
}

.es-login-tools {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.es-login-tools .es-head-action {
  color: var(--es-body);
}

.es-login-tools .es-head-action i {
  color: var(--es-forest);
}

.es-login-card {
  width: min(26rem, 100%);
  margin: auto;
  padding: 0.5rem 0 0;
}

.es-login-logo {
  display: block;
  width: min(148px, 52vw);
  height: auto;
  margin: 0 0 0.85rem;
}

.es-login-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--es-forest-deep);
  letter-spacing: -0.03em;
}

.es-login-tag {
  margin: 0 0 1.35rem;
  color: var(--es-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 26rem;
}

.es-login-field {
  margin-bottom: 0.95rem;
}

.es-login-field .form-label {
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--es-body);
}

.es-login-control {
  position: relative;
}

.es-login-control > i:first-child {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  right: auto;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--es-forest);
  pointer-events: none;
}

html[dir="rtl"] .es-login-control > i:first-child {
  right: 0.85rem;
  left: auto;
}

.es-login-page .es-login-control .form-control {
  min-height: 48px;
  padding-left: 2.65rem;
  padding-right: 0.95rem;
  border-radius: 12px;
  border-color: var(--es-line);
  background: var(--es-surface);
  color: var(--es-body);
}

html[dir="rtl"] .es-login-page .es-login-control .form-control {
  padding-right: 2.65rem;
  padding-left: 0.95rem;
}

.es-login-control--pass .form-control {
  padding-right: 2.75rem;
}

html[dir="rtl"] .es-login-control--pass .form-control {
  padding-left: 2.75rem;
  padding-right: 2.65rem;
}

.es-login-page .es-login-control .form-control:focus {
  border-color: var(--es-forest);
  box-shadow: 0 0 0 0.2rem var(--es-ring);
}

.es-login-eye {
  position: absolute;
  top: 50%;
  right: 0.15rem;
  left: auto;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--es-muted);
  cursor: pointer;
}

html[dir="rtl"] .es-login-eye {
  left: 0.15rem;
  right: auto;
}

.es-login-eye:hover,
.es-login-eye:focus-visible {
  color: var(--es-forest-deep);
  background: var(--es-mist);
  outline: none;
}

.es-login-remember {
  min-height: 44px;
  align-items: center;
  margin: 0.15rem 0 1.15rem;
}

.es-login-remember .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0;
  cursor: pointer;
  border-color: var(--es-line);
}

.es-login-remember .form-check-input:checked {
  background-color: var(--es-fill);
  border-color: var(--es-fill);
}

.es-login-remember .form-check-label {
  cursor: pointer;
  color: var(--es-body);
}

.es-login-submit {
  width: 100%;
  min-height: 2.85rem;
  border-radius: var(--es-radius-sm);
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.es-login-submit:active {
  transform: scale(0.98);
}

.es-login-hint {
  margin: 1.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--es-muted);
}

.es-login-visual {
  display: block;
  position: relative;
  overflow: hidden;
  order: -1;
  height: 26vh;
  min-height: 128px;
  max-height: 200px;
  background: var(--es-forest-deep);
}

.es-login-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.es-login-visual-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 71, 38, 0.18) 0%, rgba(10, 18, 12, 0.42) 100%);
  pointer-events: none;
}

@media (min-width: 992px) {
  .es-login {
    grid-template-columns: minmax(26rem, 32rem) minmax(0, 1fr);
  }

  .es-login-pane {
    min-height: 100dvh;
    padding: 1.25rem 2.4rem 2rem;
  }

  .es-login-visual {
    order: 0;
    height: auto;
    min-height: 100dvh;
    max-height: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .es-login-pane {
    animation: es-login-in 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes es-login-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

html[data-pc-theme="dark"] .es-login-page,
html[data-pc-theme="dark"] .es-login-pane {
  background: var(--es-paper);
}

html[data-pc-theme="dark"] .es-login-title {
  color: var(--es-text);
}

html[data-pc-theme="dark"] .es-login-tag,
html[data-pc-theme="dark"] .es-login-hint {
  color: var(--es-muted);
}

html[data-pc-theme="dark"] .es-login-field .form-label,
html[data-pc-theme="dark"] .es-login-remember .form-check-label {
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-login-page .es-login-control .form-control {
  background: var(--es-input);
  border-color: var(--es-line);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-login-page .es-login-control .form-control:focus {
  border-color: var(--es-gold);
  box-shadow: 0 0 0 0.2rem rgba(208, 174, 66, 0.22);
}

html[data-pc-theme="dark"] .es-login-page .es-login-control i,
html[data-pc-theme="dark"] .es-login-page .es-login-control .ph-duotone {
  color: var(--es-gold-soft);
}

html[data-pc-theme="dark"] .es-login-page .es-head-action {
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-login-page .es-head-action i {
  color: var(--es-gold-soft);
}

html[data-pc-theme="dark"] .es-login-page .es-head-action:hover,
html[data-pc-theme="dark"] .es-login-page .es-head-action:focus {
  background: var(--es-mist);
  color: var(--es-text);
}

html[data-pc-theme="dark"] .es-login-visual-mask {
  background:
    linear-gradient(180deg, rgba(8, 20, 14, 0.15) 0%, rgba(14, 20, 17, 0.72) 55%, var(--es-paper) 100%);
}

.es-head-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 36rem;
  min-width: 0;
  margin-inline-start: 0;
  padding: 0 0.9rem;
  min-height: 40px;
  border: 1px solid var(--es-line);
  border-radius: 8px;
  background: var(--es-input);
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.es-head-search:focus-within {
  border-color: var(--es-forest);
  background: var(--es-surface);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

.es-head-search-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  flex-shrink: 0;
  border-radius: 0;
  background: transparent;
}

.es-head-search-ico i,
.es-head-search .es-head-search-ico i {
  color: var(--es-muted);
  font-size: 1.05rem;
}

.pc-header .es-head-action.es-head-profile {
  overflow: visible;
  background: transparent;
}

.pc-header .es-head-action.es-head-profile:hover,
.pc-header .es-head-action.es-head-profile:focus {
  background: transparent;
}

.es-head-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--es-forest-deep);
  background: var(--es-mist);
  box-shadow: 0 0 0 1px var(--es-line);
}

.pc-header .es-head-action.es-head-profile:hover .es-head-avatar,
.pc-header .es-head-action.es-head-profile:focus .es-head-avatar {
  box-shadow: 0 0 0 2px var(--es-forest);
}

.es-head-search i {
  color: var(--es-forest);
  font-size: 1.1rem;
}

.es-head-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--es-body);
  font: inherit;
  outline: none;
}

.es-head-search input::placeholder {
  color: var(--es-muted);
}

.pc-sidebar .pc-badge {
  margin-inline-start: auto;
  min-width: 1.25rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--es-fill);
  color: var(--es-on-fill);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.4;
}

html[data-pc-theme="dark"] .es-head-search {
  background: var(--es-elevated);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .es-head-search:focus-within {
  border-color: var(--es-forest);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.28);
}

html[data-pc-theme="dark"] .es-head-avatar {
  box-shadow: 0 0 0 1px var(--es-line);
}

html[data-pc-theme="dark"] .es-header .pc-head-link {
  color: var(--es-forest-deep);
}

html[data-pc-theme="dark"] .es-header .pc-head-link:hover,
html[data-pc-theme="dark"] .es-header .pc-head-link:focus {
  background: var(--es-mist);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .pc-header .es-head-action.es-head-lang {
  background: transparent;
  border-color: var(--es-line);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-head-search input {
  color: var(--es-body);
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  .pc-sidebar,
  .pc-header,
  .pc-footer,
  .page-header,
  .loader-bg,
  .no-print,
  .alert,
  details.es-wh {
    display: none !important;
  }

  .pc-container,
  .pc-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .invoice-paper {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .es-print-only {
    display: block !important;
  }

  body {
    background: #fff !important;
  }
}

.es-print-only {
  display: none;
}

.es-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.es-load-sheet .es-price {
  display: none !important;
}

.es-notif-btn {
  position: relative;
}

.es-notif-btn.dropdown-toggle::after,
.es-head-profile.dropdown-toggle::after {
  display: none;
}

.es-account-drop {
  width: min(16.5rem, 92vw);
  padding: 0.45rem 0;
  border-radius: 12px;
  border-color: var(--es-line);
  box-shadow: 0 10px 28px rgba(10, 18, 12, 0.12);
}

.es-account-name {
  padding: 0.55rem 1rem 0.35rem;
  font-weight: 700;
  color: var(--es-text);
}

.es-account-label {
  padding: 0.55rem 1rem 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--es-muted);
}

.es-account-drop .dropdown-item {
  padding: 0.55rem 1rem;
  color: var(--es-text);
}

.es-account-opt {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: calc(100% - 0.7rem);
  margin: 0.12rem 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--es-text);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.es-account-opt i {
  font-size: 1.1rem;
  color: var(--es-muted);
}

.es-account-opt:hover,
.es-account-opt:focus {
  background: var(--es-mist);
  color: var(--es-text);
  text-decoration: none;
}

.es-account-opt.is-on {
  background: var(--es-mist);
}

.es-account-logout {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
}

.es-account-drop .dropdown-divider {
  margin: 0.35rem 0;
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .es-account-drop {
  background: var(--es-surface);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .es-account-opt:hover,
html[data-pc-theme="dark"] .es-account-opt:focus,
html[data-pc-theme="dark"] .es-account-opt.is-on {
  background: var(--es-mist);
}

.es-notif-n {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--es-danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.es-notif-n[hidden] {
  display: none;
}

html[data-pc-theme="dark"] .es-notif-n {
  box-shadow: 0 0 0 2px var(--es-paper);
}

.es-notif-drop {
  width: min(22rem, 92vw);
  max-height: 22rem;
  overflow: auto;
  padding: 0.35rem 0;
}

.es-notif-head,
.es-notif-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 1rem;
}

.es-notif-item {
  white-space: normal;
  line-height: 1.35;
}

.es-notif-item.unread {
  font-weight: 600;
}

.es-form-modal .modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.es-form-modal .modal-body {
  overflow: hidden;
}

.es-form-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--pc-body-bg, var(--es-paper));
}

.es-bare {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--pc-body-bg, var(--es-paper));
  display: flex;
  flex-direction: column;
}

html:has(body.es-bare) {
  height: 100%;
  overflow: hidden;
}

.es-bare-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  overflow: hidden;
}

.es-bare .card {
  border: 0;
  box-shadow: none;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.es-bare .card > .card-header {
  display: none;
}

.es-bare .card > .card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0.75rem !important;
}

.es-bare form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.es-bare .es-embed-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

/* Footer save: in flow under the scroll pane — never covers the table. */
.es-bare .es-savebar {
  position: static;
  flex: 0 0 auto;
  display: flex;
  justify-content: stretch;
  gap: 0.5rem;
  margin: 0;
  padding: 0.65rem 0 calc(0.35rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--es-line);
  background: var(--es-paper);
  box-shadow: none;
  z-index: auto;
}

.es-table-dense td,
.es-table-dense th {
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.es-table-dense td.es-wrap,
.es-table-dense td:nth-child(3),
.es-table-dense td:nth-child(8) {
  white-space: normal;
  min-width: 8rem;
}


html[data-pc-theme="dark"] .es-bare .es-savebar {
  background: var(--pc-header-background);
  box-shadow: none;
}

.es-disc-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--es-muted);
  line-height: 1.2;
}

.es-disc-note:empty {
  display: none;
}

.pc-sidebar .pc-navbar .pc-item > .pc-link {
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 140ms ease, color 140ms ease;
}

.pc-sidebar .pc-navbar .pc-item > .pc-link:hover {
  background: var(--es-mist);
}

.pc-sidebar .pc-navbar .pc-item.active > .pc-link,
.pc-sidebar .pc-navbar .pc-hasmenu.pc-trigger > .pc-link {
  background: var(--es-mist);
  color: var(--es-forest);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--es-forest);
}

html[dir="rtl"] .pc-sidebar .pc-navbar .pc-item.active > .pc-link,
html[dir="rtl"] .pc-sidebar .pc-navbar .pc-hasmenu.pc-trigger > .pc-link {
  box-shadow: inset -3px 0 0 var(--es-forest);
}

.pc-sidebar .pc-submenu .pc-link {
  border-radius: 8px;
  margin-inline: 8px;
}

.pc-content .card-body .form-control,
.pc-content .card-body .form-select,
.modal-body .form-control,
.modal-body .form-select {
  border-radius: 6px;
  border-color: var(--es-line);
  min-height: 40px;
}

.pc-content .btn,
.modal-body .btn,
.page-header-actions .btn {
  border-radius: 6px;
}

.pc-content .alert {
  border: 1px solid var(--es-line);
  border-radius: 8px;
}

.pc-content .alert-success {
  background: var(--es-mist);
  color: var(--es-forest-deep);
  border-color: var(--es-line);
}

.pc-content .alert-warning,
.alert-warning {
  background: var(--es-warn-bg);
  color: var(--es-body);
  border-color: var(--es-warn-line);
}

.pc-content .alert-danger,
.alert-danger {
  background: color-mix(in srgb, var(--es-danger) 12%, var(--es-surface));
  color: var(--es-body);
  border-color: color-mix(in srgb, var(--es-danger) 35%, var(--es-line));
}

.bg-light-warning,
.badge.bg-light-warning,
.btn-light-warning {
  background: var(--es-warn-bg) !important;
  color: var(--es-warn) !important;
  border-color: var(--es-warn-line) !important;
}

.bg-light-success,
.badge.bg-light-success {
  background: var(--es-mist) !important;
  color: var(--es-forest) !important;
}

.bg-light-danger,
.badge.bg-light-danger {
  background: color-mix(in srgb, var(--es-danger) 12%, var(--es-surface)) !important;
  color: var(--es-danger) !important;
}

.text-warning {
  color: var(--es-warn) !important;
}

.text-success {
  color: var(--es-forest) !important;
}

.text-danger {
  color: var(--es-danger) !important;
}

[data-pc-preset="preset-1"] .btn-warning {
  --bs-btn-color: #1a1608;
  --bs-btn-bg: var(--es-gold);
  --bs-btn-border-color: var(--es-gold);
  --bs-btn-hover-color: #1a1608;
  --bs-btn-hover-bg: var(--es-gold-soft);
  --bs-btn-hover-border-color: var(--es-gold-soft);
  --bs-btn-active-bg: #a67c12;
  --bs-btn-active-border-color: #a67c12;
  --bs-btn-disabled-bg: var(--es-gold);
  --bs-btn-disabled-border-color: var(--es-gold);
}

[data-pc-preset="preset-1"] .btn-success {
  --bs-btn-color: var(--es-on-fill);
  --bs-btn-bg: var(--es-fill);
  --bs-btn-border-color: var(--es-fill);
  --bs-btn-hover-bg: var(--es-fill-hover);
  --bs-btn-hover-border-color: var(--es-fill-hover);
  --bs-btn-active-bg: #04361d;
}

[data-pc-preset="preset-1"] .text-bg-warning,
[data-pc-preset="preset-1"] .bg-warning {
  color: #1a1608 !important;
  background-color: var(--es-gold) !important;
}

[data-pc-preset="preset-1"] .text-bg-success,
[data-pc-preset="preset-1"] .bg-success {
  color: var(--es-on-fill) !important;
  background-color: var(--es-fill) !important;
}

.pc-content .dropdown-menu,
.es-notif-drop {
  border-radius: 8px;
  border-color: var(--es-line);
  box-shadow: 0 8px 24px rgba(10, 18, 12, 0.08);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: 8px 0;
  min-height: 0;
}

.page-header-title h2 {
  letter-spacing: -0.015em;
  color: var(--es-text);
}

.modal-content {
  border-radius: 8px;
  border-color: var(--es-line);
  box-shadow: 0 16px 40px rgba(10, 18, 12, 0.12);
}

.modal-header {
  border-bottom-color: var(--es-line);
  background: var(--es-surface);
}

.loader-bg {
  background: var(--es-paper);
}

.loader-bg .loader-fill {
  background: var(--es-fill);
}

html[data-pc-theme="dark"] .pc-content .card-body .form-control,
html[data-pc-theme="dark"] .pc-content .card-body .form-select,
html[data-pc-theme="dark"] .modal-body .form-control,
html[data-pc-theme="dark"] .modal-body .form-select {
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .pc-content .dropdown-menu,
html[data-pc-theme="dark"] .es-notif-drop {
  border-color: var(--es-line);
  background: var(--es-surface);
}

html[data-pc-theme="dark"] .modal-content {
  border-color: var(--es-line);
  background: var(--es-surface);
}

html[data-pc-theme="dark"] .modal-header {
  background: var(--es-elevated);
  border-bottom-color: var(--es-line);
}

/* —— F3: clearer UI + responsive polish —— */
.pc-content .btn {
  min-height: 2.5rem;
  padding-inline: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pc-content .btn-sm {
  min-height: 2.15rem;
  padding-inline: 0.75rem;
  font-weight: 600;
}

.pc-content .btn-primary,
.page-header-actions .btn-primary {
  box-shadow: 0 1px 0 rgba(10, 18, 12, 0.06);
}

.pc-content .btn-outline-primary {
  border-width: 1.5px;
  font-weight: 600;
}

.pc-content .form-label {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--es-muted);
  margin-bottom: 0.28rem;
}

.pc-content .form-control,
.pc-content .form-select {
  min-height: 2.55rem;
  border-radius: 8px;
}

.pc-content .card {
  border-radius: 12px;
  overflow: visible;
}

.pc-content .card-body {
  padding: 1rem 1.1rem 1.15rem;
  overflow: visible;
}

.pc-content .table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--es-muted);
  white-space: nowrap;
  border-bottom-width: 1px;
}

.pc-content .table tbody td {
  vertical-align: middle;
}

.pc-content .table-responsive {
  border-radius: 8px;
  border: 1px solid var(--es-line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--es-paper) 30%, transparent),
    linear-gradient(to left, var(--es-paper) 30%, transparent) 100% 0,
    linear-gradient(to right, rgba(10, 18, 12, 0.07), transparent),
    linear-gradient(to left, rgba(10, 18, 12, 0.07), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 28px 100%, 28px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

.pc-content .table-responsive > .table {
  margin-bottom: 0;
  border: 0;
}

.pc-content .card-body > .mb-3:has(> a.btn-sm),
.pc-content .card-body > .mb-3:has(> .btn-sm) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1rem !important;
  background: var(--es-mist);
  border: 1px solid var(--es-line);
  border-radius: 10px;
}

.pc-content .card-body > .mb-3:has(> a.btn-sm) > .btn-sm,
.pc-content .card-body > .mb-3:has(> .btn-sm) > .btn-sm {
  flex: 1 1 auto;
  min-width: 5.5rem;
  justify-content: center;
}

.pc-content form.row.g-2.align-items-end {
  padding: 0.85rem 0.9rem;
  margin-bottom: 1rem !important;
  background: var(--es-surface);
  border: 1px solid var(--es-line);
  border-radius: 10px;
}

.pc-content form.row.g-2.align-items-end .col-12 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.25rem;
}

.pc-content form.row.g-2.align-items-end .col-12 .btn {
  min-height: 44px;
}

.es-pager {
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.es-pager .btn {
  min-width: 6.5rem;
  min-height: 44px;
  justify-content: center;
}

.es-pager .es-pager-meta {
  font-weight: 600;
  color: var(--es-muted);
}

@media (min-width: 768px) and (max-width: 1024px) {
  .pc-content {
    padding-inline: 0.9rem;
  }

  .es-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .page-header-actions .btn {
    min-height: 44px;
  }
}

@media (max-width: 767.98px) {
  .page-header {
    gap: 0.65rem;
    margin-bottom: 0.9rem;
  }

  .page-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
  }

  .page-header-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .page-header-actions > :only-child,
  .page-header-actions > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .pc-content .card-body {
    padding: 0.85rem 0.8rem 1rem;
  }

  .pc-content form.row.g-2.align-items-end {
    padding: 0.75rem;
  }

  .pc-content form.row.g-2.align-items-end > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .pc-content form.row.g-2.align-items-end .col-12 .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .pc-content form.row.g-2.align-items-end .col-12 .btn:only-child,
  .pc-content form.row.g-2.align-items-end .col-12 .btn:last-child:nth-child(odd) {
    flex: 1 1 100%;
  }

  .pc-content .table-responsive {
    margin-inline: -0.15rem;
  }

  .es-table-lines .form-control,
  .es-table-lines .form-select {
    min-height: 44px;
    min-width: 4.5rem;
  }

  .es-account-drop,
  .es-notif-drop {
    width: min(20rem, calc(100vw - 1.25rem));
    max-width: calc(100vw - 1.25rem);
  }

  .es-pager {
    flex-direction: column;
    align-items: stretch !important;
  }

  .es-pager .btn {
    width: 100%;
  }

  .es-pager .es-pager-meta {
    order: -1;
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 379.98px) {
  .es-kpi-row {
    grid-template-columns: 1fr;
  }

  .es-dash-actions {
    grid-template-columns: 1fr;
  }

  .page-header-actions {
    grid-template-columns: 1fr;
  }
}

html[data-pc-theme="dark"] .pc-content .table-responsive {
  background:
    linear-gradient(to right, var(--es-paper) 30%, transparent),
    linear-gradient(to left, var(--es-paper) 30%, transparent) 100% 0,
    linear-gradient(to right, rgba(0, 0, 0, 0.35), transparent),
    linear-gradient(to left, rgba(0, 0, 0, 0.35), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 28px 100%, 28px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .pc-content form.row.g-2.align-items-end,
html[data-pc-theme="dark"] .pc-content .card-body > .mb-3:has(> a.btn-sm),
html[data-pc-theme="dark"] .pc-content .card-body > .mb-3:has(> .btn-sm) {
  background: var(--es-elevated);
  border-color: var(--es-line);
}

/* —— F2: poultry / ruminant —— */
.es-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 0.85rem;
  background: var(--es-mist);
  border: 1px solid var(--es-line);
  border-radius: 12px;
}

.es-kind-tab {
  flex: 1 1 auto;
  min-width: 5.5rem;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--es-muted);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
}

a.es-kind-tab:hover,
button.es-kind-tab:hover {
  color: var(--es-forest-deep);
  background: rgba(4, 120, 87, 0.06);
}

.es-kind-tab.is-on {
  background: var(--es-paper);
  color: var(--es-forest-deep);
  box-shadow: 0 1px 3px rgba(10, 18, 12, 0.08);
}

.es-kind {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

.es-kind-poultry {
  background: var(--es-warn-bg);
  color: var(--es-warn);
  border: 1px solid var(--es-warn-line);
}

.es-kind-ruminant {
  background: var(--es-mist);
  color: var(--es-forest);
  border: 1px solid color-mix(in srgb, var(--es-forest) 18%, var(--es-line));
}

.es-prod-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.15rem;
  font-weight: 600;
}

.es-kind-chips {
  margin-bottom: 0.65rem;
}

html[data-pc-theme="dark"] .es-kind-tabs {
  background: var(--es-elevated);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] .es-kind-tab.is-on {
  background: var(--es-mist);
  color: var(--es-body);
}

html[data-pc-theme="dark"] .es-kind-poultry {
  background: #3a2e1a;
  color: #f0d7a4;
}

html[data-pc-theme="dark"] .es-kind-ruminant {
  background: #1a2e22;
  color: #a8d4b8;
}

/* F3 polish: lists / modals / actions */
.pc-content .card-header {
  gap: 0.5rem;
}

.pc-content .es-col-actions {
  white-space: nowrap;
}

.pc-content .es-col-actions .btn,
.pc-content .es-col-actions form {
  margin: 0.1rem 0.1rem 0.1rem 0;
}

.modal-dialog {
  margin: 0.75rem auto;
}

@media (max-width: 767.98px) {
  .pc-content .table thead th {
    font-size: 0.78rem;
  }

  .pc-content .es-col-actions {
    white-space: normal;
    min-width: 7.5rem;
  }

  .pc-content .es-col-actions .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
  }

  .modal-dialog {
    margin: 0.35rem;
    max-width: calc(100% - 0.7rem);
  }

  .modal-content {
    border-radius: 0.75rem;
  }

  .pc-content .badge {
    font-size: 0.72rem;
  }

  .es-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .es-jump a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
  }
}

/* —— F3c: tables + fill/edit forms —— */
.pc-content .table > :not(caption) > * > * {
  padding: 0.78rem 0.9rem;
}

.pc-content .table thead th {
  background: var(--es-mist);
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--es-line);
}

.pc-content .table tbody tr {
  transition: background 120ms ease;
}

.pc-content .table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: color-mix(in srgb, var(--es-mist) 70%, transparent);
  background: color-mix(in srgb, var(--es-mist) 70%, transparent);
}

.pc-content .table tbody tr:nth-child(even) > * {
  background: color-mix(in srgb, var(--es-mist) 35%, transparent);
}

.pc-content .table tbody td {
  border-color: color-mix(in srgb, var(--es-line) 80%, transparent);
}

.pc-content .es-empty {
  text-align: center;
  padding: 2.25rem 1rem !important;
  color: var(--es-muted);
  font-weight: 600;
  background: transparent !important;
}

.pc-content .es-col-name {
  font-weight: 600;
  color: var(--es-text);
}

.pc-content .es-col-actions .btn-sm {
  min-height: 2.25rem;
  padding-inline: 0.8rem;
}

.pc-content .badge {
  border-radius: 999px;
  padding: 0.35em 0.7em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.es-search {
  margin-bottom: 1rem !important;
}

.es-search .input-group {
  gap: 0.45rem;
  flex-wrap: wrap;
}

.es-search .form-control {
  flex: 1 1 12rem;
  min-height: 2.65rem;
  border-radius: 10px !important;
}

.es-search .btn {
  min-height: 2.65rem;
  border-radius: 10px;
  min-width: 6.5rem;
}

.pc-content form > .row:has(> [class*="col-"] > .form-label),
.pc-content .es-form-panel {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 0.35rem;
  padding: 1rem 1.05rem 0.35rem;
  margin-bottom: 1.15rem;
  background: var(--es-surface);
  border: 1px solid var(--es-line);
  border-radius: 12px;
}

.pc-content form > .row:has(> [class*="col-"] > .form-label) > [class*="col-"],
.pc-content .es-form-panel > [class*="col-"] {
  margin-bottom: 0.85rem;
}

.pc-content .es-lines-block {
  margin: 0.35rem 0 1rem;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid var(--es-line);
  border-radius: 12px;
  background: var(--es-paper);
}

.pc-content .es-lines-block > h6 {
  margin: 0 0 0.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pc-content .es-lines-block > .text-muted.small {
  margin-bottom: 0.65rem;
}

.pc-content .es-lines-block > .table-responsive {
  margin-bottom: 0.75rem;
  border-radius: 10px;
}

.pc-content .es-table-lines {
  min-width: 52rem;
}

.pc-content .es-table-lines thead th {
  font-size: 0.74rem;
}

.pc-content .es-table-lines tbody td {
  padding: 0.55rem 0.45rem;
  vertical-align: top;
}

.pc-content .es-table-lines .form-control,
.pc-content .es-table-lines .form-select {
  min-height: 2.45rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.pc-content .es-table-lines .psel {
  min-width: 10rem;
}

.pc-content .es-table-lines .dsg {
  min-width: 9rem;
}

.pc-content .es-table-lines .qte,
.pc-content .es-table-lines .pu,
.pc-content .es-table-lines .vat,
.pc-content .es-table-lines .qty,
.pc-content .es-table-lines .cost {
  min-width: 5.25rem;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.pc-content .es-table-lines .usel {
  min-width: 5.5rem;
}

.pc-content .es-table-lines .es-del {
  width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-radius: 8px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--es-muted);
}

.pc-content .es-table-lines .es-del:hover {
  color: #a33;
  background: color-mix(in srgb, #a33 12%, transparent);
}

.pc-content .es-table-lines .es-have,
.pc-content .es-table-lines .es-disc-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.25;
}

#inv-tot,
.es-tot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1.15rem;
  margin: 0.35rem 0 1rem !important;
  padding: 0.85rem 1rem;
  border: 1px solid var(--es-line);
  border-radius: 12px;
  background: var(--es-mist);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

#inv-tot span,
.es-tot-bar span {
  unicode-bidi: isolate;
  direction: ltr;
  font-weight: 700;
  color: var(--es-forest-deep);
}

.es-savebar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.es-savebar .btn {
  min-width: 9rem;
  min-height: 2.75rem;
  border-radius: 10px;
}

.modal-body form > .mb-2,
.modal-body form > .mb-3 {
  margin-bottom: 0.9rem !important;
}

.modal-body .form-label {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--es-muted);
  margin-bottom: 0.28rem;
}

.modal-body .form-control,
.modal-body .form-select {
  min-height: 2.55rem;
  border-radius: 8px;
}

.modal-body form .row {
  --bs-gutter-x: 0.85rem;
}

.modal-footer .btn,
.modal-body form .btn-primary {
  min-height: 2.65rem;
  border-radius: 10px;
  font-weight: 600;
  padding-inline: 1.15rem;
}

.pc-content .card-header h5 {
  font-weight: 700;
  letter-spacing: -0.015em;
}

.pc-content .card-header .text-muted,
.pc-content .card-header small {
  font-weight: 600;
}

html[data-pc-theme="dark"] .pc-content .table thead th {
  background: var(--es-elevated);
}

html[data-pc-theme="dark"] .pc-content .table-hover > tbody > tr:hover > *,
html[data-pc-theme="dark"] .pc-content .table tbody tr:nth-child(even) > * {
  background: rgba(255, 255, 255, 0.03);
}

html[data-pc-theme="dark"] .pc-content form > .row:has(> [class*="col-"] > .form-label),
html[data-pc-theme="dark"] .pc-content .es-form-panel,
html[data-pc-theme="dark"] .pc-content .es-lines-block,
html[data-pc-theme="dark"] #inv-tot,
html[data-pc-theme="dark"] .es-tot-bar {
  background: var(--es-elevated);
  border-color: var(--es-line);
}

html[data-pc-theme="dark"] #inv-tot span,
html[data-pc-theme="dark"] .es-tot-bar span {
  color: var(--es-body);
}

@media (max-width: 767.98px) {
  .pc-content form > .row:has(> [class*="col-"] > .form-label),
  .pc-content .es-form-panel {
    padding: 0.85rem 0.8rem 0.25rem;
  }

  .pc-content form > .row:has(> [class*="col-"] > .form-label) > [class*="col-"],
  .pc-content .es-form-panel > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .pc-content .es-lines-block {
    padding: 0.75rem 0.65rem 0.85rem;
    margin-inline: -0.1rem;
  }

  .pc-content .es-table-lines {
    min-width: 44rem;
  }

  .pc-content .es-table-lines .form-control,
  .pc-content .es-table-lines .form-select {
    min-height: 44px;
  }

  #inv-tot,
  .es-tot-bar {
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
  }

  .es-savebar {
    position: sticky;
    bottom: 0.35rem;
    z-index: 5;
    margin-inline: -0.2rem;
    padding: 0.55rem;
    border: 1px solid var(--es-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--es-paper) 92%, transparent);
    backdrop-filter: blur(8px);
  }

  .es-savebar .btn {
    width: 100%;
  }

  .es-search .btn {
    flex: 1 1 auto;
  }

  html[data-pc-theme="dark"] .es-savebar {
    background: color-mix(in srgb, var(--es-paper) 92%, transparent);
  }
}

/* —— F3d: core UX audit follow-ups (touch + stock density) —— */
.es-jump a {
  min-height: 44px;
  padding-inline: 0.9rem;
  font-weight: 600;
}

.pc-content .btn-sm {
  min-height: 2.35rem;
  padding-inline: 0.8rem;
}

@media (max-width: 767.98px) {
  .pc-content .btn-sm,
  .pc-content .es-col-actions .btn-sm {
    min-height: 44px;
  }
}

.pc-content form.row.g-2.align-items-end > .col-12:has(> .btn),
.pc-content form.row.g-2.align-items-end > .col-12:has(> a.btn) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding-top: 0.2rem;
}

#es-lots > .card-body > .es-kpi-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
  margin-bottom: 0.85rem;
}

#es-lots > .card-body > .es-kpi-row > .es-kpi {
  flex: 0 0 auto;
  min-width: 7.75rem;
}

.pc-content .table tbody tr:nth-child(even) > * {
  background: rgba(4, 120, 87, 0.035);
}

.pc-content .table-hover > tbody > tr:hover > * {
  background: rgba(4, 120, 87, 0.07);
}

html[data-pc-theme="dark"] .pc-content .table tbody tr:nth-child(even) > * {
  background: rgba(255, 255, 255, 0.03);
}

html[data-pc-theme="dark"] .pc-content .table-hover > tbody > tr:hover > * {
  background: rgba(255, 255, 255, 0.06);
}

.es-ops-wrap {
  overflow: visible;
}

.es-ops-details > summary {
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.es-ops-details > summary::-webkit-details-marker {
  display: none;
}

.es-stock-recent > summary {
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.es-stock-recent > summary::-webkit-details-marker {
  display: none;
}

.es-ops-details > summary::after {
  content: "▾";
  margin-inline-start: auto;
  color: var(--es-muted);
  font-size: 0.9rem;
}

.es-ops-details[open] > summary::after {
  content: "▴";
}

.es-ops-wrap .card.border {
  background: var(--es-paper);
}

@media (min-width: 768px) {
  .es-ops-details > summary::after {
    display: none;
  }
}

/* —— F3e: stock density + line editors on phone —— */
@media (max-width: 767.98px) {
  .es-jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding-bottom: 0.15rem;
  }

  .es-jump a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .es-kpi-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
    grid-template-columns: none;
  }

  .es-kpi-row > .es-kpi {
    flex: 0 0 auto;
    min-width: 7.25rem;
  }

  .es-kpi-row > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  /* Line create/edit: one product card per row — no wide horizontal table */
  .pc-content .es-table-lines {
    min-width: 0 !important;
    width: 100%;
  }

  .pc-content .es-table-lines thead {
    display: none;
  }

  .pc-content .es-table-lines tbody,
  .pc-content .es-table-lines tr,
  .pc-content .es-table-lines td {
    display: block;
    width: 100%;
  }

  .pc-content .es-table-lines tbody tr {
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--es-line);
    border-radius: 12px;
    background: var(--es-surface);
  }

  .pc-content .es-table-lines tbody tr:nth-child(even) > * {
    background: transparent;
  }

  .pc-content .es-table-lines td {
    padding: 0.28rem 0;
    border: 0;
  }

  .pc-content .es-table-lines td:last-child {
    text-align: end;
    padding-top: 0.45rem;
  }

  .pc-content .es-table-lines .form-control,
  .pc-content .es-table-lines .form-select,
  .pc-content .es-table-lines .psel,
  .pc-content .es-table-lines .dsg,
  .pc-content .es-table-lines .qte,
  .pc-content .es-table-lines .pu,
  .pc-content .es-table-lines .vat,
  .pc-content .es-table-lines .qty,
  .pc-content .es-table-lines .cost,
  .pc-content .es-table-lines .usel {
    width: 100%;
    min-width: 0;
    max-width: none;
    text-align: start;
  }

  .pc-content .es-lines-block > .table-responsive {
    border: 0;
    background: none;
    overflow: visible;
  }
}

html[data-pc-theme="dark"] .pc-content .es-table-lines tbody tr {
  background: var(--es-elevated);
  border-color: var(--es-line);
}

/* —— Ops / orders polish (reuse .es-kpi* / .es-kind-tabs) —— */
.card-header .es-kind-tabs {
  margin-bottom: 0;
}

.es-kind-tabs.es-kind-tabs--compact .es-kind-tab {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.86rem;
}

.es-add-cust {
  min-width: 2.15rem;
  font-weight: 800;
  border-radius: 0 8px 8px 0 !important;
}

html[dir="rtl"] .es-add-cust {
  border-radius: 8px 0 0 8px !important;
}

.es-complete-bar {
  border: 1px solid rgba(4, 120, 87, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--es-mist), var(--es-paper));
}

.es-complete-bar .card-body {
  padding: 1rem 1.15rem;
}

.es-complete-bar .form-label {
  font-weight: 700;
  color: var(--es-muted);
  font-size: 0.82rem;
}

html[data-pc-theme="dark"] .es-complete-bar {
  background: var(--pc-header-background);
  border-color: var(--es-line);
}

/* ESA taste layer — sahmrev chrome on Able surfaces */
.btn {
  border-radius: var(--es-radius-sm);
  font-weight: 600;
  transition: transform 160ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.btn-outline-secondary,
.btn-light {
  border-color: var(--es-line);
}

.btn-outline-secondary:hover,
.btn-light:hover {
  border-color: color-mix(in srgb, var(--es-forest) 45%, transparent);
  color: var(--es-forest-deep);
  background: var(--es-mist);
}

.alert {
  border-radius: var(--es-radius);
  border-width: 1px;
}

.dropdown-menu {
  border-radius: var(--es-radius);
  border-color: var(--es-line);
  box-shadow: var(--es-shadow);
}

.badge.bg-warning,
.badge.text-bg-warning {
  color: #3d2e05 !important;
  background: color-mix(in srgb, var(--es-gold) 35%, var(--es-warn-bg)) !important;
}

.pc-sidebar .pc-item.active > .pc-link,
.pc-sidebar .pc-item .pc-link.active {
  background: var(--es-mist) !important;
  color: var(--es-forest) !important;
  font-weight: 650;
}

.pc-content {
  background: var(--es-paper);
}

.page-header {
  margin-bottom: 1.1rem;
}

.es-eyebrow {
  color: var(--es-gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}

html[data-pc-theme="dark"] .pc-header {
  background: color-mix(in srgb, var(--pc-header-background) 92%, transparent);
}

html[data-pc-theme="dark"] .pc-content .card:hover {
  border-color: color-mix(in srgb, var(--es-forest) 40%, var(--es-line-solid));
}

html[data-pc-theme="dark"] .btn-outline-secondary:hover,
html[data-pc-theme="dark"] .btn-light:hover {
  background: var(--es-mist);
  color: var(--es-forest-deep);
}


/* ---------------------------------------------------------------------------
 * Brand-color fix: the vendor theme's ".btn-outline-*" utilities hardcode
 * their own default palette (blue/teal/orange/red/slate) instead of reading
 * the "--bs-*" variables, so every outline button ignored the ESA green/gold
 * branding used everywhere else (solid buttons, links, focus rings). This
 * routes them through the same design tokens as the rest of the site.
 * --------------------------------------------------------------------------- */
.btn-outline-primary {
  --bs-btn-color: var(--es-forest);
  --bs-btn-border-color: var(--es-forest);
  --bs-btn-hover-color: var(--es-on-fill);
  --bs-btn-hover-bg: var(--es-forest);
  --bs-btn-hover-border-color: var(--es-forest);
  --bs-btn-focus-shadow-rgb: 4, 120, 87;
  --bs-btn-active-color: var(--es-on-fill);
  --bs-btn-active-bg: var(--es-forest);
  --bs-btn-active-border-color: var(--es-forest);
  --bs-btn-disabled-color: var(--es-forest);
  --bs-btn-disabled-border-color: var(--es-forest);
}

.btn-outline-success {
  --bs-btn-color: var(--es-success);
  --bs-btn-border-color: var(--es-success);
  --bs-btn-hover-color: var(--es-on-fill);
  --bs-btn-hover-bg: var(--es-success);
  --bs-btn-hover-border-color: var(--es-success);
  --bs-btn-active-color: var(--es-on-fill);
  --bs-btn-active-bg: var(--es-success);
  --bs-btn-active-border-color: var(--es-success);
  --bs-btn-disabled-color: var(--es-success);
  --bs-btn-disabled-border-color: var(--es-success);
}

.btn-outline-danger {
  --bs-btn-color: var(--es-danger);
  --bs-btn-border-color: var(--es-danger);
  --bs-btn-hover-color: var(--es-on-fill);
  --bs-btn-hover-bg: var(--es-danger);
  --bs-btn-hover-border-color: var(--es-danger);
  --bs-btn-active-color: var(--es-on-fill);
  --bs-btn-active-bg: var(--es-danger);
  --bs-btn-active-border-color: var(--es-danger);
  --bs-btn-disabled-color: var(--es-danger);
  --bs-btn-disabled-border-color: var(--es-danger);
}

.btn-outline-warning {
  --bs-btn-color: var(--es-warn);
  --bs-btn-border-color: var(--es-warn);
  --bs-btn-hover-color: #1a1608;
  --bs-btn-hover-bg: var(--es-gold);
  --bs-btn-hover-border-color: var(--es-gold);
  --bs-btn-active-color: #1a1608;
  --bs-btn-active-bg: var(--es-gold);
  --bs-btn-active-border-color: var(--es-gold);
  --bs-btn-disabled-color: var(--es-warn);
  --bs-btn-disabled-border-color: var(--es-warn);
}

.btn-outline-secondary {
  --bs-btn-color: var(--es-muted);
  --bs-btn-border-color: var(--es-line-solid);
  --bs-btn-hover-color: var(--es-text);
  --bs-btn-hover-bg: var(--es-mist);
  --bs-btn-hover-border-color: var(--es-line-solid);
  --bs-btn-active-color: var(--es-text);
  --bs-btn-active-bg: var(--es-mist);
  --bs-btn-active-border-color: var(--es-line-solid);
  --bs-btn-disabled-color: var(--es-muted);
  --bs-btn-disabled-border-color: var(--es-line-solid);
}

/* Same vendor-hardcoding issue on a couple of one-off colors: fixed dark text
 * instead of the theme's own border/body tokens, invisible in dark mode. */
.invoice-table th,
.invoice-table td {
  border-color: var(--es-line-solid);
}

.auth-main .auth-wrapper.v1 .auth-form .card {
  border-color: var(--es-forest-deep);
}

/* "more actions" dropdown items that are actually a <form>/<button> (e.g. delete) should
 * look and size like a normal dropdown link, not a stray small button in a box. */
.dropdown-menu li form {
  margin: 0;
}
.dropdown-menu li form button {
  display: block;
  width: 100%;
  padding: 0.35rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: inherit;
  font-size: inherit;
}
.dropdown-menu li form button:hover {
  background: var(--es-mist);
}

/* ---------------------------------------------------------------------------
 * Same vendor-hardcoding issue, one layer deeper: Bootstrap's "-bg-subtle" /
 * "-text-emphasis" tokens (used by .alert-*, .text-bg-*, etc.) and the
 * ".badge.bg-light-*" soft-badge variants are also hardcoded to the vendor's
 * default blue/teal/orange/red palette instead of the ESA green/gold tokens.
 * --------------------------------------------------------------------------- */
:root {
  --bs-primary-bg-subtle: color-mix(in srgb, var(--es-forest) 14%, var(--es-surface));
  --bs-primary-text-emphasis: var(--es-forest-deep);
  --bs-success-bg-subtle: color-mix(in srgb, var(--es-success) 14%, var(--es-surface));
  --bs-success-text-emphasis: var(--es-forest-deep);
  --bs-danger-bg-subtle: color-mix(in srgb, var(--es-danger) 14%, var(--es-surface));
  --bs-danger-text-emphasis: var(--es-danger);
  --bs-warning-bg-subtle: color-mix(in srgb, var(--es-gold) 18%, var(--es-surface));
  --bs-warning-text-emphasis: #7a5c0e;
  --bs-secondary-bg-subtle: var(--es-elevated);
  --bs-secondary-text-emphasis: var(--es-muted);
}

html[data-pc-theme="dark"] {
  --bs-warning-text-emphasis: var(--es-gold);
}

.badge.bg-light-primary {
  background: var(--bs-primary-bg-subtle);
  color: var(--es-forest);
}
.badge.bg-light-success {
  background: var(--bs-success-bg-subtle);
  color: var(--es-success);
}
.badge.bg-light-danger {
  background: var(--bs-danger-bg-subtle);
  color: var(--es-danger);
}
.badge.bg-light-warning {
  background: var(--bs-warning-bg-subtle);
  color: var(--es-warn);
}
.badge.bg-light-secondary {
  background: var(--bs-secondary-bg-subtle);
  color: var(--es-muted);
}
.badge.bg-light-info {
  background: color-mix(in srgb, var(--es-forest) 10%, var(--es-surface));
  color: var(--es-forest);
}

/* ===== Phase 1 foundations (2026-10): type, numbers, surfaces ===== */
@font-face {
  font-family: "Noto Sans Arabic";
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/noto-arabic/NotoSansArabic-arabic-var.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+066A-066D;
}

:root {
  --es-radius-xs: 0.4rem;
  --es-radius-lg: 1.15rem;
  --es-shadow-sm: 0 1px 2px var(--es-shadow-color), 0 2px 8px color-mix(in srgb, #052e20 6%, transparent);
  --es-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  letter-spacing: -0.012em;
  text-wrap: balance;
}

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
  letter-spacing: 0;
}

p, .text-muted, small, .form-text {
  text-wrap: pretty;
}

/* Amounts and quantities: equal-width digits so columns line up */
table, .table, .es-kpi-value, .es-num, .es-col-money, .es-tot-bar, .es-amt-in, .es-amt-out,
input[type="number"], .form-control[inputmode="decimal"] {
  font-variant-numeric: tabular-nums;
}

.es-col-money {
  text-align: end;
  white-space: nowrap;
}

/* KPI tiles: labels in sentence case, hints readable, value is the hero */
.es-kpi {
  box-shadow: var(--es-shadow-sm);
  transition: border-color 200ms var(--es-ease), transform 200ms var(--es-ease), box-shadow 200ms var(--es-ease), background 200ms var(--es-ease);
}

.es-kpi-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.es-kpi-value {
  font-size: 1.55rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.es-kpi-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.85;
}

.es-kpi--accent .es-kpi-hint {
  color: var(--es-on-fill);
}

/* Buttons: tactile press, consistent focus ring */
.btn {
  transition: background-color 160ms var(--es-ease), border-color 160ms var(--es-ease), color 160ms var(--es-ease), box-shadow 160ms var(--es-ease), transform 120ms var(--es-ease);
}

.btn:active:not(:disabled):not(.disabled) {
  transform: translateY(1px) scale(0.985);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--es-forest);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Phase 2 shell (2026-10): sidebar, header, page header ===== */
.pc-sidebar {
  box-shadow: none;
  border-inline-end: 1px solid var(--es-line-solid);
  border-right-color: var(--es-line-solid);
}

.pc-sidebar .m-header {
  height: auto;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 0;
}

.pc-sidebar .es-logo-full {
  width: auto;
  height: 64px;
  max-width: 100%;
  object-fit: contain;
}

.pc-sidebar .card.pc-user-card {
  margin: 0.25rem 0.75rem 0.75rem;
  background: var(--es-elevated);
  border: 0;
  border-radius: var(--es-radius);
  transition: background-color 160ms var(--es-ease);
}

.pc-sidebar .card.pc-user-card:hover {
  background: var(--es-mist);
}

.pc-navbar .pc-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 2px 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--es-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--es-body);
  transition: background-color 150ms var(--es-ease), color 150ms var(--es-ease);
}

.pc-navbar .pc-link .pc-micon {
  display: inline-flex;
  width: 1.4rem;
  justify-content: center;
  color: var(--es-muted);
  transition: color 150ms var(--es-ease);
}

.pc-navbar .pc-link .pc-micon i {
  font-size: 1.25rem;
}

.pc-navbar .pc-link:hover {
  background: color-mix(in srgb, var(--es-mist) 75%, transparent);
  color: var(--es-forest-deep);
}

.pc-navbar .pc-link:hover .pc-micon {
  color: var(--es-forest);
}

.pc-navbar .pc-item.pc-trigger > .pc-link {
  background: transparent;
  box-shadow: none;
  color: var(--es-forest-deep);
  font-weight: 600;
}

.pc-navbar .pc-item.active > .pc-link {
  background: var(--es-mist);
  color: var(--es-forest-deep);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--es-forest);
}

html[dir="rtl"] .pc-navbar .pc-item.active > .pc-link {
  box-shadow: inset -3px 0 0 var(--es-forest);
}

.pc-navbar .pc-item.active > .pc-link .pc-micon,
.pc-navbar .pc-item.pc-trigger > .pc-link .pc-micon {
  color: var(--es-forest);
}

.pc-navbar .pc-badge {
  margin-inline-start: auto;
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--es-fill);
  color: var(--es-on-fill);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pc-navbar .pc-submenu .pc-link {
  font-size: 0.86rem;
  font-weight: 450;
}

.pc-header {
  background: color-mix(in srgb, var(--pc-header-background) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--es-line-solid);
  box-shadow: none;
}

.pc-header .pc-head-link,
.pc-header .es-head-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  transition: background-color 150ms var(--es-ease);
}

.pc-header .pc-head-link:hover,
.pc-header .es-head-action:hover {
  background: var(--es-mist);
}

.pc-container .pc-content {
  max-width: 1480px;
  margin-inline: auto;
}

.page-header {
  padding-block: 0.25rem 0.5rem;
}

.page-header-title h2 {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.page-header-title .text-muted {
  font-size: 0.9rem;
}

.card {
  border-radius: var(--es-radius);
}

.card-header {
  background: transparent;
}

/* Parent of an open submenu: only the active child carries the highlight */
.pc-sidebar .pc-navbar .pc-hasmenu.active > .pc-link,
.pc-sidebar .pc-navbar .pc-hasmenu.pc-trigger > .pc-link,
html[dir="rtl"] .pc-sidebar .pc-navbar .pc-hasmenu.active > .pc-link,
html[dir="rtl"] .pc-sidebar .pc-navbar .pc-hasmenu.pc-trigger > .pc-link,
html[data-pc-theme="dark"] .pc-sidebar .pc-navbar .pc-hasmenu.active > .pc-link,
html[data-pc-theme="dark"] .pc-sidebar .pc-navbar .pc-hasmenu.pc-trigger > .pc-link {
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}

/* ===== Phase 3 components (2026-10): tables, forms, badges, alerts, modals, empty states ===== */

/* Tables: hairlines instead of zebra, quiet header, soft hover */
.pc-content .table tbody tr:nth-child(even) > * {
  background: transparent;
}

html[data-pc-theme="dark"] .pc-content .table tbody tr:nth-child(even) > * {
  background: transparent;
}

.pc-content .table > tbody > tr > * {
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--es-line-solid);
}

.pc-content .table > tbody > tr:last-child > * {
  border-bottom-color: transparent;
}

.pc-content .table-hover > tbody > tr:hover > * {
  background: color-mix(in srgb, var(--es-mist) 55%, transparent);
}

.pc-content .table thead th {
  background: var(--es-elevated);
  color: var(--es-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--es-line-solid);
}

/* Row actions: quiet until hovered */
.pc-content .table .btn-sm.btn-light,
.pc-content .table .btn-sm.btn-outline-secondary,
.pc-content .table .btn-sm.btn-outline-primary {
  background: transparent;
  border-color: transparent;
  color: var(--es-forest);
  font-weight: 500;
  padding: 0.3rem 0.6rem;
}

.pc-content .table .btn-sm.btn-light:hover,
.pc-content .table .btn-sm.btn-outline-secondary:hover,
.pc-content .table .btn-sm.btn-outline-primary:hover {
  background: var(--es-mist);
  color: var(--es-forest-deep);
}

.pc-content .table .btn-sm.btn-outline-danger {
  background: transparent;
  border-color: transparent;
  color: var(--es-danger);
  font-weight: 500;
  padding: 0.3rem 0.6rem;
}

.pc-content .table .btn-sm.btn-outline-danger:hover {
  background: color-mix(in srgb, var(--es-danger) 10%, transparent);
  color: var(--es-danger);
}

/* Forms */
.form-label {
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--es-body);
}

.form-control,
.form-select {
  min-height: 2.6rem;
  border-color: var(--es-line-solid);
  border-radius: var(--es-radius-sm);
  transition: border-color 150ms var(--es-ease), box-shadow 150ms var(--es-ease), background-color 150ms var(--es-ease);
}

.form-control-sm,
.form-select-sm {
  min-height: 2.1rem;
}

.form-control:hover:not(:disabled):not(:focus),
.form-select:hover:not(:disabled):not(:focus) {
  border-color: color-mix(in srgb, var(--es-forest) 40%, var(--es-line-solid));
}

.form-control:focus,
.form-select:focus {
  border-color: var(--es-forest);
  box-shadow: 0 0 0 3px var(--es-ring);
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--es-muted) 70%, transparent);
}

.form-control:disabled,
.form-select:disabled {
  background: var(--es-elevated);
  color: var(--es-muted);
}

/* Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.3em 0.65em;
}

/* Alerts and flash messages */
.alert {
  padding: 0.8rem 1rem;
  border-width: 1px;
  border-radius: var(--es-radius);
  box-shadow: none;
}

/* Modals */
.modal-content {
  border: 0;
  border-radius: var(--es-radius-lg);
  box-shadow: 0 24px 60px color-mix(in srgb, #052e20 28%, transparent);
}

.modal-header {
  border-bottom: 1px solid var(--es-line-solid);
}

.modal-title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal-backdrop.show {
  opacity: 0.45;
}

/* Empty states */
.pc-content .es-empty {
  font-weight: 500;
}

.pc-content .es-empty::before {
  content: "";
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  background: var(--es-mist) center / 1.3rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2.5-7.5A2 2 0 0 1 7.4 4h9.2a2 2 0 0 1 1.9 1.5L21 13'/%3E%3Cpath d='M3 13v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5h-5l-1.5 2h-5L8 13H3z'/%3E%3C/svg%3E");
}

/* Same table treatment inside the bare form pages (modal iframes have no .pc-content) */
body.es-bare .table thead th {
  background: var(--es-elevated);
  color: var(--es-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  border-bottom: 1px solid var(--es-line-solid);
}

body.es-bare .table > tbody > tr > * {
  border-bottom: 1px solid var(--es-line-solid);
}

body.es-bare .table > tbody > tr:last-child > * {
  border-bottom-color: transparent;
}

/* ===== Phase 4 key pages (2026-10): action hierarchy, chips, input groups ===== */

/* Solid emerald is for the one main action; secondary green actions are soft */
[data-pc-preset="preset-1"] .btn-success {
  --bs-btn-bg: var(--es-mist);
  --bs-btn-color: var(--es-forest-deep);
  --bs-btn-border-color: color-mix(in srgb, var(--es-forest) 28%, transparent);
  --bs-btn-hover-bg: color-mix(in srgb, var(--es-forest) 16%, var(--es-surface));
  --bs-btn-hover-color: var(--es-forest-deep);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--es-forest) 45%, transparent);
  --bs-btn-active-bg: color-mix(in srgb, var(--es-forest) 22%, var(--es-surface));
  --bs-btn-active-color: var(--es-forest-deep);
  --bs-btn-active-border-color: var(--es-forest);
  background-color: var(--bs-btn-bg);
  color: var(--bs-btn-color);
  border-color: var(--bs-btn-border-color);
}

[data-pc-preset="preset-1"] .btn-success:hover,
[data-pc-preset="preset-1"] .btn-success:focus-visible,
[data-pc-preset="preset-1"] .btn-success:active {
  background-color: var(--bs-btn-hover-bg);
  color: var(--bs-btn-hover-color);
  border-color: var(--bs-btn-hover-border-color);
}

[data-pc-theme="dark"][data-pc-preset="preset-1"] .btn-success {
  --bs-btn-color: #a7f3d0;
  --bs-btn-hover-color: #d1fae5;
  --bs-btn-active-color: #d1fae5;
}

.input-group > .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Dashboard alerts as a chip strip */
.es-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.es-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
  border: 1px solid var(--es-line-solid);
  border-radius: 999px;
  background: var(--es-surface);
  color: var(--es-body);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 150ms var(--es-ease), background-color 150ms var(--es-ease);
}

html[dir="rtl"] .es-chip {
  padding: 0.4rem 0.85rem 0.4rem 0.5rem;
}

.es-chip b {
  min-width: 1.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--es-mist);
  color: var(--es-forest-deep);
  font-weight: 650;
  font-size: 0.8rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.es-chip:hover {
  border-color: color-mix(in srgb, var(--es-forest) 40%, var(--es-line-solid));
  background: var(--es-mist);
}

.es-chip--warn {
  border-color: var(--es-warn-line);
  background: var(--es-warn-bg);
}

.es-chip--warn b {
  background: color-mix(in srgb, var(--es-gold) 28%, var(--es-surface));
  color: #7a5608;
}

/* ===== Phase 5 mobile / touch (2026-10) ===== */
@media (max-width: 767.98px) {
  /* Dashboard actions: one scrollable row instead of five full-width buttons */
  .es-dash-actions {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    margin-inline: -0.25rem;
    padding: 0.1rem 0.25rem 0.35rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .es-dash-actions::-webkit-scrollbar {
    display: none;
  }

  .es-dash-actions .btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  /* KPI tiles: two per row, nothing hidden behind a horizontal scroller */
  .es-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .es-kpi-row > .es-kpi {
    flex: initial;
    min-width: 0;
    padding: 0.8rem 0.85rem;
  }

  .es-kpi-row > .es-kpi--accent {
    grid-column: 1 / -1;
  }

  .es-kpi-row > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .es-kpi-value {
    font-size: 1.3rem;
  }

  /* Tables scroll sideways, but the first column (the name) stays visible */
  .table-responsive > .table > thead > tr > :first-child,
  .table-responsive > .table > tbody > tr > :first-child {
    position: sticky;
    inset-inline-start: 0;
    z-index: 1;
    background: var(--es-surface);
    box-shadow: 1px 0 0 var(--es-line-solid);
    min-width: 4.75rem;
    max-width: 9.5rem;
    white-space: normal;
    overflow-wrap: break-word;
  }

  html[dir="rtl"] .table-responsive > .table > thead > tr > :first-child,
  html[dir="rtl"] .table-responsive > .table > tbody > tr > :first-child {
    box-shadow: -1px 0 0 var(--es-line-solid);
  }

  .table-responsive > .table > thead > tr > :first-child {
    background: var(--es-elevated);
  }

  .pc-content .table > tbody > tr > *,
  body.es-bare .table > tbody > tr > * {
    padding: 0.6rem 0.65rem;
    font-size: 0.88rem;
  }

  .pc-content .table thead th {
    padding-inline: 0.65rem;
    white-space: nowrap;
  }
}

/* Touch devices: comfortable hit targets */
@media (pointer: coarse) {
  .btn:not(.btn-sm) {
    min-height: 2.75rem;
  }

  .btn-sm {
    min-height: 2.25rem;
  }

  .form-check-input {
    width: 1.3rem;
    height: 1.3rem;
  }

  .pc-navbar .pc-link {
    min-height: 2.75rem;
  }

  .pc-header .pc-head-link,
  .pc-header .es-head-action {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Notched phones / installed PWA: keep content and save buttons clear of the home indicator */
body.es-bare {
  padding-bottom: env(safe-area-inset-bottom);
}

.pc-footer {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

/* ===== Phase 6 dark mode parity (2026-10) ===== */
html[data-pc-theme="dark"] .es-kpi.es-kpi--accent {
  background: color-mix(in srgb, var(--es-fill) 42%, var(--es-surface));
  border-color: color-mix(in srgb, var(--es-forest) 55%, transparent);
  color: #ecfdf5;
}

html[data-pc-theme="dark"] .es-kpi--link.es-kpi--accent:hover,
html[data-pc-theme="dark"] .es-kpi.es-kpi--accent.is-on {
  background: color-mix(in srgb, var(--es-fill) 55%, var(--es-surface));
}

html[data-pc-theme="dark"] .es-kpi--accent .es-kpi-label,
html[data-pc-theme="dark"] .es-kpi--accent .es-kpi-value,
html[data-pc-theme="dark"] .es-kpi--accent .es-kpi-hint,
html[data-pc-theme="dark"] .es-kpi--accent small {
  color: #ecfdf5 !important;
}

/* ===== Phase 8 documents and print (2026-10) ===== */

/* The document on screen and on paper */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.invoice-table th {
  padding: 0.5rem 0.65rem;
  background: var(--es-fill);
  color: var(--es-on-fill);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: start;
  border: 0;
}

.invoice-table td {
  padding: 0.5rem 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--es-line-solid);
  vertical-align: top;
}

.invoice-table th:nth-child(n + 4),
.invoice-table td:nth-child(n + 4) {
  text-align: end;
  white-space: nowrap;
}

.invoice-table th:first-child,
.invoice-table td:first-child {
  width: 2.2rem;
}

.invoice-table td:first-child {
  color: var(--es-muted);
}

.invoice-table td:nth-child(3) {
  white-space: nowrap;
}

.invoice-totals {
  margin-inline-start: auto;
  width: min(100%, 18rem);
  margin-top: 0.9rem;
}

.invoice-totals p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.2rem;
  font-variant-numeric: tabular-nums;
}

.invoice-totals p:last-child:not(.invoice-ttc) {
  display: block;
  text-align: end;
}

.invoice-totals .invoice-ttc {
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--es-radius-sm);
  background: var(--es-mist);
  color: var(--es-forest-deep);
  font-size: 1.1rem;
  font-weight: 650;
}

.invoice-stop,
.invoice-words {
  margin: 0.9rem 0 0.15rem;
}

.invoice-words {
  margin-top: 0;
  font-style: italic;
  color: var(--es-muted);
}

.invoice-sign {
  min-height: 5.5rem;
  margin-top: 1.4rem;
  text-align: end;
}

.invoice-sign > div {
  display: inline-block;
  min-width: 11rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--es-line-solid);
  text-align: center;
  color: var(--es-muted);
  font-size: 0.85rem;
}

.invoice-foot {
  margin-top: 1.4rem;
  padding-top: 0.6rem;
  border-top: 2px solid var(--es-gold);
  color: var(--es-muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

@media print {
  html,
  body,
  .pc-container {
    height: auto !important;
    overflow: visible !important;
  }

  body[data-pc-direction] .no-print.no-print,
  html body .modal,
  html body .modal-backdrop,
  html body .pc-footer,
  html body .es-header,
  html body .pc-sidebar {
    display: none !important;
  }

  html body,
  html[data-pc-theme="dark"] body {
    background: #fff !important;
    color: #111 !important;
    font-size: 10.5pt;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html body .invoice-paper,
  html[data-pc-theme="dark"] body .invoice-paper {
    background: #fff !important;
    color: #111 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  /* On a document page, print the document only */
  .pc-content:has(.invoice-paper) > :not(.invoice-paper) {
    display: none !important;
  }

  .invoice-head {
    break-inside: avoid;
  }

  .invoice-table thead {
    display: table-header-group;
  }

  .invoice-table tr {
    break-inside: avoid;
  }

  .invoice-totals,
  .invoice-sign,
  .invoice-foot {
    break-inside: avoid;
  }

  .card {
    box-shadow: none !important;
    border-color: #ddd !important;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }
}

/* ===== Mouse-wheel scrolling fix (2026-10) =====
   html has overflow-x: clip, so body's overflow no longer propagates to the viewport and body became
   its own (non-scrollable) scroll box; with overscroll-behavior-y: contain on it the wheel never reached
   the page. Clip horizontally on body without creating a scroll box, and keep the bounce guard on html. */
html {
  overscroll-behavior-y: contain;
}

body {
  overflow-x: clip;
  overflow-y: visible;
  overscroll-behavior-y: auto;
}

.pc-sidebar .navbar-content,
.pc-sidebar .navbar-content .simplebar-content-wrapper {
  overscroll-behavior: auto;
}

/* Submitting: visual only (the button is never disabled, see es-app.js) */
.es-busy {
  pointer-events: none;
  opacity: 0.7;
  cursor: progress;
}

/* ===== Poultry batches (farm-view) ===== */
.es-batch {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--es-line-solid);
}

.es-batch:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.es-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.es-batch-kpis {
  grid-template-columns: repeat(auto-fit, minmax(7.4rem, 1fr));
}

.es-batch-hist {
  margin-top: 0.7rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--es-radius-sm);
  background: var(--es-elevated);
}

.es-batch-hist summary {
  cursor: pointer;
  font-weight: 500;
}

.es-batch-hist ul {
  margin-top: 0.5rem;
}
