/* Heaven Door V — UI Style v2 */
:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --surface2: #222536;
  --border:   #2e3248;
  --text:     #e8eaf0;
  --muted:    #7b82a0;
  --accent:   #4ade80;
  --accent2:  #6366f1;
  --red:      #f87171;
  --amber:    #fbbf24;
  --blue:     #60a5fa;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* NAV */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.15s;
}
.topnav a:hover { color: var(--text); background: var(--surface2); }
.topnav a.active { color: var(--accent); background: rgba(74,222,128,.1); }
.nav-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* LAYOUT */
#app, #root {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 20px;
}

/* CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--text); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent2); color: var(--accent2); }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn.primary:hover { opacity: 0.85; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
label.btn { cursor: pointer; }

/* FORMS */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent2); }
.field input[readonly] { opacity: 0.6; cursor: default; }
.field textarea { resize: vertical; min-height: 60px; }
.row { display: flex; gap: 14px; }
.row .field { flex: 1; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .row3 { grid-template-columns: 1fr; } .row { flex-direction: column; } }

/* TABLE */
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; }
td { padding: 10px 10px; border-bottom: 1px solid rgba(46,50,72,.5); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* BADGES */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.green  { background: rgba(74,222,128,.12); color: var(--accent); }
.badge.red    { background: rgba(248,113,113,.12); color: var(--red); }
.badge.amber  { background: rgba(251,191,36,.12);  color: var(--amber); }
.badge.blue   { background: rgba(96,165,250,.12);  color: var(--blue); }

/* NOTICES */
.notice  { background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.3); border-radius: 8px; padding: 12px 16px; color: var(--blue); margin-bottom: 12px; }
.success { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.3); border-radius: 8px; padding: 12px 16px; color: var(--accent); margin-bottom: 12px; }
.error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); border-radius: 8px; padding: 12px 16px; color: var(--red); margin-bottom: 12px; }

.muted { color: var(--muted); font-size: 13px; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
code { background: var(--surface2); border-radius: 4px; padding: 1px 6px; font-size: 12px; color: var(--accent); }

/* EDEN TIERS */
.tier-radio { display: flex; gap: 10px; margin-bottom: 16px; }
.tier-radio label { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); cursor: pointer; font-size: 13px; transition: all .15s; }
.tier-radio input[type=radio] { display: none; }
.tier-radio input:checked + span { color: var(--accent2); font-weight: 600; }

details summary { color: var(--muted); font-size: 13px; }
details[open] summary { color: var(--text); }
