/* polihot login — plum + gold on paper */
:root {
  --ph-plum-900: #3a0532;
  --ph-plum-800: #4a0742;
  --ph-plum-700: #5e0a55;
  --ph-plum-600: #7e0c6e;
  --ph-plum-500: #9a2a8a;
  --ph-plum-300: #d88ec5;
  --ph-plum-100: #f0dbea;
  --ph-plum-50: #f9eef6;
  --ph-gold-700: #8b6a2a;
  --ph-gold-600: #a7813a;
  --ph-gold-500: #c9a961;
  --ph-gold-400: #dfc58a;
  --ph-gold-200: #efe0b8;
  --ph-paper: #faf6ee;
  --ph-paper-warm: #f5efe3;
  --ph-paper-deep: #ece3d1;
  --ph-ink: #2a1a28;
  --ph-ink-soft: #4d3b49;
  --ph-ink-mute: #7b6976;
  --ph-danger: #a33b4a;
  --ph-ok: #3d6b4f;
  --ph-serif: "Noto Serif SC", "Songti SC", serif;
  --ph-display: "Playfair Display", "Noto Serif SC", serif;
  --ph-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ph-mono: "JetBrains Mono", ui-monospace, monospace;
  --ph-radius: 12px;
  --ph-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -22px rgba(58, 5, 50, 0.35);
  --ph-max: 1080px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--ph-sans);
  color: var(--ph-ink);
  background:
    radial-gradient(at 12% 0%, rgba(126, 12, 110, 0.08) 0%, transparent 48%),
    radial-gradient(at 90% 100%, rgba(201, 169, 97, 0.1) 0%, transparent 45%),
    var(--ph-paper);
  line-height: 1.65;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: 0.3; z-index: 0;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; min-height: 100vh; }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: min(var(--ph-max), calc(100% - 2rem)); margin: 0 auto; padding: 1.25rem 0 0.75rem;
  border-bottom: 1px solid var(--ph-gold-500); position: relative;
}
.site-header::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--ph-gold-500); transform: translateX(-50%);
}
.brand { display: flex; flex-direction: column; gap: 0.15rem; text-decoration: none; color: inherit; }
.brand-mark {
  font-family: var(--ph-display); font-size: 0.72rem; letter-spacing: 0.38em;
  text-transform: uppercase; color: var(--ph-plum-500);
}
.brand-title {
  font-family: var(--ph-serif); font-size: 1.15rem; font-weight: 700;
  color: var(--ph-plum-700); letter-spacing: 0.04em; margin: 0;
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.7rem;
  border-radius: 999px; background: var(--ph-plum-50); border: 1px solid var(--ph-plum-100);
  color: var(--ph-plum-700); font-size: 0.82rem;
}
.role-pill {
  font-family: var(--ph-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border-radius: 4px; background: var(--ph-gold-200); color: var(--ph-gold-700);
}
.role-pill.is-admin { background: var(--ph-plum-600); color: #fff; }
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; padding: 0.55rem 1.1rem;
  font-family: var(--ph-sans); font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--ph-plum-700), var(--ph-plum-600)); color: #fff;
  box-shadow: 0 10px 20px -12px rgba(94, 10, 85, 0.7);
}
.btn-gold {
  background: linear-gradient(135deg, var(--ph-gold-600), var(--ph-gold-500)); color: var(--ph-plum-900);
  box-shadow: 0 10px 20px -12px rgba(139, 106, 42, 0.7);
}
.btn-ghost { background: transparent; border-color: var(--ph-plum-300); color: var(--ph-plum-700); }
.btn-ghost:hover { background: var(--ph-plum-50); }
.btn-danger { background: transparent; border-color: rgba(163, 59, 74, 0.35); color: var(--ph-danger); }
.btn-danger:hover { background: rgba(163, 59, 74, 0.08); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.linkish {
  background: none; border: none; padding: 0; color: var(--ph-plum-600); font: inherit;
  font-size: 0.88rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-size: 0.82rem; color: var(--ph-ink-soft); letter-spacing: 0.04em; }
.field input {
  width: 100%; border: 1px solid var(--ph-paper-deep); background: #fffdf8; border-radius: 10px;
  padding: 0.7rem 0.85rem; font-family: var(--ph-sans); font-size: 0.95rem; color: var(--ph-ink); outline: none;
}
.field input:focus { border-color: var(--ph-plum-500); box-shadow: 0 0 0 3px rgba(126, 12, 110, 0.12); }
.field .hint { font-size: 0.75rem; color: var(--ph-ink-mute); }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin: 0.25rem 0 1.1rem; }
.pw-rules {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.75rem; margin: 0.25rem 0 0.75rem;
  padding: 0; list-style: none; font-size: 0.75rem; color: var(--ph-ink-mute);
}
.pw-rules li { display: flex; align-items: center; gap: 0.35rem; }
.pw-rules li.ok { color: var(--ph-ok); }
.pw-rules li .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ph-paper-deep); flex-shrink: 0; }
.pw-rules li.ok .dot { background: var(--ph-ok); }
.auth-page {
  width: min(920px, calc(100% - 2rem)); margin: 2.5rem auto 3rem; display: grid;
  grid-template-columns: 1.05fr 0.95fr; min-height: 560px; border: 1px solid var(--ph-gold-400);
  border-radius: calc(var(--ph-radius) + 4px); overflow: hidden; box-shadow: var(--ph-shadow);
  background: #fffdf8; animation: rise-in 0.45s ease both;
}
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.auth-aside {
  position: relative; padding: 2.5rem 2.2rem;
  background: linear-gradient(160deg, rgba(58, 5, 50, 0.92), rgba(126, 12, 110, 0.88)), var(--ph-plum-800);
  color: var(--ph-paper); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.auth-aside::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: 8px; pointer-events: none;
}
.auth-aside .eyebrow {
  font-family: var(--ph-display); letter-spacing: 0.36em; text-transform: uppercase;
  font-size: 0.7rem; color: var(--ph-gold-400); margin-bottom: 1.25rem;
}
.auth-aside h1 {
  font-family: var(--ph-serif); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.3;
  margin: 0 0 1rem; font-weight: 700;
}
.auth-aside p { color: rgba(250, 246, 238, 0.82); font-size: 0.92rem; margin: 0; max-width: 28ch; }
.seal {
  width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--ph-gold-500);
  display: grid; place-items: center; font-family: var(--ph-display); color: var(--ph-gold-400);
  letter-spacing: 0.12em; font-size: 0.78rem; margin-bottom: 1.5rem;
  box-shadow: 0 0 0 6px rgba(201, 169, 97, 0.12); position: relative; z-index: 1;
}
.auth-main { padding: 2.4rem 2.2rem; display: flex; flex-direction: column; justify-content: center; }
.auth-main h2 {
  font-family: var(--ph-serif); color: var(--ph-plum-700); font-size: 1.55rem; margin: 0 0 0.35rem;
}
.auth-main .lead { color: var(--ph-ink-mute); font-size: 0.88rem; margin: 0 0 1.4rem; }
.auth-footer-links {
  margin-top: 1rem; display: flex; justify-content: space-between; gap: 0.75rem;
  font-size: 0.86rem; color: var(--ph-ink-mute);
}
.form-alert {
  border-radius: 10px; padding: 0.65rem 0.85rem; font-size: 0.85rem; margin-bottom: 1rem; display: none;
}
.form-alert.show { display: block; }
.form-alert.error {
  background: rgba(163, 59, 74, 0.08); color: var(--ph-danger); border: 1px solid rgba(163, 59, 74, 0.2);
}
.form-alert.success {
  background: rgba(61, 107, 79, 0.1); color: var(--ph-ok); border: 1px solid rgba(61, 107, 79, 0.22);
}
.view {
  width: min(var(--ph-max), calc(100% - 2rem)); margin: 1.75rem auto 3rem; animation: rise-in 0.35s ease both;
}
.hero-panel {
  text-align: center; padding: 1.5rem 1rem 1.25rem; border-bottom: 1px solid var(--ph-gold-500);
  position: relative; margin-bottom: 1.75rem;
}
.hero-panel::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--ph-gold-500); transform: translateX(-50%);
}
.hero-panel .eyebrow {
  font-family: var(--ph-display); letter-spacing: 0.4em; text-transform: uppercase;
  font-size: 0.75rem; color: var(--ph-plum-500); margin-bottom: 0.7rem;
}
.hero-panel h1 {
  font-family: var(--ph-serif); font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--ph-plum-700);
  margin: 0 0 0.5rem; letter-spacing: 0.04em;
}
.hero-panel p { color: var(--ph-ink-soft); max-width: 40rem; margin: 0 auto; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.card {
  background: #fffdf8; border: 1px solid var(--ph-paper-deep); border-radius: var(--ph-radius);
  padding: 1.15rem 1.2rem;
}
.card h3 {
  margin: 0 0 0.4rem; font-family: var(--ph-serif); color: var(--ph-plum-700); font-size: 1.05rem;
}
.card p, .card .meta { margin: 0; color: var(--ph-ink-mute); font-size: 0.86rem; }
.stat-value {
  font-family: var(--ph-display); font-size: 2rem; color: var(--ph-plum-600); line-height: 1.1; margin: 0.2rem 0;
}
.panel {
  background: #fffdf8; border: 1px solid var(--ph-gold-400); border-radius: var(--ph-radius);
  padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; box-shadow: var(--ph-shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.panel-head h2 {
  margin: 0; font-family: var(--ph-serif); font-size: 1.25rem; color: var(--ph-plum-700);
}
.panel-head .sub { width: 100%; color: var(--ph-ink-mute); font-size: 0.82rem; margin-top: -0.35rem; }
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tab {
  border: 1px solid var(--ph-plum-100); background: var(--ph-plum-50); color: var(--ph-plum-700);
  border-radius: 999px; padding: 0.45rem 1rem; font-size: 0.86rem; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--ph-plum-600); border-color: var(--ph-plum-600); color: #fff; }
.table-wrap { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 720px; }
table.ledger th, table.ledger td {
  text-align: left; padding: 0.7rem 0.55rem; border-bottom: 1px solid var(--ph-paper-deep); vertical-align: middle;
}
table.ledger th {
  font-family: var(--ph-display); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ph-gold-700); border-bottom: 1px solid var(--ph-gold-400); font-weight: 600;
}
table.ledger tr:last-child td { border-bottom: none; }
.mono { font-family: var(--ph-mono); font-size: 0.84rem; }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 0.15rem 0.55rem;
  font-size: 0.72rem; font-weight: 700;
}
.badge-active { background: rgba(61, 107, 79, 0.12); color: var(--ph-ok); }
.badge-disabled { background: rgba(163, 59, 74, 0.1); color: var(--ph-danger); }
.badge-unused { background: var(--ph-gold-200); color: var(--ph-gold-700); }
.badge-used { background: var(--ph-paper-deep); color: var(--ph-ink-mute); }
.pw-cell { display: inline-flex; align-items: center; gap: 0.4rem; }
.pw-mask { font-family: var(--ph-mono); letter-spacing: 0.12em; color: var(--ph-ink-soft); }
.pw-value {
  font-family: var(--ph-mono); color: var(--ph-plum-700); background: var(--ph-plum-50);
  border: 1px dashed var(--ph-plum-300); border-radius: 6px; padding: 0.15rem 0.4rem;
}
.invite-ticket {
  display: inline-flex; flex-direction: column; gap: 0.15rem; min-width: 180px;
  padding: 0.55rem 0.8rem; border: 1px solid var(--ph-gold-500); border-left: 6px solid var(--ph-gold-500);
  border-radius: 8px; background: linear-gradient(135deg, #fffaf0, var(--ph-gold-200));
}
.invite-ticket .code {
  font-family: var(--ph-mono); font-size: 0.95rem; font-weight: 700; color: var(--ph-plum-800);
}
.invite-ticket .meta { font-size: 0.7rem; color: var(--ph-gold-700); }
.warning-note {
  font-size: 0.78rem; color: var(--ph-ink-mute); background: var(--ph-paper-warm);
  border-left: 3px solid var(--ph-gold-500); padding: 0.55rem 0.75rem; margin-top: 0.85rem;
  border-radius: 0 8px 8px 0;
}
.empty { color: var(--ph-ink-mute); font-size: 0.9rem; padding: 0.75rem 0; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(42, 26, 40, 0.45); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(420px, 100%); background: #fffdf8; border: 1px solid var(--ph-gold-400);
  border-radius: var(--ph-radius); padding: 1.5rem 1.4rem; box-shadow: var(--ph-shadow);
}
.modal h3 { margin: 0 0 0.6rem; font-family: var(--ph-serif); color: var(--ph-plum-700); }
.modal p { margin: 0 0 1.1rem; color: var(--ph-ink-soft); font-size: 0.92rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px);
  background: var(--ph-plum-800); color: var(--ph-paper); padding: 0.7rem 1.1rem; border-radius: 999px;
  font-size: 0.86rem; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60; border: 1px solid var(--ph-gold-500); max-width: min(90vw, 420px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.feature-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; padding: 0; margin: 0; list-style: none;
}
.feature-list li {
  background: var(--ph-paper-warm); border: 1px solid var(--ph-paper-deep); border-radius: 10px;
  padding: 0.85rem 0.95rem; font-size: 0.88rem; color: var(--ph-ink-soft);
}
.feature-list li strong {
  display: block; color: var(--ph-plum-700); font-family: var(--ph-serif); margin-bottom: 0.2rem;
}
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { min-height: 220px; padding: 1.75rem 1.5rem; }
  .card-grid, .feature-list, .pw-rules { grid-template-columns: 1fr; }
}
