.fw-admin-wrap {
  max-width: 1180px;
  margin: 0;
  padding: 0 20px 24px 0;
}

.fleetwire-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin: 18px 0;
  padding: 24px;
}

.fleetwire-card:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fw-admin-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}

.fw-admin-header img {
  display: block;
  max-height: 44px;
  width: auto;
}

.fw-admin-pull-left,
.fw-admin-pull-right {
  display: flex;
  align-items: center;
}

.fleetwire-card h2 {
  margin: 0;
  padding: 0;
  color: #1d2327;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}

.fleetwire-card h3 {
  margin: 0 0 8px;
  color: #1d2327;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}

.fleetwire-card .fw-admin-subtitle {
  max-width: 760px;
  margin: 8px 0 0;
  color: #50575e;
  font-size: 14px;
  line-height: 1.5;
}

.fleetwire-card hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #dcdcde;
}

.fleetwire-card .form-table {
  margin: 0;
}

.fleetwire-card .form-table th {
  width: 140px;
  padding: 12px 16px 12px 0;
  color: #1d2327;
  font-weight: 600;
  vertical-align: top;
}

.fleetwire-card .form-table td {
  padding: 12px 0;
  vertical-align: top;
}

.fleetwire-card input[type="text"],
.fleetwire-card input[type="url"],
.fleetwire-card input[type="password"] {
  width: 100%;
  max-width: 440px;
  min-height: 38px;
  border-color: #8c8f94;
  border-radius: 4px;
}

.fleetwire-card input[type="text"]:focus,
.fleetwire-card input[type="url"]:focus,
.fleetwire-card input[type="password"]:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: 2px solid transparent;
}

.fleetwire-card .description {
  max-width: 680px;
  margin: 8px 0 0;
  color: #646970;
  font-size: 13px;
  line-height: 1.5;
}

.fleetwire-api-environment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 5px 0 0;
}

.fleetwire-api-environment-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: #1d2327;
}

.fleetwire-card .submit {
  margin: 18px 0 0;
  padding: 0;
}

.fleetwire-card .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fleetwire-card .button .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 16px;
}

.fleetwire-card .button.disabled,
.fleetwire-card .button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.fleetwire-connection-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dcdcde;
  border-left-width: 4px;
  border-radius: 4px;
  background: #f6f7f7;
}

.fleetwire-connection-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.fleetwire-connection-panel h3::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #8c8f94;
}

.fleetwire-connection-panel.is-connected {
  border-left-color: #008a20;
  background: #f0f6e8;
}

.fleetwire-connection-panel.is-connected h3::before {
  background: #008a20;
}

.fleetwire-connection-panel.is-error {
  border-left-color: #d63638;
  background: #fcf0f1;
}

.fleetwire-connection-panel.is-error h3::before {
  background: #d63638;
}

.fleetwire-connection-panel.is-warning,
.fleetwire-connection-panel.is-checking,
.fleetwire-connection-panel.is-pending {
  border-left-color: #dba617;
  background: #fcf9e8;
}

.fleetwire-connection-panel.is-warning h3::before,
.fleetwire-connection-panel.is-checking h3::before,
.fleetwire-connection-panel.is-pending h3::before {
  background: #dba617;
}

.fleetwire-connection-message {
  margin: 0;
  color: #50575e;
}

.fleetwire-connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.fleetwire-dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.fleetwire-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fleetwire-dashboard-metric {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #f6f7f7;
}

.fleetwire-dashboard-metric span {
  display: block;
  color: #646970;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: uppercase;
}

.fleetwire-dashboard-metric strong {
  display: block;
  margin-top: 8px;
  color: #1d2327;
  font-size: 28px;
  line-height: 1.1;
}

.fleetwire-dashboard-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.fleetwire-dashboard-lists > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #fff;
}

.fleetwire-dashboard-list {
  margin: 0;
}

.fleetwire-dashboard-list li {
  margin: 0;
  padding: 9px 0;
  border-top: 1px solid #f0f0f1;
  color: #50575e;
  line-height: 1.45;
}

