/* 青音API 管理后台 · 签发台 */

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-page { background: var(--cream); }
.admin-page.modal-open { overflow: hidden; }
.admin-scene { background: linear-gradient(180deg, #f8f8ef 0%, var(--cream) 55%, #f2f3e7 100%); }

.admin-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 4vw, 48px);
}

.admin-brand-divider { width: 1px; height: 18px; margin: 0 3px; background: var(--line-strong); }
.admin-brand-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 1px solid rgba(15, 155, 142, 0.22);
  border-radius: 999px;
  background: rgba(223, 245, 238, 0.62);
  color: var(--mint-deep);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Gate */
.admin-gate {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 438px);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vh, 56px) 0 clamp(30px, 6vh, 64px);
}
.admin-gate-intro { max-width: 530px; }
.admin-gate-intro .gemini-pill .ico { width: 14px; height: 14px; color: var(--mint-deep); }
.admin-gate-intro h1 {
  font-size: clamp(38px, 4.6vw, 56px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.05em;
}
.admin-gate-intro > p {
  max-width: 460px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.85;
}
.admin-gate-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 440px;
}
.admin-gate-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid rgba(24, 32, 28, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 250, 0.42);
  backdrop-filter: blur(8px);
}
.gate-list-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--mint-soft);
  color: var(--mint-deep);
}
.gate-list-icon .ico { width: 14px; height: 14px; }
.admin-gate-list b { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.admin-gate-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.admin-gate-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin-top: 22px;
  padding: 0 13px 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 250, 0.55);
  font-size: 11px;
  color: var(--muted);
}
.admin-gate-chip img { width: 16px; height: 16px; }
.admin-gate-chip b { color: var(--ink-soft); font-weight: 600; }
.admin-gate-chip span { color: var(--faint); font-size: 10px; }
.admin-gate-chip em {
  font-style: normal;
  padding: 2px 6px;
  border-radius: 5px;
  background: #eff1e6;
  color: var(--mint-deep);
  font-family: var(--mono);
  font-size: 9.5px;
}

.admin-login-card {
  position: relative;
  width: 100%;
  padding: 32px 32px 24px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 252, 0.98), rgba(253, 253, 246, 0.97));
  box-shadow: var(--shadow-card);
  animation: cardIn 0.6s var(--ease) both;
  backdrop-filter: blur(20px);
}
.admin-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 155, 142, 0.4), transparent);
}
.admin-login-card h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.035em; }
.admin-login-form { margin-top: 24px; }
.admin-field { margin-bottom: 15px; }
.admin-field .field-label { margin-bottom: 7px; }
.admin-field .key-box { height: 47px; }
.admin-field .key-box input { font-family: var(--font); font-size: 13px; letter-spacing: 0; }
.admin-field .key-box input[type="password"] { letter-spacing: 0.08em; }
.admin-login-error { margin: 0 0 8px; }
.admin-login-card .submit-btn { margin-top: 4px; height: 48px; }

.admin-security-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.65;
}
.admin-security-note .ico { width: 14px; height: 14px; margin-top: 1px; color: #8ba39a; }

.admin-gate-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 0 22px;
  color: var(--faint);
  font-size: 10px;
}
.admin-gate-foot .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1bbf89;
  box-shadow: 0 0 0 3px rgba(27, 191, 137, 0.12);
}

/* App shell */
.admin-app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(213, 216, 200, 0.78);
  background: rgba(246, 246, 236, 0.86);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.admin-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(1180px, 100%);
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}
.admin-bar-brand img { width: 28px; height: 28px; border-radius: 8px; }
.admin-bar-brand .brand-word { font-size: 15px; }
.admin-bar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.admin-who { display: flex; align-items: center; gap: 8px; margin-right: 6px; }
.admin-who-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, #dff5ee, #cdeee3);
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 600;
}
.admin-who-text { display: flex; flex-direction: column; line-height: 1.25; }
.admin-who-text b { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
.admin-who-text small { color: var(--faint); font-size: 9px; letter-spacing: 0.04em; }
.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 250, 0.6);
  color: var(--muted);
  font-size: 11px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.bar-btn .ico { width: 13px; height: 13px; }
