.complaints-page {
  padding-bottom: 48px;
}

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

.complaints-head h1 {
  margin: 5px 0 8px;
}

.complaints-head p {
  margin: 0;
  max-width: 680px;
  color: var(--text-muted, #6b7280);
}

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

.complaints-cards > div {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.complaints-cards strong {
  display: block;
  font-size: 26px;
}

.complaints-cards span {
  font-size: 13px;
  color: #6b7280;
}

.complaints-toolbar {
  display: grid;
  grid-template-columns:
    minmax(240px, 1fr)
    220px;
  gap: 12px;
  margin-bottom: 14px;
}

.complaints-toolbar input,
.complaints-toolbar select,
.complaints-detail-grid input,
.complaints-detail-grid select,
.complaints-detail-grid textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  background: #fff;
}

.complaints-table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.complaints-table {
  width: 100%;
  border-collapse: collapse;
}

.complaints-table th,
.complaints-table td {
  padding: 13px 14px;
  text-align: right;
  border-bottom: 1px solid #f0f1f3;
  white-space: nowrap;
}

.complaints-table tbody tr {
  cursor: pointer;
}

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

.complaints-empty {
  padding: 36px !important;
  text-align: center !important;
  color: #6b7280;
}

.complaints-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, .34);
  display: flex;
  justify-content: flex-start;
}

.complaints-drawer.hidden {
  display: none;
}

.complaints-drawer-panel {
  width: min(780px, 94vw);
  height: 100vh;
  overflow: auto;
  background: #fff;
  box-shadow:
    10px 0 35px rgba(0, 0, 0, .15);
}

.complaints-drawer-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.complaints-close {
  font-size: 30px;
  line-height: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#complaint-detail-body {
  padding: 22px;
}

.complaints-detail-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.complaints-detail-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.complaints-detail-grid label > span {
  font-size: 13px;
  font-weight: 700;
}

.complaints-detail-grid .wide {
  grid-column: 1 / -1;
}

.complaints-info {
  margin-top: 18px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 12px;
  display: grid;
  gap: 8px;
}

.complaints-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.complaints-actions button {
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.complaints-message {
  min-height: 24px;
  margin-top: 15px;
}

.complaints-message.error {
  color: #b91c1c;
}

@media (max-width: 800px) {
  .complaints-cards {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .complaints-toolbar,
  .complaints-detail-grid {
    grid-template-columns: 1fr;
  }

  .complaints-detail-grid .wide {
    grid-column: auto;
  }

  .complaints-head {
    flex-direction: column;
  }
}

/* ==========================================================
   COMPLAINTS UX V1
   ========================================================== */

.complaints-asset-field {
  gap: 7px !important;
}

.complaints-asset-field input[type="search"] {
  background: #f8fafc;
}

.complaints-documents-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.complaints-subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.complaints-subheading > div {
  display: grid;
  gap: 3px;
}

.complaints-subheading span {
  color: #64748b;
  font-size: 12px;
}

.complaints-document-list {
  display: grid;
  gap: 8px;
}

.complaints-document-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;

  padding: 11px 12px;

  border: 1px solid #e5e7eb;
  border-radius: 9px;

  background: #fff;
  cursor: pointer;

  text-align: right;
}

.complaints-document-row:hover {
  background: #f8fafc;
}

.complaints-document-row small {
  color: #64748b;
  direction: ltr;
}

.complaints-documents-empty {
  padding: 14px;

  border: 1px dashed #cbd5e1;
  border-radius: 9px;

  color: #64748b;
  text-align: center;
}

@media (max-width: 720px) {

  .complaints-document-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ==========================================================
   COMPLAINT NEW FORM V1
   ========================================================== */

.complaints-new-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: grid;
  place-items: center;

  padding: 24px;

  background:
    rgba(15, 23, 42, .38);
}

.complaints-new-backdrop.hidden {
  display: none;
}

.complaints-new-modal {
  width: min(
    760px,
    calc(100vw - 32px)
  );

  max-height:
    calc(100vh - 48px);

  overflow: auto;

  border-radius: 16px;
  background: #fff;

  padding: 22px;

  box-shadow:
    0 24px 70px
    rgba(15, 23, 42, .18);
}

.complaints-new-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;

  margin-bottom: 20px;
}

.complaints-new-head h2 {
  margin: 3px 0 6px;
}

.complaints-new-head p {
  margin: 0;
  color: #64748b;
}

.complaints-new-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;
}

.complaints-new-grid label {
  display: grid;
  gap: 7px;
}

.complaints-new-grid .wide {
  grid-column: 1 / -1;
}

.complaints-new-grid input,
.complaints-new-grid select,
.complaints-new-grid textarea {
  width: 100%;
}

