* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, .45);
  --gold-faint: rgba(212, 175, 55, .16);
  --bg: #0a0908;
  --panel: rgba(20, 18, 12, .88);
  --text: #efe9da;
  --muted: #a89f8a;
  --err: #e07a6a;
  --ok: #7ac98f;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.bg-glow {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(1000px 500px at 70% -10%, rgba(212,175,55,.10), transparent 60%),
    radial-gradient(800px 400px at 10% 110%, rgba(212,175,55,.06), transparent 60%);
}
#app { position: relative; min-height: 100vh; max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
.center { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; }

.card {
  background: var(--panel);
  border: 1px solid var(--gold-faint);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-card.wide { max-width: 460px; }

.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 10px; }
.dash-head .brand { flex-direction: row; align-items: baseline; gap: 12px; margin-bottom: 0; }
.brand-mark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px; font-weight: 700; letter-spacing: .12em;
  background: linear-gradient(120deg, #f3e3ae, var(--gold) 45%, #9c7c1e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-head .brand-mark { font-size: 30px; }
.brand-sub { font-family: 'Cormorant Garamond', serif; font-size: 19px; color: var(--muted); letter-spacing: .04em; }
.muted { color: var(--muted); line-height: 1.55; margin: 10px 0 18px; }

form { display: flex; flex-direction: column; gap: 14px; }
label { text-align: left; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
input {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px; font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
input:focus { border-color: var(--gold-soft); }
.code-input { text-align: center; font-size: 24px; letter-spacing: .35em; }

.btn {
  border: none; border-radius: 12px; cursor: pointer;
  padding: 13px 22px; font-size: 15px; font-weight: 600; font-family: inherit;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn.gold {
  background: linear-gradient(120deg, #e8cf7e, var(--gold) 55%, #b8912a);
  color: #221a05;
  box-shadow: 0 6px 22px rgba(212,175,55,.25);
}
.btn.gold:hover { box-shadow: 0 8px 28px rgba(212,175,55,.4); }
.btn.outline { background: transparent; color: var(--gold); border: 1px solid var(--gold-soft); }
.btn.outline:hover { background: var(--gold-faint); }
.btn.small { padding: 8px 16px; font-size: 13px; }
.linklike { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: 16px; font-family: inherit; font-size: 13px; }
.linklike:hover { color: var(--gold); }

.err { color: var(--err); font-size: 13px; min-height: 16px; text-align: center; }

.qr-wrap { display: flex; justify-content: center; margin: 6px 0 12px; }
.qr-wrap img { border-radius: 12px; border: 4px solid #f5edd8; width: 220px; height: 220px; }
.secret-line { font-size: 12px; color: var(--muted); margin-bottom: 16px; word-break: break-all; }
.secret-line code { color: var(--gold); }

.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 20px; }
.backup-grid div {
  font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: .06em;
  background: rgba(0,0,0,.35); border: 1px dashed var(--gold-soft);
  border-radius: 8px; padding: 10px;
}
.row-gap { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 22px; }
.proj-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 600; letter-spacing: .05em; color: #f0e6c8; }
.proj-desc { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.statuses { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.st-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #666; flex: none; box-shadow: 0 0 6px rgba(0,0,0,.4); }
.dot.up { background: var(--ok); box-shadow: 0 0 8px rgba(122,201,143,.5); }
.dot.down { background: var(--err); box-shadow: 0 0 8px rgba(224,122,106,.5); }
.st-ms { margin-left: auto; font-size: 11px; opacity: .7; }
.proj-actions { display: flex; gap: 10px; }
.proj-actions .btn { flex: 1; text-align: center; text-decoration: none; display: inline-block; }

.journal-card h3 { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; margin-bottom: 12px; color: #f0e6c8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--gold); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--gold-faint); white-space: nowrap; }
td { padding: 7px 10px; color: var(--muted); border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
td.ev-ok { color: var(--ok); }
td.ev-bad { color: var(--err); }

.toast {
  background: rgba(224,122,106,.12); border: 1px solid rgba(224,122,106,.4);
  color: var(--err); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px;
}
.foot { text-align: center; color: var(--muted); opacity: .55; font-size: 12px; margin-top: 26px; letter-spacing: .04em; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--gold-faint); border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  #app { padding: 14px 12px 30px; }
  .card { padding: 20px; }
  .backup-grid { grid-template-columns: 1fr; }
}