.bar-btn:hover { color: var(--ink); background: #fffef9; border-color: var(--line-strong); }
.bar-btn-danger:hover { color: var(--danger); border-color: rgba(207, 75, 92, 0.34); background: rgba(207, 75, 92, 0.05); }

.admin-main {
  flex: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 34px 24px 56px;
}
.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 26px;
}
.admin-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.admin-eyebrow i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.12); }
.admin-hero h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 600; letter-spacing: -0.045em; }
.admin-hero p { max-width: 660px; margin-top: 9px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 9px; flex: none; padding-bottom: 3px; }

.btn-primary,
.btn-soft,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.btn-primary {
  background: var(--ink);
  color: #fffef8;
  box-shadow: 0 10px 22px -12px rgba(24, 32, 28, 0.6);
}
.btn-primary:hover { background: #25312b; transform: translateY(-1px); box-shadow: 0 14px 26px -14px rgba(24, 32, 28, 0.65); }
.btn-primary:active { transform: translateY(0); }
.btn-soft { border-color: var(--line); background: rgba(255, 255, 250, 0.62); color: var(--ink-soft); }
.btn-soft:hover { border-color: var(--line-strong); background: #fffef9; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 10px 22px -12px rgba(207, 75, 92, 0.55); }
.btn-danger:hover { background: #b93f50; transform: translateY(-1px); }
.btn-primary[disabled], .btn-soft[disabled], .btn-danger[disabled] { opacity: 0.62; cursor: wait; transform: none; box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 11px; border-radius: 8px; }
.btn-spinner {
  width: 13px;
  height: 13px;
  border: 1.6px solid rgba(255, 255, 255, 0.36);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-soft .btn-spinner { border-color: rgba(24, 32, 28, 0.2); border-top-color: var(--ink-soft); }
.is-spinning .refresh-ico { animation: spin 0.8s linear infinite; }

/* Stats */
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 14px 34px -30px rgba(31, 46, 39, 0.4);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -52px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--tone, rgba(15, 155, 142, 0.08));
  filter: blur(2px);
  pointer-events: none;
}
.stat-mint { --tone: rgba(15, 155, 142, 0.1); --tile: var(--mint-soft); --tile-ink: var(--mint-deep); }
.stat-blue { --tone: rgba(84, 119, 216, 0.1); --tile: #e8eefc; --tile-ink: #4664bf; }
.stat-gold { --tone: rgba(196, 142, 48, 0.12); --tile: #fbf0d8; --tile-ink: #9a6a17; }
.stat-violet { --tone: rgba(176, 95, 189, 0.1); --tile: #f4e8f8; --tile-ink: #8b4c9c; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--tile);
  color: var(--tile-ink);
}
.stat-icon .ico { width: 15px; height: 15px; }
.stat-label { display: block; margin-top: 13px; color: var(--muted); font-size: 10.5px; letter-spacing: 0.02em; }
.stat-value { display: block; margin-top: 3px; font-size: 24px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.25; }
.stat-foot { display: block; margin-top: 3px; color: var(--faint); font-size: 9.5px; }

/* Member panel */
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 24px 60px -50px rgba(31, 46, 39, 0.55);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-title h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.panel-title p { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.admin-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f8f0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.admin-search:focus-within { border-color: rgba(15, 155, 142, 0.52); background: #fffef9; box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.09); }
.admin-search .ico { width: 14px; height: 14px; color: var(--faint); }
.admin-search input { width: 172px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11.5px; }
.admin-search input::placeholder { color: #aab2a9; }
.admin-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.admin-select {
  height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #f8f8f0 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a766f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--ink-soft);
  font-size: 11.5px;
  appearance: none;
  cursor: pointer;
}
.admin-select:focus { border-color: rgba(15, 155, 142, 0.52); box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.09); }

.table-wrap { position: relative; overflow-x: auto; }
.admin-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.admin-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafaf1;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.admin-table th.num, .admin-table td.num { text-align: right; }
.admin-table th.actions-col { text-align: right; }
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0e5;
  font-size: 12px;
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfbf3; }
.member-cell { display: flex; align-items: center; gap: 9px; min-width: 168px; }
.member-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, #e6f7f1, #d5f0e7);
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 600;
}
.member-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.member-info b { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.member-info small { color: var(--faint); font-size: 9.5px; white-space: nowrap; }
.key-cell { display: flex; align-items: center; gap: 2px; min-width: 184px; }
.key-cell code {
  padding: 3px 7px;
  border: 1px solid #e8eadb;
  border-radius: 6px;
  background: #f6f7ed;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.015em;
  white-space: nowrap;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  transition: color 0.15s ease, background 0.15s ease;
}
.icon-btn .ico { width: 12px; height: 12px; }
.icon-btn:hover { color: var(--ink); background: rgba(24, 32, 28, 0.055); }
.group-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 7px 0 5px;
  border: 1px solid #e7e9dc;
  border-radius: 999px;
  background: #fbfbf4;
  color: var(--ink-soft);
  font-size: 10.5px;
  white-space: nowrap;
}
.group-tag img { width: 13px; height: 13px; }
.group-tag em {
  font-style: normal;
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef0e4;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}
.group-tag.warn { border-color: #f0d5d9; background: #fdf1f2; color: #a63a48; }
.group-tag.warn em { background: #f7e2e4; color: #a63a48; }
.quota-main { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cell-main { display: block; color: var(--ink-soft); font-size: 11.5px; white-space: nowrap; }
.cell-sub { display: block; margin-top: 1px; color: var(--faint); font-size: 9px; white-space: nowrap; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
}
.status-pill i { width: 5px; height: 5px; border-radius: 50%; }
.status-pill.on { background: #e7f7ef; color: #0b7a55; }
.status-pill.on i { background: #16a36f; box-shadow: 0 0 0 2px rgba(22, 163, 111, 0.14); }
.status-pill.off { background: #f7ebec; color: #a63a48; }
.status-pill.off i { background: #cf4b5c; }
.actions-col { width: 158px; }
.actions-cell { text-align: right; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.row-btn .ico { width: 13px; height: 13px; }
.row-btn:hover { color: var(--ink); background: #f3f4e8; border-color: #e7e9da; }
.row-btn.danger:hover { color: var(--danger); background: #fbf0f1; border-color: #f1d8dc; }
.row-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.admin-loading, .admin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 220px;
  padding: 34px 18px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.admin-loading p, .admin-empty p { color: var(--faint); font-size: 10.5px; }
.admin-empty b { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #f1f3e7;
  color: #9aa79b;
}
.empty-icon .ico { width: 20px; height: 20px; }
.load-ring {
  width: 22px;
  height: 22px;
  border: 2px solid #e2e5d6;
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
}
.admin-pager { display: flex; align-items: center; gap: 8px; }
.admin-pager span { min-width: 86px; text-align: center; color: var(--muted); font-size: 10px; }
.admin-pager button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffef9;
  color: var(--muted);
}
.admin-pager button .ico { width: 12px; height: 12px; }
.admin-pager button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.admin-pager button:disabled { opacity: 0.35; cursor: not-allowed; }

/* Notes */
.admin-notes { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; margin-top: 20px; }
.note-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 250, 0.58);
}
.note-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.note-card h3 .ico { width: 14px; height: 14px; color: var(--mint-deep); }
.note-card ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 13px 0 0;
  padding: 0;
  counter-reset: step;
}
.note-card li { position: relative; counter-increment: step; padding-left: 22px; }
.note-card li::before {
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--mint-deep);
  font-family: var(--mono);
  font-size: 9px;
}
.note-card li b { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-soft); }
.note-card li span { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.65; }
.note-card p { margin-top: 10px; color: var(--muted); font-size: 10.5px; line-height: 1.75; }
.note-card a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  color: var(--mint-deep);
  font-size: 10.5px;
  font-weight: 500;
}
.note-card a .ico { width: 11px; height: 11px; }
.note-card a:hover { text-decoration: underline; }
.note-warn { background: rgba(251, 240, 216, 0.34); border-color: #ece4ce; }
.note-warn h3 .ico { color: #9a6a17; }

.admin-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 24px 26px;
  color: var(--faint);
  font-size: 9.5px;
}
.admin-footer .fdot { color: #c4c9bd; }

/* Modals */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 32, 28, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: layerIn 0.18s ease both;
}
.modal-layer[hidden] { display: none !important; }
.admin-modal {
  width: min(486px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 40px 90px -30px rgba(24, 32, 28, 0.55);
  animation: modalIn 0.26s var(--ease) both;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-kicker { display: block; margin-bottom: 5px; color: var(--faint); font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.modal-head h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
.modal-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
}
.modal-close .ico { width: 14px; height: 14px; }
.modal-close:hover { background: #f3f4e9; color: var(--ink); }
.modal-body { padding: 17px 24px 22px; }
.modal-lede { margin: -2px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.field-block { margin-top: 15px; }
.field-block label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}
.field-block label span { color: var(--faint); font-size: 9.5px; font-weight: 400; }
.field-hint { margin-top: 6px; color: var(--faint); font-size: 9.5px; line-height: 1.6; }
.field-hint.is-warning { color: var(--danger); }
.admin-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #f8f8f0;
  color: var(--ink);
  font-size: 12.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.admin-input:focus { border-color: rgba(15, 155, 142, 0.6); background: #fffef9; box-shadow: 0 0 0 4px rgba(15, 155, 142, 0.09); }
.admin-input::placeholder { color: #aab2a9; }
.input-affix {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.input-affix:focus-within { border-color: rgba(15, 155, 142, 0.6); background: #fffef9; box-shadow: 0 0 0 4px rgba(15, 155, 142, 0.09); }
.input-affix span { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.input-affix input { flex: 1; min-width: 0; height: 100%; padding: 0 8px; border: 0; outline: 0; background: transparent; font-size: 13px; }
.generated-key {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px dashed rgba(15, 155, 142, 0.38);
  border-radius: 10px;
  background: #f5fbf5;
}
.generated-key code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--mint-deep);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.generated-key button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  flex: none;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffef9;
  color: var(--muted);
  font-size: 9.5px;
}
.generated-key button .ico { width: 10px; height: 10px; }
.generated-key button:hover { color: var(--ink); border-color: var(--line-strong); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-actions .btn-primary, .modal-actions .btn-soft, .modal-actions .btn-danger { height: 38px; }
.modal-message {
  margin-top: 14px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.6;
}
.modal-message.error { border: 1px solid #f0d5d9; background: #fdf1f2; color: #a63a48; }
.modal-message.info { border: 1px solid #e6e8da; background: #f7f8ee; color: var(--muted); }
.modal-message.success { border: 1px solid #cfeadd; background: #eefaf4; color: #0b7a55; }

.target-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf2;
}
.target-summary > div { display: flex; flex-direction: column; line-height: 1.4; }
.target-summary b { font-size: 11.5px; font-weight: 600; }
.target-summary small { color: var(--muted); font-size: 9.5px; }
.target-summary small span { color: var(--ink-soft); font-weight: 500; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 15px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f3e7;
}
.segmented button {
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.segmented button.active { background: #fffef9; color: var(--ink); font-weight: 500; box-shadow: 0 2px 6px -2px rgba(31, 46, 39, 0.18); }

.issued-banner { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.success-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--mint-deep);
  box-shadow: 0 0 0 6px rgba(15, 155, 142, 0.07);
}
.success-mark .ico { width: 18px; height: 18px; stroke-width: 2.2; }
.issued-banner b { display: block; font-size: 12.5px; font-weight: 600; }
.issued-banner small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.key-reveal {
  padding: 15px;
  border: 1px dashed rgba(15, 155, 142, 0.4);
  border-radius: 13px;
  background: linear-gradient(160deg, #f7fcf4, #f1f8ed);
  text-align: center;
}
.key-reveal > span { color: var(--faint); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.key-reveal code {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 500;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}
.key-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 12px; }

/* Toast */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: var(--ink);
  color: #fffef8;
  font-size: 11.5px;
  box-shadow: 0 14px 30px -14px rgba(24, 32, 28, 0.6);
  animation: toastIn 0.2s var(--ease) both;
}
.toast.error { background: #a63a48; }
.toast.is-out { animation: toastOut 0.18s ease both; }

@keyframes layerIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.982); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(6px); }
}

@media (max-width: 1080px) {
  .admin-gate { grid-template-columns: minmax(0, 1fr) minmax(360px, 410px); gap: 40px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-notes { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .admin-gate { grid-template-columns: 1fr; width: min(520px, 100%); gap: 26px; padding-top: 18px; }
  .admin-gate-intro { max-width: none; text-align: center; }
  .admin-gate-intro > p { margin-left: auto; margin-right: auto; }
  .admin-gate-list { max-width: none; text-align: left; }
  .admin-gate-intro h1 br { display: none; }
  .admin-gate-chip { margin-top: 16px; }
  .admin-login-card { max-width: 440px; margin: 0 auto; }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { padding-bottom: 0; }
}
@media (max-width: 760px) {
  .admin-bar-inner { height: 58px; padding: 0 14px; gap: 8px; }
  .admin-bar .admin-brand-tag { display: none; }
  .admin-who-text { display: none; }
  .admin-who { margin-right: 0; }
  .bar-btn span { display: none; }
  .bar-btn { width: 32px; padding: 0; justify-content: center; }
  .admin-main { padding: 24px 14px 44px; }
  .admin-hero { gap: 18px; margin-bottom: 20px; }
  .admin-hero h1 { font-size: 28px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn-primary { flex: 1; }
  .panel-head { flex-direction: column; align-items: stretch; padding: 16px; gap: 12px; }
  .panel-tools { width: 100%; }
  .admin-search { flex: 1; }
  .admin-search input { width: 100%; }
  .admin-select { flex: none; }
  .col-last { display: none; }
  .admin-table { min-width: 760px; }
  .admin-footer { padding-bottom: 20px; }
  .note-card ol { grid-template-columns: 1fr; gap: 9px; }
}
@media (max-width: 560px) {
  .admin-shell { padding: 0 16px; }
  .admin-gate-intro h1 { font-size: clamp(31px, 9.5vw, 40px); }
  .admin-gate-intro > p { font-size: 12px; }
  .admin-gate-list { gap: 8px; }
  .admin-gate-list li { padding: 9px 11px; }
  .admin-login-card { padding: 26px 20px 20px; border-radius: 20px; }
  .admin-login-card::before { left: 20px; right: 20px; }
  .admin-stats { gap: 9px; }
  .stat-card { padding: 14px 14px 12px; }
  .stat-value { font-size: 21px; }
  .admin-notes { margin-top: 14px; }
  .panel-tools { flex-wrap: wrap; }
  .admin-search { flex: 1 1 100%; }
  .admin-search input { width: 100%; }
  .admin-select { flex: 1 1 auto; }
  .modal-layer { padding: 12px; }
  .modal-head { padding: 19px 18px 0; }
  .modal-body { padding: 15px 18px 19px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn-soft, .modal-actions .btn-primary, .modal-actions .btn-danger { flex: 1; }
  .panel-foot { padding: 10px 13px; }
  .admin-pager span { min-width: 74px; }
  .toast-host { bottom: 14px; width: calc(100% - 28px); }
  .toast { max-width: 100%; text-align: center; }
}