.complaints-new-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;

  margin-top: 18px;
}

@media (max-width: 720px) {

  .complaints-new-backdrop {
    padding: 10px;
  }

  .complaints-new-modal {
    width: 100%;
    max-height:
      calc(100vh - 20px);

    padding: 16px;
  }

  .complaints-new-grid {
    grid-template-columns: 1fr;
  }

  .complaints-new-grid .wide {
    grid-column: auto;
  }

  .complaints-new-actions {
    display: grid;
  }

  .complaints-new-actions button {
    width: 100%;
  }
}

/* Complaint Communication Status V1 */

.complaints-communication-section {
  margin-top: 20px;
}

.complaints-communication-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.complaints-communication-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.complaints-communication-row > div:first-child {
  display: grid;
  gap: 3px;
}

.complaints-communication-row > div:first-child span {
  color: #64748b;
  font-size: 12px;
}

.complaints-communication-meta {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.complaints-communication-meta small {
  color: #64748b;
  font-size: 11px;
}

.complaints-communication-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.complaints-communication-status.sent {
  background: #ecfdf5;
  color: #047857;
}

.complaints-communication-status.pending {
  background: #fffbeb;
  color: #b45309;
}

.complaints-communication-status.failed {
  background: #fef2f2;
  color: #b91c1c;
}

.complaints-communication-status.muted {
  background: #f1f5f9;
  color: #64748b;
}

.complaints-communication-error {
  color: #b91c1c !important;
}

@media (max-width: 640px) {
  .complaints-communication-row {
    align-items: stretch;
    flex-direction: column;
  }

  .complaints-communication-meta {
    align-items: flex-start;
    text-align: right;
  }
}

/* Native Complaint Attachments V1 */

.complaints-attachments-section {
  margin-top: 20px;
}

.complaints-attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.complaints-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.complaints-attachment-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.complaints-attachment-row strong {
  overflow-wrap: anywhere;
}

.complaints-attachment-row span,
.complaints-attachment-empty {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 640px) {
  .complaints-attachment-row {
    align-items: stretch;
    flex-direction: column;
  }
}


/* AKABER UI STABILIZATION V1 */

.complaints-table
tbody
tr[data-complaint-open] {
  cursor: pointer;
  transition:
    background-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}

.complaints-table
tbody
tr[data-complaint-open]:hover {
  background: #f0fdf4;
  box-shadow:
    inset -4px 0 0 #16a34a;
}

.complaints-table
tbody
tr[data-complaint-open]:active {
  transform:
    translateY(1px);
}

.complaints-table
tbody
tr[data-complaint-open]
td:first-child strong {
  color: #15803d;
}

.complaints-actions {
  align-items: center;
}

.complaints-actions
.primary-action,
.complaints-actions
.secondary-action {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  transition:
    border-color .15s ease,
    background-color .15s ease,
    color .15s ease;
}

.complaints-action-secondary {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.complaints-action-secondary:hover {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

#complaint-customer-filter {
  border-color: #bbf7d0;
  background: #f8fff9;
}

#complaint-customer-filter:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow:
    0 0 0 3px
    rgba(34, 197, 94, .12);
}



/* AKABER COMPLAINT CUSTOMER SEARCH RESULTS V1 */

.complaint-customer-results {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #dbe3ea;
  border-radius: 10px;
  background: #fff;
  box-shadow:
    0 12px 26px
    rgba(15, 23, 42, .08);
}

.complaint-customer-results.hidden {
  display: none;
}

.complaint-customer-search-result {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
  color: #1f2937;
  text-align: right;
  cursor: pointer;
  font: inherit;
}

.complaint-customer-search-result:last-child {
  border-bottom: 0;
}

.complaint-customer-search-result:hover,
.complaint-customer-search-result:focus-visible {
  outline: none;
  background: #f0fdf4;
}

.complaint-customer-search-result strong {
  color: #14532d;
}

.complaint-customer-search-result span,
.complaint-customer-search-result small {
  color: #64748b;
  font-size: 12px;
}

.complaint-customer-search-empty {
  padding: 14px;
  text-align: center;
  color: #64748b;
}



/* AKABER COMPLAINT MAINTENANCE LINK CARD V1 */

.complaints-linked-maintenance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 15px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
}

.complaints-linked-maintenance-card > div {
  display: grid;
  gap: 4px;
}

.complaints-linked-eyebrow {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.complaints-linked-maintenance-card strong {
  color: #166534;
}

.complaints-linked-status {
  color: #475569;
  font-size: 12px;
}

@media (max-width: 700px) {
  .complaints-linked-maintenance-card {
    align-items: stretch;
    flex-direction: column;
  }
}

