.app-body { min-height: 100vh; display: flex; flex-direction: column; }

/* Ensure [hidden] wins over component display rules (e.g. .auth-form flex) */
[hidden] { display: none !important; }

.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.app-logout { padding: 8px 16px; font-size: 0.9rem; }

.app-main {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 24px 72px;
}

.app-loading { display: flex; align-items: center; justify-content: center; padding: 90px 0; }
.app-loading[hidden] { display: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: hr-spin 0.8s linear infinite; }
@keyframes hr-spin { to { transform: rotate(360deg); } }

.app-flash {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100;
  max-width: 90%; padding: 12px 20px; border-radius: 10px; font-size: 0.92rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.app-flash.is-ok { border-color: rgba(245,166,35,0.5); color: var(--accent-hi); }
.app-flash.is-err { border-color: rgba(255,122,122,0.5); color: #ff9b9b; }

.verify-note {
  margin: 10px 0 0; padding: 12px 16px; border-radius: 10px; font-size: 0.92rem;
  background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.35); color: var(--accent-hi);
}

/* Buttons: ghost variant (shared token file defines --primary) */
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Auth card */
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.auth-switch { font-size: 0.9rem; color: var(--muted); text-align: center; margin: 4px 0 0; }
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-form { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
.auth-sub { color: var(--muted); font-size: 0.95rem; margin-top: -6px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.auth-form .opt { color: var(--muted); font-weight: 400; }
.auth-form input {
  padding: 11px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form .btn { margin-top: 6px; }
.auth-error { color: #ff7a7a; font-size: 0.88rem; min-height: 1em; margin: 0; }

/* Dashboard */
.dash { width: 100%; max-width: 720px; }
.dash__greeting { font-size: 2rem; letter-spacing: -0.02em; }
.dash__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 40px; }
.dash-card {
  padding: 22px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}
.dash-card__label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.dash-card__value { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.dash-card__value em { font-style: normal; font-size: 1rem; font-weight: 500; color: var(--muted); }

.dash__subtitle { font-size: 1.1rem; margin-bottom: 16px; }
.roadmap { list-style: none; display: flex; flex-direction: column; gap: 12px; padding: 0; }
.roadmap li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
}
.roadmap__stage {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(245,166,35,0.4); color: var(--accent);
}
.roadmap__body h3 { font-size: 1.02rem; margin-bottom: 3px; }
.roadmap__body p { color: var(--muted); font-size: 0.92rem; }

@media (max-width: 520px) {
  .dash__cards { grid-template-columns: 1fr; }
}

/* Verify gate */
.verify-card {
  width: 100%; max-width: 460px; text-align: center; padding: 40px 32px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.verify-mark { font-size: 2.4rem; }
.verify-card h1 { font-size: 1.6rem; margin: 12px 0 10px; }
.verify-card p { color: var(--muted); margin-bottom: 10px; }
.verify-hint { font-size: 0.9rem; }
.verify-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* Machines */
.machines { margin: 8px 0 40px; }
.machines__subtitle { font-size: 1rem; color: var(--muted); margin: 28px 0 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.launcher { padding: 22px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.field { margin-bottom: 20px; }
.field__label { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.opt-card {
  text-align: left; padding: 14px 16px; border-radius: 10px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; display: flex; flex-direction: column; gap: 3px; transition: border-color 0.15s, background 0.15s;
}
.opt-card:hover { border-color: rgba(245,166,35,0.4); }
.opt-card.is-active { border-color: var(--accent); background: rgba(245,166,35,0.08); }
.opt-card strong { font-size: 0.98rem; }
.opt-card em { font-style: normal; font-size: 0.82rem; color: var(--muted); }
.opt-card .price { margin-top: 6px; font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.opt-card .tag { font-size: 0.7rem; background: var(--accent); color: #1a1205; padding: 2px 7px; border-radius: 999px; font-weight: 700; margin-left: 4px; }
.launcher__go { margin-top: 4px; }
.launcher__note { font-size: 0.9rem; margin-top: 12px; min-height: 1em; color: var(--muted); }
.launcher__note.is-ok { color: var(--accent-hi); }
.launcher__note.is-err { color: #ff9b9b; }

.machines-list { display: flex; flex-direction: column; gap: 12px; }
.machines-empty { color: var(--muted); font-size: 0.92rem; }
.machine-card { padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.machine-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.machine-meta { color: var(--muted); font-size: 0.88rem; margin-left: auto; }
.machine-conn { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.machine-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.conn-creds, .conn-line { font-size: 0.9rem; color: var(--muted); }
.conn-hint { font-size: 0.82rem; color: var(--muted); }
code { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 0.85em; color: var(--text); }

.badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }
.badge--ok { color: #7ee0a0; border-color: rgba(126,224,160,0.4); }
.badge--warn { color: var(--accent-hi); border-color: rgba(245,166,35,0.4); }
.badge--muted { color: var(--muted); }

.btn--sm { padding: 7px 14px; font-size: 0.85rem; }
.btn--danger { background: transparent; color: #ff9b9b; border-color: rgba(255,122,122,0.4); }
.btn--danger:hover { background: rgba(255,122,122,0.1); border-color: #ff9b9b; }

/* Dashboard sidebar layout */
.dash-layout { width: 100%; max-width: 1080px; display: grid; grid-template-columns: 210px 1fr; gap: 32px; align-items: start; }
.sidebar { position: sticky; top: 92px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  background: transparent; border: 0; cursor: pointer; font-family: inherit; font-size: 0.96rem;
  color: var(--muted); padding: 11px 14px; border-radius: 10px; transition: background 0.15s, color 0.15s;
}
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.is-active { background: rgba(245,166,35,0.1); color: var(--accent); font-weight: 600; }
.side-ico { font-size: 1.05rem; }
.dash-content { min-width: 0; }
.panel__title { font-size: 1.7rem; letter-spacing: -0.02em; margin-bottom: 22px; }
.acct { display: grid; gap: 18px; margin-bottom: 26px; max-width: 420px; }
.acct > div { display: flex; flex-direction: column; gap: 4px; }
.acct > div > span:last-child { font-size: 1.02rem; }

@media (max-width: 760px) {
  .dash-layout { grid-template-columns: 1fr; gap: 18px; }
  .sidebar { position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side-link { white-space: nowrap; }
}
