.customers-content {
  padding-top: 26px;
}

.customers-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.customers-top h1,
.customers-top p,
.customers-top small {
  margin: 0;
}

.customers-top h1 {
  font-size: 30px;
}

.customers-top p {
  margin-top: 8px;
  font-weight: 800;
}

.customers-top span,
.customers-top small {
  color: var(--muted);
}

.customers-top small {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.customer-actions {
  display: flex;
  gap: 14px;
}

.customer-actions button,
.customer-filter button,
.customer-table td button,
.customer-footer button,
.customer-footer select,
.customer-detail button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.customer-actions button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  height: 44px;
  padding: 0 18px;
}

.customer-actions .primary,
.customer-detail footer .primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green-bright), var(--green));
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.customer-stats article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(23, 44, 39, 0.04);
  overflow: hidden;
  min-width: 0;
}

.customer-stats article > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.customer-stats p,
.customer-stats small {
  margin: 0;
}

.customer-stats p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-stats strong {
  display: block;
  margin: 3px 0 2px;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-stats small {
  font-weight: 700;
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Filter Bar - Single Row */
.customer-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.customer-filter label {
  flex: 1;
  min-width: 170px;
}

.customer-filter label:first-child {
  flex: 2;
  min-width: 240px;
}

.customer-filter label > span {
  position: relative;
  display: block;
}

.customer-filter input,
.customer-filter select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  outline: 0;
  padding: 0 14px;
  font-family: inherit;
  font-size: 13.5px;
}

.customer-filter input {
  padding: 0 42px 0 14px;
}

.customer-filter label > span i {
  position: absolute;
  right: 12px;
  top: 11px;
  color: var(--muted);
}

.customer-filter button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.customer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 18px;
  align-items: start;
}

.customer-table,
.customer-detail {
  padding: 0;
  overflow: hidden;
}

.customer-table h2 {
  height: 62px;
  margin: 0;
  padding: 20px 22px 0;
  font-size: 18px;
}

.table-scroll {
  overflow-x: auto;
}

.customer-table table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
}

.customer-table th {
  background: #fbfcfc;
  text-align: left;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 800;
  white-space: nowrap;
}

.customer-table td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.customer-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.customer-table tbody tr:hover {
  background: #f8fafc;
}

.customer-table tbody tr.selected-row {
  background: #ecfdf5 !important;
  border-left: 3px solid var(--green);
}

.customer-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.customer-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  white-space: nowrap;
}

.face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #0f9f63, #045c38);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.active-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.inactive-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.customer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  white-space: nowrap;
}

.customer-footer p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  font-weight: 700;
}

.customer-footer div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.pagination-buttons button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border-radius: 6px;
}

.pagination-buttons button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* Detail Side Panel */
.customer-detail {
  padding: 22px;
}

.customer-detail header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.customer-detail h2 {
  margin: 0;
  font-size: 18px;
}

.customer-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.customer-hero .face {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.customer-hero h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: #0f172a;
}

.customer-hero p {
  margin: 2px 0;
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
}

.customer-hero small {
  color: #94a3b8;
  font-size: 11.5px;
}

.contact-info,
.address-info {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.contact-info h3,
.address-info h3,
.activity-summary h3,
.latest-orders h3 {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.contact-info p,
.address-info p {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
  font-size: 13px;
  color: #334155;
}

.activity-summary {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.activity-summary > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.activity-summary article {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
}

.activity-summary small {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 3px;
}

.activity-summary b {
  font-size: 14px;
  color: #0f172a;
}

.latest-orders {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.latest-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 13px;
  white-space: nowrap;
}

.latest-order-item b {
  color: #0f172a;
}

.latest-order-item small {
  color: #94a3b8;
  display: block;
}

.latest-order-item span {
  text-align: right;
  font-weight: 800;
  color: #0f9f63;
}

.customer-detail footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.customer-detail footer button {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.customer-detail footer .danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.customer-detail footer .danger:hover {
  background: #dc2626;
  color: #fff;
}

/* ============================================================
   MODAL DIALOG
============================================================ */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 15, 12, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.admin-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.admin-modal-card {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.admin-modal-backdrop.is-open .admin-modal-card {
  transform: translateY(0);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.admin-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.admin-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.admin-modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-modal-form label span {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.admin-modal-form input,
.admin-modal-form select,
.admin-modal-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.admin-modal-form input:focus,
.admin-modal-form select:focus,
.admin-modal-form textarea:focus {
  border-color: #008a4b;
}

.admin-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.admin-modal-actions .btn-cancel {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
}

.admin-modal-actions .btn-save {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #00b368, #008a4b);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 138, 75, 0.3);
}

@media (max-width: 1200px) {
  .customer-main {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 600px) {
  .customer-stats,
  .form-grid-2,
  .customer-filter label,
  .customer-filter label:first-child,
  .customer-detail footer {
    grid-template-columns: 1fr;
    min-width: 100%;
  }
  .customers-top {
    flex-direction: column;
    gap: 16px;
  }
  .customer-actions {
    width: 100%;
    flex-direction: column;
  }
  .customer-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
