/* 平台后台 · 租户管理补充样式 */

/* —— KPI —— */
.pt-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.pt-kpi {
  background: #fff;
  border: 1px solid var(--line, #eef0f3);
  border-radius: 8px;
  padding: 14px 16px;
}
.pt-kpi .k {
  font-size: 12px;
  color: #8c8c8c;
  margin-bottom: 6px;
}
.pt-kpi .v {
  font-size: 22px;
  font-weight: 700;
  color: #1f1f1f;
  letter-spacing: -0.02em;
}
.pt-kpi.warn .v { color: #d48806; }
.pt-kpi.danger .v { color: #cf1322; }
.pt-kpi.ok .v { color: #389e0d; }
.pt-kpi.muted .v { color: #8c8c8c; }

/* —— 状态徽章 —— */
.pt-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
  font-weight: 500;
}
.pt-status.ok { background: #f6ffed; color: #389e0d; }
.pt-status.trial { background: #e6f4ff; color: #1677ff; }
.pt-status.warn { background: #fff7e6; color: #d48806; }
.pt-status.off { background: #f5f5f5; color: #8c8c8c; }
.pt-status.expire { background: #fff1f0; color: #cf1322; }

.pt-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #f5f5f5;
  color: #595959;
}

.pt-code {
  font-variant-numeric: tabular-nums;
  font-family: Consolas, "Courier New", monospace;
  color: #595959;
}

/* —— 详情抽屉（对齐订单 / 用户详情） —— */
.drawer-host .drawer:has(.pt-detail),
.drawer-host .drawer:has(.ud-edit) {
  width: min(640px, 94vw);
}
.drawer-host .drawer:has(.pt-detail) {
  width: min(720px, 94vw);
}

.pt-detail {
  padding: 4px 0 12px;
}
.pt-detail-summary {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  background: linear-gradient(180deg, #fafcff 0%, #fff 100%);
}
.pt-detail-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.pt-detail-ico {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(145deg, #69b1ff, #1677ff);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.22);
  position: relative;
}
.pt-detail-ico::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
}
.pt-detail-ico::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 19px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #1677ff;
}
.pt-detail-name {
  font-size: 16px;
  font-weight: 700;
  color: #1f1f1f;
  line-height: 1.4;
}
.pt-detail-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.5;
}
.pt-detail-sub code {
  font-size: 12px;
  padding: 0 4px;
  background: #f5f5f5;
  border-radius: 3px;
  color: #595959;
}
.pt-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pt-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e8e8e8;
}
.pt-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pt-metric .k {
  font-size: 12px;
  color: #8c8c8c;
}
.pt-metric .v {
  font-size: 13px;
  color: #262626;
  word-break: break-all;
  line-height: 1.45;
}
.pt-detail .ud-section + .ud-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed #e8e8e8;
}
.pt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pt-actions .btn {
  min-height: 32px;
}

/* —— 弹窗正文 —— */
.pt-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pt-modal-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #262626;
}
.pt-pwd-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f5f7fa;
  border: 1px solid #e8e8e8;
}
.pt-pwd-box .k {
  font-size: 12px;
  color: #8c8c8c;
  flex-shrink: 0;
}
.pt-pwd {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: Consolas, "Courier New", monospace;
  color: #1677ff;
  word-break: break-all;
}

/* —— 表单 / 提示 —— */
.pt-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.pt-form-grid .full { grid-column: 1 / -1; }
.pt-field label {
  display: block;
  font-size: 12px;
  color: #8c8c8c;
  margin-bottom: 6px;
  line-height: 1.3;
}
.pt-field label.req::before {
  content: "*";
  color: #ed4014;
  margin-right: 3px;
}
.pt-field .input,
.pt-field .select,
.pt-field textarea {
  width: 100%;
}
.ud-edit-item .input[readonly],
.ud-edit-item .input:disabled,
.pt-field .input[readonly],
.pt-field .input:disabled,
.pt-field .select:disabled {
  background: #f5f5f5;
  color: #595959;
  cursor: not-allowed;
}
.field-tip,
.pt-field-tip {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.5;
  font-weight: 400;
}
.pt-form-head {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.5;
}

.pt-alert {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #ad6800;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}
.ud-edit > .pt-alert {
  margin-bottom: 4px;
}
.pt-alert.danger {
  background: #fff1f0;
  border-color: #ffa39e;
  color: #a8071a;
}
.pt-alert.info {
  background: #e6f4ff;
  border-color: #91caff;
  color: #0958d9;
}

/* —— 套餐卡片 —— */
.pt-pkg-card {
  border: 1px solid #eef0f3;
  border-radius: 10px;
  padding: 18px 18px 14px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.pt-pkg-card:hover {
  border-color: #91caff;
  box-shadow: 0 4px 16px rgba(22, 119, 255, 0.08);
}
.pt-pkg-card.is-off {
  opacity: 0.72;
  background: #fafafa;
}
.pt-pkg-card .pt-pkg-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pt-pkg-card .nm {
  font-size: 16px;
  font-weight: 650;
  margin: 0;
  color: #1f1f1f;
}
.pt-pkg-card .price {
  font-size: 22px;
  font-weight: 700;
  color: #1677ff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.pt-pkg-card .price small {
  font-size: 12px;
  font-weight: 500;
  color: #8c8c8c;
}
.pt-pkg-card .pt-pkg-meta {
  font-size: 12px;
  color: #8c8c8c;
  margin-bottom: 12px;
  line-height: 1.5;
}
.pt-pkg-card ul {
  margin: 0;
  padding-left: 18px;
  color: #595959;
  font-size: 12px;
  line-height: 1.75;
  flex: 1;
}
.pt-pkg-card .pt-pkg-ft {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e8e8e8;
}
.pt-pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.pt-log-type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.pt-log-type.open { background: #e6f4ff; color: #1677ff; }
.pt-log-type.renew { background: #f6ffed; color: #389e0d; }
.pt-log-type.off { background: #fff1f0; color: #cf1322; }
.pt-log-type.on { background: #f9f0ff; color: #722ed1; }
.pt-log-type.other { background: #f5f5f5; color: #595959; }

.pt-split-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
}
.pt-split-hd h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

/* 列表操作列 */
.table .ops .btn.link {
  margin-right: 8px;
}

@media (max-width: 1100px) {
  .pt-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pt-pkg-grid { grid-template-columns: 1fr 1fr; }
  .pt-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pt-kpi-row,
  .pt-pkg-grid { grid-template-columns: 1fr; }
  .pt-form-grid { grid-template-columns: 1fr; }
  .pt-detail-metrics { grid-template-columns: 1fr 1fr; }
  .pt-detail-main { flex-direction: column; }
}
