.pay-page {
  direction: rtl;
  padding: 18px;
  color: #172033;
}

.pay-header,
.pay-panel-head,
.pay-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pay-header {
  margin-bottom: 16px;
}

.pay-header h2,
.pay-panel h3 {
  margin: 0;
  font-weight: 800;
}

.pay-header p,
.pay-panel p {
  margin: 4px 0 0;
  color: #64748b;
}

.pay-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pay-kpis div,
.pay-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.pay-kpis div {
  padding: 14px;
}

.pay-kpis span {
  color: #64748b;
  font-size: 13px;
}

.pay-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.pay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(330px, 0.8fr);
  gap: 14px;
}

.pay-panel {
  padding: 14px;
}

.pay-panel-head {
  margin-bottom: 12px;
}

.pay-panel-head .form-control {
  width: min(320px, 100%);
}

.pay-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
}

.pay-chip.approved,
.pay-chip.locked,
.pay-chip.posted,
.pay-chip.paid {
  background: #dcfce7;
  color: #166534;
}

.pay-chip.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.pay-chip.draft {
  background: #fef3c7;
  color: #92400e;
}

.pay-chip.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.pay-inputs-panel {
  margin-top: 14px;
}

.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.payslip-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
}

.payslip-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.payslip-item strong {
  display: block;
}

.payslip-money {
  text-align: left;
  white-space: nowrap;
}

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

.pay-form-grid label span {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.pay-span-2 {
  grid-column: 1 / -1;
}

.account-combo {
  position: relative;
}

.account-combo-btn {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  text-align: right;
}

.account-combo-btn:hover,
.account-combo.open .account-combo-btn {
  border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.account-combo-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 1080;
  display: none;
  padding: 8px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.account-combo.open .account-combo-menu {
  display: block;
}

.account-combo-list {
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.account-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #172033;
  text-align: right;
}

.account-option:hover,
.account-option.active {
  background: #eef6ff;
}

.account-code {
  direction: ltr;
  color: #2563eb;
  font-weight: 800;
}

.account-type {
  color: #64748b;
  font-size: 12px;
}

.component-map {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.component-map-head h6 {
  margin: 0;
  font-weight: 800;
}

.component-map-head p {
  margin: 4px 0 10px;
  color: #64748b;
  font-size: 13px;
}

.component-account-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
}

.component-account-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.2fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.component-code {
  font-weight: 800;
}

.component-meta {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 900px) {
  .component-account-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .pay-kpis,
  .pay-layout,
  .pay-form-grid {
    grid-template-columns: 1fr;
  }
}