.fleetwire-dashboard-list li:first-child {
  border-top: 0;
}

.fleetwire-dashboard-message {
  min-height: 18px;
  margin: 14px 0 0;
  color: #646970;
  font-size: 13px;
}

.fleetwire-dashboard-message.is-success {
  color: #008a20;
}

.fleetwire-dashboard-message.is-error {
  color: #d63638;
}

.fleetwire-dashboard-message.is-warning,
.fleetwire-dashboard-message.is-pending {
  color: #996800;
}

.fleetwire-shortcode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.fleetwire-listing-picker {
  padding: 16px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #f6f7f7;
}

.fleetwire-listing-picker-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.fleetwire-listing-picker-header p {
  max-width: 720px;
  margin: 0;
  color: #646970;
  font-size: 13px;
  line-height: 1.45;
}

.fleetwire-listing-picker-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.fleetwire-picker-field {
  min-width: 0;
}

.fleetwire-picker-field label,
.fleetwire-generated-shortcode label {
  display: block;
  margin: 0 0 6px;
  color: #1d2327;
  font-weight: 600;
}

.fleetwire-picker-field input,
.fleetwire-picker-field select {
  width: 100%;
  max-width: none;
}

.fleetwire-generated-shortcode {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 16px;
}

.fleetwire-generated-shortcode > div {
  flex: 1;
  min-width: 0;
}

.fleetwire-generated-shortcode code {
  display: block;
  min-height: 20px;
  padding: 10px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  color: #1d2327;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.fleetwire-listing-picker-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: #646970;
  font-size: 13px;
}

.fleetwire-listing-picker-message.is-success {
  color: #008a20;
}

.fleetwire-listing-picker-message.is-error {
  color: #d63638;
}

.fleetwire-listing-picker-message.is-warning,
.fleetwire-listing-picker-message.is-pending {
  color: #996800;
}

.fleetwire-shortcode-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #fff;
}

.fleetwire-shortcode-card p {
  margin: 0;
  color: #646970;
  font-size: 13px;
  line-height: 1.45;
}

.fleetwire-shortcode-copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: auto;
}

.fleetwire-shortcode-copy-row code {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #f6f7f7;
  color: #1d2327;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.fleetwire-copy-shortcode.is-copied {
  border-color: #008a20;
  color: #008a20;
}

.fleetwire-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 999999;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 4px;
  background: #1d2327;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateX(calc(100% + 32px));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fleetwire-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.fleetwire-toast-success {
  background: #008a20;
}

.fleetwire-toast-error {
  background: #d63638;
}

.fleetwire-toast-info {
  background: #2271b1;
}

.fleetwire-tooltip {
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 3px;
  background: #1d2327;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

.fleetwire-loading {
  position: relative;
  pointer-events: none;
}

.fleetwire-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(34, 113, 177, 0.25);
  border-top-color: #2271b1;
  border-radius: 999px;
  animation: fleetwire-spin 0.8s linear infinite;
}

input.fleetwire-loading::after {
  display: none;
}

@keyframes fleetwire-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.fleetwire-mt-2 {
  margin-top: 16px;
}

@media screen and (max-width: 782px) {
  .fw-admin-wrap {
    padding-right: 10px;
  }

  .fw-admin-header,
  .fleetwire-connection-panel,
  .fleetwire-dashboard-header,
  .fleetwire-listing-picker-header,
  .fleetwire-generated-shortcode,
  .fleetwire-shortcode-copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .fleetwire-listing-picker-body {
    grid-template-columns: 1fr;
  }

  .fleetwire-dashboard-summary,
  .fleetwire-dashboard-lists {
    grid-template-columns: 1fr;
  }

  .fleetwire-connection-actions {
    justify-content: flex-start;
  }

  .fleetwire-card .form-table th,
  .fleetwire-card .form-table td {
    display: block;
    width: 100%;
    padding-right: 0;
  }

  .fleetwire-toast {
    top: 60px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}
