.phi-dtm-admin {
  color: #182235;
}
.phi-dtm-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
}
.phi-dtm-title h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 5px;
}
.phi-dtm-title p {
  margin: 0;
  color: #64748b;
}
.phi-dtm-sync-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: -4px 0 18px;
  padding: 11px 14px;
  border: 1px solid #dbe7df;
  border-radius: 8px;
  background: #f4fbf6;
  color: #476052;
}
.phi-dtm-sync-status span:first-child {
  color: #15803d;
}
.phi-dtm-region-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  margin: 18px 0 4px;
  padding: 5px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
}
.phi-dtm-region-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 16px;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
}
.phi-dtm-region-link span {
  color: #94a3b8;
  font-size: 12px;
}
.phi-dtm-region-link.is-active {
  background: #111827;
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
}
.phi-dtm-region-link.is-active span {
  color: #cbd5e1;
}
.phi-dtm-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.phi-dtm-kpi,
.phi-dtm-capacity {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.phi-dtm-kpi span {
  display: block;
  color: #64748b;
  margin-bottom: 8px;
}
.phi-dtm-kpi strong {
  font-size: 27px;
}
.phi-dtm-table-wrap {
  overflow: auto;
  margin-top: 18px;
}
.phi-dtm-table-wrap table {
  min-width: 1050px;
}
.phi-dtm-table-wrap td {
  vertical-align: middle;
}
.phi-dtm-table-wrap td span,
.phi-dtm-table-wrap small {
  color: #64748b;
}
.phi-status,
.phi-priority,
.phi-queue-wait,
.phi-queue-ready,
.phi-pushed,
.phi-purchase-result {
  display: inline-block !important;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.phi-status-stock {
  background: #eef2f7;
  color: #334155 !important;
}
.phi-status-transit {
  background: #dbeafe;
  color: #1d4ed8 !important;
}
.phi-status-trial,
.phi-queue-ready,
.phi-pushed,
.phi-purchase-result.purchased {
  background: #dcfce7;
  color: #15803d !important;
}
.phi-status-bought,
.phi-priority.is-priority {
  background: #fef3c7;
  color: #b45309 !important;
}
.phi-status-retired {
  background: #f1f5f9;
  color: #64748b !important;
}
.phi-queue-wait {
  background: #fee2e2;
  color: #b91c1c !important;
}
.phi-dtm-overdue {
  color: #b91c1c !important;
  font-weight: 700;
}
.phi-dtm-analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}
.phi-dtm-analysis-grid section {
  background: #fff;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.phi-dtm-capacity {
  margin: 22px 0;
}
.phi-dtm-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.phi-dtm-cap-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}
.phi-dtm-cap-card label,
.phi-dtm-cap-card span {
  display: block;
  margin-top: 8px;
}
.phi-dtm-cap-card input {
  width: 70px;
}
.phi-store-summary td {
  background: #e8f1fb !important;
}
.phi-store-summary span {
  display: inline-block;
  margin-right: 28px;
  color: #334155 !important;
}
.phi-trial-detail {
  max-width: 1100px;
}
.phi-trial-detail section {
  background: #fff;
  border: 1px solid #dcdcde;
  padding: 12px 20px;
  margin: 14px 0;
}
.phi-trial-detail dl > div {
  display: grid;
  grid-template-columns: 170px 1fr;
  border-top: 1px solid #eee;
  padding: 10px 0;
}
.phi-trial-detail dt {
  font-weight: 700;
}
.phi-trial-detail dd {
  margin: 0;
}
.phi-qr-details {
  min-width: 160px;
}
.phi-qr-details input {
  width: 230px;
}
.phi-dtm-card {
  max-width: 620px;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 26px;
}
.phi-dtm-qr {
  display: flex;
  justify-content: center;
  margin: 18px auto;
}
.phi-dtm-public {
  margin: 0;
  background: #f4f6f9;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.phi-dtm-form-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}
.phi-dtm-brand {
  text-align: center;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 18px;
}
.phi-dtm-form {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 35px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.phi-dtm-form h1 {
  font-size: 28px;
  margin: 0;
}
.phi-dtm-form h2 {
  font-size: 18px;
  border-top: 1px solid #e5e7eb;
  padding-top: 22px;
  margin-top: 25px;
}
.phi-dtm-form h2 small {
  font-weight: 400;
  color: #64748b;
}
.phi-dtm-muted {
  color: #64748b;
}
.phi-dtm-language-switcher {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}
.phi-dtm-language-switcher select {
  box-sizing: border-box;
  min-width: 170px;
  max-width: 100%;
  padding: 8px 34px 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  line-height: 1.4;
}
.phi-dtm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.phi-dtm-grid > label,
.phi-dtm-score-grid > label {
  min-width: 0;
}
.phi-dtm-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.phi-dtm-form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
}
.phi-dtm-form input,
.phi-dtm-form select,
.phi-dtm-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 11px;
  background: #fff;
  font-size: 16px;
}
.phi-dtm-form input[type="date"] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  overflow: hidden;
}
.phi-dtm-form input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}
.phi-dtm-score-grid input {
  font-size: 20px;
  font-weight: 700;
}
.phi-dtm-required-notice {
  color: #dc2626;
  font-weight: 700;
}
.phi-dtm-location {
  margin-top: 14px;
}
.phi-dtm-locate {
  margin-top: 8px;
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 7px;
  padding: 9px 13px;
  cursor: pointer;
}
.phi-dtm-options {
  display: flex;
  gap: 26px;
}
.phi-dtm-options label,
.phi-dtm-consent {
  font-weight: 400;
}
.phi-dtm-options input,
.phi-dtm-consent input {
  width: auto;
  margin-right: 6px;
}
.phi-dtm-consent {
  margin: 24px 0;
}
.phi-dtm-submit {
  border: 0;
  border-radius: 8px;
  background: #000;
  color: #fff;
  padding: 14px 24px;
  width: 100%;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.phi-dtm-submit:hover,
.phi-dtm-submit:focus {
  background: #1f1f1f;
  color: #fff;
}

/* Keep the public form independent from WooCommerce/theme button rules. */
body.phi-dtm-public .phi-dtm-form button.phi-dtm-submit {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 14px 24px !important;
  border: 1px solid #000 !important;
  border-radius: 8px !important;
  background: #000 !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #fff !important;
  text-transform: none !important;
}
body.phi-dtm-public .phi-dtm-form button.phi-dtm-submit:hover,
body.phi-dtm-public .phi-dtm-form button.phi-dtm-submit:focus {
  border-color: #1f1f1f !important;
  background: #1f1f1f !important;
  color: #fff !important;
}
.phi-dtm-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 7px;
  margin: 15px 0;
}
.phi-dtm-success {
  width: 64px;
  height: 64px;
  line-height: 64px;
  margin: auto;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: 32px;
}
.phi-dtm-hp {
  position: absolute !important;
  left: -10000px !important;
}
.phi-dtm-qr canvas {
  max-width: 100%;
  height: auto !important;
}
@media (max-width: 700px) {
  .phi-dtm-region-switcher {
    display: grid;
    width: 100%;
    box-sizing: border-box;
  }
  .phi-dtm-grid,
  .phi-dtm-score-grid {
    grid-template-columns: 1fr 1fr;
  }
  .phi-dtm-form {
    padding: 22px 18px;
  }
  .phi-dtm-analysis-grid {
    grid-template-columns: 1fr;
  }
  .phi-trial-detail dl > div {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 430px) {
  body.phi-dtm-public {
    overflow-x: hidden;
  }
  .phi-dtm-form-shell {
    width: 100%;
    max-width: 100%;
    padding: 18px 10px 40px;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .phi-dtm-grid,
  .phi-dtm-score-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .phi-dtm-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  body.phi-dtm-public .phi-dtm-form input[type="date"] {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    -webkit-min-logical-width: 0 !important;
    -webkit-appearance: none;
    appearance: none;
  }
  .phi-dtm-options {
    display: block;
  }
  .phi-dtm-options label {
    margin: 10px 0;
  }
}
