/* Smile Car Service — admin usability update */

/* The record header is a nested <header>. Reset the public site's sticky black header. */
.record-details > header {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 0 18px !important;
  background: transparent !important;
  color: var(--ink, #202932) !important;
  box-shadow: none !important;
  grid-template-columns: none !important;
}

.record-details > header h3,
.record-details > header p,
.record-details > header strong,
.record-details > header span {
  color: inherit !important;
}

.record-details > header .mileage-badge {
  color: #202932 !important;
}

/* Selected client controls */
.client-profile-head {
  position: relative;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
}

.admin-client-actions {
  display: flex;
  flex: 0 0 100%;
  flex-wrap: wrap;
  width: 100%;
  gap: 10px;
  margin: 16px 0 4px;
}

.admin-card .admin-delete-client,
.admin-delete-client {
  width: auto !important;
  min-height: 42px;
  margin: 0 !important;
  padding: 10px 16px !important;
  border: 1px solid #d92f3a !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #c9212d !important;
  font: 800 14px/1.2 Manrope, Arial, sans-serif !important;
  cursor: pointer;
}

.admin-delete-client:hover {
  background: #fff1f1 !important;
}

/* Confirmation dialog */
.admin-delete-dialog {
  width: min(92vw, 480px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: #202932;
  background: #fff;
  box-shadow: 0 28px 90px rgba(5, 8, 12, .32);
}

.admin-delete-dialog::backdrop {
  background: rgba(5, 8, 12, .64);
  backdrop-filter: blur(3px);
}

.admin-delete-dialog__body {
  padding: 28px;
}

.admin-delete-dialog h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.admin-delete-dialog p {
  margin: 0;
  color: #606a73;
  line-height: 1.55;
}

.admin-delete-dialog strong {
  color: #202932;
}

.admin-delete-dialog__target {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f1;
  color: #b5232e;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-delete-dialog__verify {
  display: block;
  margin-top: 18px;
  color: #3e4851;
  font-size: 14px;
  font-weight: 800;
}

.admin-delete-dialog__verify input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid #aeb5bd;
  border-radius: 12px;
  font: 16px Manrope, Arial, sans-serif;
}

.admin-delete-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.admin-delete-dialog button {
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  font: 800 15px Manrope, Arial, sans-serif;
  cursor: pointer;
}

.admin-delete-dialog [data-cancel-delete] {
  background: #ece9e3;
  color: #202932;
}

.admin-delete-dialog [data-confirm-delete] {
  background: #d92f3a;
  color: #fff;
}

.admin-delete-dialog button:disabled {
  opacity: .55;
  cursor: wait;
}

.admin-update-toast {
  position: fixed;
  z-index: 10000;
  right: 20px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 14px;
  background: #202932;
  color: #fff;
  box-shadow: 0 18px 45px rgba(5, 8, 12, .24);
  font: 700 14px/1.45 Manrope, Arial, sans-serif;
}

.admin-update-toast.is-error {
  background: #b5232e;
}

/* The public contact dock must never cover admin forms. */
body.admin-panel-open .mobile-actions {
  display: none !important;
}

body.admin-panel-open {
  overflow-x: hidden;
}

@media (max-width: 780px) {
  .admin-shell {
    width: 100%;
    padding: 14px 10px 32px !important;
    overflow: hidden;
  }

  .admin-card,
  .client-profile,
  .service-record-form,
  .record-details {
    min-width: 0;
    border-radius: 18px !important;
  }

  .admin-card,
  .client-profile,
  .service-record-form {
    padding: 16px !important;
  }

  .admin-grid,
  .service-record-form .form-pair,
  .service-record-form .work-item-grid,
  .service-record-form .work-item-editor,
  .service-record-form .form-row,
  .record-summary,
  .record-details > header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .service-record-form fieldset,
  .service-record-form label,
  .service-record-form input,
  .service-record-form textarea,
  .service-record-form select,
  .service-record-form .work-item-editor,
  .service-record-form .work-item-editor > *,
  .service-record-form .form-pair > * {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .service-record-form fieldset {
    padding: 14px 12px !important;
  }

  .service-record-form .work-item-editor {
    padding: 14px 12px !important;
  }

  .service-record-form input,
  .service-record-form textarea,
  .service-record-form select {
    min-height: 50px;
    font-size: 16px !important;
  }

  .service-record-form textarea {
    min-height: 108px;
  }

  .service-record-form button,
  .admin-card button {
    min-height: 48px;
  }

  .client-profile-head {
    display: block !important;
  }

  .client-profile-head .badge {
    display: inline-flex;
    margin-top: 10px;
  }

  .admin-client-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-card .admin-delete-client {
    width: 100% !important;
  }

  .record-details {
    overflow-x: hidden;
  }

  .record-details table,
  .record-details thead,
  .record-details tbody,
  .record-details tr,
  .record-details th,
  .record-details td {
    box-sizing: border-box;
  }

  .admin-delete-dialog__actions {
    grid-template-columns: 1fr;
  }

  .admin-update-toast {
    right: 16px;
    bottom: 16px;
  }
}
