.customers-page {
  display: grid;
  gap: 1rem;
}

.customers-header,
.customers-panel > header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.customers-header h2,
.customers-panel h3 {
  margin: 0;
}

.customers-header p,
.customers-panel p {
  color: var(--muted-text, #64748b);
  margin: 0.25rem 0 0;
}

.customers-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.customers-toolbar {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(18rem, 1fr) minmax(10rem, 14rem) auto;
}

.customers-field {
  display: grid;
  gap: 0.35rem;
}

.customers-field span {
  color: var(--muted-text, #64748b);
  font-size: 0.875rem;
  font-weight: 600;
}

.customers-field input,
.customers-field select,
.customers-field textarea {
  min-height: 2.5rem;
}

.customers-summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customers-summary-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
}

.customers-summary-card span {
  color: var(--muted-text, #64748b);
  font-size: 0.875rem;
}

.customers-summary-card strong {
  font-size: 1.25rem;
}

.customers-panel {
  display: grid;
  gap: 0.75rem;
}

.customers-table-wrapper {
  overflow-x: auto;
}

.customers-table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

.customers-table th,
.customers-table td {
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.customers-table th {
  color: var(--muted-text, #64748b);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.customers-count,
.customers-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.customers-count {
  background: #f1f5f9;
  color: #334155;
}

.customers-status.is-active {
  background: #dcfce7;
  color: #166534;
}

.customers-status.is-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.customers-message,
.customers-empty,
.customers-loading {
  border-radius: 8px;
  padding: 0.875rem 1rem;
}

.customers-message-error {
  background: #fee2e2;
  color: #991b1b;
}

.customers-message-success {
  background: #dcfce7;
  color: #166534;
}

.customers-empty,
.customers-loading {
  background: #f8fafc;
  color: #475569;
}

.customers-form-panel {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: 1rem;
}

.customers-form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.customers-field-wide {
  grid-column: span 2;
}

.customers-form-footer {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .customers-header,
  .customers-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .customers-toolbar,
  .customers-summary-grid,
  .customers-form-grid {
    grid-template-columns: 1fr;
  }

  .customers-field-wide {
    grid-column: auto;
  }
}
