:root {
  --bg: #080c17;
  --surface: rgba(19, 27, 49, .72);
  --surface-strong: #141d34;
  --line: rgba(181, 199, 255, .14);
  --text: #edf2ff;
  --muted: #9ba8c8;
  --primary: #7c8cff;
  --primary-strong: #6273ff;
  --success: #52d4a5;
  --danger: #ff7190;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 75% -10%, #24366e 0, transparent 36rem), var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .5rem; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.05em; }
h2 { margin-bottom: .45rem; font-size: 1.05rem; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: .55rem; color: var(--primary); font-size: .68rem; font-weight: 700; letter-spacing: .14em; }
.glass-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 48px rgba(0, 0, 0, .2); backdrop-filter: blur(16px); }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #aa76ff); color: white; font-weight: 700; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem; }
.auth-card { width: min(100%, 420px); padding: 2rem; }
.auth-card .brand-mark { margin-bottom: 1.5rem; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; color: var(--muted); font-size: .86rem; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .8rem; background: #0e1527; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 140, 255, .16); }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 10px; padding: .65rem 1rem; font-weight: 600; transition: transform .16s ease, background .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { background: var(--primary); color: #0a1020; }
.button.primary:hover:not(:disabled) { background: var(--primary-strong); color: white; }
.button.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button.danger { background: rgba(255, 113, 144, .13); color: #ffafbf; }
.button.tiny { min-height: 30px; padding: .35rem .55rem; border-color: var(--line); background: transparent; color: var(--text); font-size: .75rem; }
.form-error { min-height: 1.1rem; margin: 0; color: #ffafbf; font-size: .8rem; }
.app-page { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem; }
.sidebar { position: sticky; top: 1.25rem; display: flex; height: calc(100vh - 2.5rem); flex-direction: column; padding: 1rem; }
.logo { display: flex; align-items: center; gap: .65rem; padding: .45rem; font-weight: 700; }
.sidebar nav { display: grid; gap: .25rem; margin-top: 2rem; }
.sidebar nav a { display: flex; gap: .75rem; align-items: center; border-radius: 10px; padding: .72rem .8rem; color: var(--muted); }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(124, 140, 255, .12); color: var(--text); }
.sidebar #logout { margin-top: auto; }
.content-shell { min-width: 0; max-width: 1280px; width: 100%; margin: 0 auto; }
.topbar { display: flex; min-height: 47px; align-items: center; justify-content: space-between; padding: .5rem .25rem; }
.topbar p { margin: 0; }
.page-content { padding: 1rem 0 3rem; }
.hero { padding: 1.5rem 0 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.4rem 0; }
.metric { display: grid; gap: .4rem; padding: 1.15rem; }
.metric p, .metric span { margin: 0; color: var(--muted); font-size: .82rem; }
.metric strong { font-size: 2rem; letter-spacing: -.06em; }
.metric small { font-size: .9rem; font-weight: 500; }
.callout, .shop-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem; }
.callout h2, .callout p { margin-bottom: 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem 0 1.3rem; }
.page-heading p { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { border-bottom: 1px solid var(--line); padding: .9rem 1rem; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 2.5rem; color: var(--muted); text-align: center; }
.badge { display: inline-block; border-radius: 99px; padding: .24rem .5rem; background: rgba(155, 168, 200, .15); color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: capitalize; }
.badge.sold { background: rgba(82, 212, 165, .14); color: var(--success); }
.badge.expired, .badge.banned, .badge.refunded { background: rgba(255, 113, 144, .14); color: #ffafbf; }
.shop-card { min-height: 150px; }
.stock-number { min-width: 74px; color: var(--primary); font-size: 3rem; font-weight: 700; letter-spacing: -.08em; text-align: center; }
.shop-card h2, .shop-card p { margin-bottom: .35rem; }
.secret-card, .notice { max-width: 640px; margin-top: 1rem; padding: 1.25rem; }
.notice { color: #ffe59f; }
.inbox-layout { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 2fr); min-height: 560px; overflow: hidden; }
.inbox-layout aside { border-right: 1px solid var(--line); padding: 1rem; }
.message-list { display: grid; gap: .45rem; margin-top: 1rem; }
.message-item { display: grid; gap: .2rem; border: 0; border-radius: 10px; padding: .72rem; background: transparent; color: var(--text); text-align: left; }
.message-item:hover { background: rgba(124, 140, 255, .12); }
.message-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.message-item span, .message-item small { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.message-detail { min-width: 0; padding: 1.35rem; }
.message-detail header { padding-bottom: 1rem; }
.message-detail header p { margin-bottom: 0; }
.email-frame { width: 100%; min-height: 410px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.two-column > * { padding: 1.2rem; }
code { color: #c6ceff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.docs { padding: 1.3rem; }
.docs h2 { margin-top: 1.75rem; }
.docs h2:first-child { margin-top: 0; }
pre { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; background: #0a1020; white-space: pre-wrap; }
.positive { color: var(--success); }
.negative { color: #ffafbf; }
.loading { padding: 2rem; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 10; max-width: min(90vw, 390px); transform: translateY(1rem); border: 1px solid transparent; border-radius: 10px; padding: .8rem 1rem; opacity: 0; pointer-events: none; transition: all .2s ease; }
.toast.visible { transform: translateY(0); border-color: rgba(82, 212, 165, .3); background: #123b35; opacity: 1; }
.toast.error { border-color: rgba(255, 113, 144, .3); background: #451f32; }
.sidebar-support { margin-top: auto; border-top: 1px solid var(--line); padding: 1rem .45rem .15rem; }
.sidebar-support p { margin-bottom: .45rem; font-size: .78rem; line-height: 1.45; }
.sidebar #logout { margin-top: .85rem; }
.support-link { display: inline-flex; border-radius: 9px; padding: .45rem .6rem; background: rgba(124, 140, 255, .13); color: #cbd2ff; font-size: .88rem; font-weight: 700; }
.usage-advice { border-left: 2px solid var(--primary); margin-top: .8rem; padding-left: .65rem; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.auth-support { margin: 1.25rem 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.auth-support a { color: #cbd2ff; font-weight: 700; }
.sales-callout { align-items: flex-start; background: linear-gradient(118deg, rgba(124, 140, 255, .22), rgba(19, 27, 49, .76)); }
.sales-callout .eyebrow { margin-bottom: .35rem; }
.shop-points { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .75rem; color: #cbd2ff; font-size: .75rem; }
.shop-points span::before { content: '✓'; margin-right: .35rem; color: var(--success); }
.safety-banner { display: flex; gap: .65rem; align-items: flex-start; margin: 0 0 1rem; border: 1px solid rgba(124, 140, 255, .25); border-radius: 12px; padding: .85rem 1rem; background: rgba(124, 140, 255, .08); color: var(--muted); font-size: .83rem; line-height: 1.5; }
.safety-banner strong { color: #d9deff; white-space: nowrap; }
.account-actions { display: flex; gap: .45rem; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(2, 5, 13, .72); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.password-modal { width: min(100%, 510px); padding: 1.3rem; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.modal-header h2 { margin-bottom: 0; }
.modal-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.password-result { margin-top: 1rem; border: 1px solid rgba(82, 212, 165, .26); border-radius: 12px; padding: 1rem; background: rgba(82, 212, 165, .06); }
.password-result p:last-child { margin: .7rem 0 0; font-size: .78rem; line-height: 1.45; }
.inbox-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; margin-top: .85rem; }
.inbox-tools .button { min-height: auto; }
.inbox-hint { margin: .65rem 0 0; color: var(--muted); font-size: .73rem; line-height: 1.4; }

@media (max-width: 800px) {
  .app-page { display: block; padding: .8rem; }
  .sidebar { position: static; height: auto; margin-bottom: .8rem; }
  .sidebar nav { display: flex; overflow-x: auto; margin-top: 1rem; }
  .sidebar nav a { flex: 0 0 auto; }
  .sidebar #logout { display: none; }
  .metric-grid, .two-column { grid-template-columns: 1fr; }
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-layout aside { border-right: 0; border-bottom: 1px solid var(--line); }
  .shop-card { align-items: flex-start; flex-direction: column; }
  .sidebar-support { margin-top: 1rem; }
  .safety-banner { display: grid; }
  .account-actions { flex-wrap: wrap; }
}
