.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.partner-panel {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.partner-form-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.partner-form-title-row h3,
.partner-panel h3 {
  margin: 0;
}

.panel-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.line-page-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

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

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

.line-page-header h2 {
  margin-bottom: 4px;
}

.line-page-header p {
  margin: 0;
  color: #6b7280;
}

.line-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.line-form-grid {
  display: grid;
  gap: 10px;
  align-items: end;
}

.line-form-grid.two-col {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.line-form-grid label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #374151;
  margin-bottom: 4px;
}

.line-form-grid input,
.partner-local-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
}

#ptAccountName,
#ptBankName,
#ptAccountNo {
  background: #f8fafc;
  border-color: #bfdbfe;
}

.readonly-input {
  background: #f3f4f6 !important;
  color: #6b7280;
  cursor: not-allowed;
}

.secondary-inline {
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  background: #e5e7eb;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

.partner-page {
  margin-bottom: 18px;
}

.partner-separated-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.partner-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.partner-section-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.partner-card-icon {
  font-size: 18px;
}

.partner-card-subtitle {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.partner-section-count {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.partner-local-search {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}

.partner-separated-card .line-table-scroll {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow-x: auto;
  background: #ffffff;
}

.line-data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13px;
}

.line-data-table th,
.line-data-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 9px 8px;
  vertical-align: top;
  text-align: left;
}

.line-data-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.line-data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.line-data-table tbody tr:hover {
  background: #eff6ff;
}

.small-muted {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.line-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.line-action-group button {
  padding: 7px 9px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.line-action-group button.danger-inline {
  background: #dc2626;
  color: #ffffff;
}

.line-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #e5e7eb;
  color: #374151;
}

.line-status.ok {
  background: #dcfce7;
  color: #166534;
}

.line-status.warn {
  background: #fef3c7;
  color: #92400e;
}

.line-status.danger {
  background: #fee2e2;
  color: #991b1b;
}

.line-status.muted {
  background: #e5e7eb;
  color: #374151;
}

.partner-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.partner-pagination button {
  border: 0;
  border-radius: 9px;
  padding: 7px 11px;
  font-weight: 800;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
}

.partner-pagination button.active {
  background: #2563eb;
  color: #ffffff;
}

.partner-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.partner-pagination .page-dots {
  color: #6b7280;
  padding: 0 4px;
}

.lead-status-select {
  min-width: 165px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.lead-status-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

.lead-table .line-action-group {
  min-width: 330px;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.lead-status-button {
  width: 142px;
  max-width: 142px;
  min-width: 142px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  padding: 7px 9px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.lead-status-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-status-arrow {
  flex: 0 0 auto;
  color: #475569;
  font-size: 11px;
}

.lead-status-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.lead-status-menu {
  position: fixed;
  z-index: 999999;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  padding: 6px;
}

.lead-status-menu button {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #111827;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: normal;
}

.lead-status-menu button:hover {
  background: #eff6ff;
}

.lead-status-menu button.active {
  background: #2563eb;
  color: #ffffff;
}

.line-id-cell {
  max-width: 210px;
  word-break: break-all;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.account-no-cell {
  max-width: 180px;
  word-break: break-all;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
}

.partner-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

.partner-table th,
.partner-table td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

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

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

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

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

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

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

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

.partner-table th:nth-child(8),
.partner-table td:nth-child(8) { width: 8%; text-align: center; }

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

.partner-table .line-id-cell,
.partner-table .account-no-cell {
  max-width: none !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.partner-table .line-action-group {
  min-width: 0 !important;
  flex-wrap: wrap;
}

.partner-table .line-action-group button {
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .partner-grid,
  .line-form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .line-page-header,
  .partner-section-header {
    flex-direction: column;
  }

  .partner-section-count {
    white-space: normal;
  }

  .lead-table .line-action-group {
    flex-wrap: wrap;
    min-width: 260px;
  }
}
