:root {
  --a-bg: #0F0F12;
  --a-panel: #17171B;
  --a-panel-2: #1D1D22;
  --a-border: rgba(255,255,255,0.08);
  --a-ink: #EFEDE8;
  --a-ink-dim: rgba(239,237,232,0.6);
  --a-ink-faint: rgba(239,237,232,0.38);
  --a-gold: #C9A24B;
  --a-green: #4CAF7D;
  --a-red: #E5675F;
  --a-radius: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--a-bg); color: var(--a-ink); }
a { color: inherit; text-decoration: none; }

.a-shell { display: flex; min-height: 100vh; }

.a-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--a-panel);
  border-right: 1px solid var(--a-border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.a-brand { font-weight: 700; font-size: 1.05rem; padding: 0 10px 24px; letter-spacing: 0.01em; }
.a-brand span { color: var(--a-gold); }
.a-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--a-ink-dim); font-size: 0.92rem; font-weight: 500;
  margin-bottom: 2px;
}
.a-nav a:hover { background: var(--a-panel-2); color: var(--a-ink); }
.a-nav a.active { background: rgba(201,162,75,0.14); color: var(--a-gold); }
.a-nav form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--a-border); }
.a-nav button {
  width: 100%; text-align: left; background: none; border: none;
  color: var(--a-ink-faint); font-size: 0.88rem; padding: 10px 12px; cursor: pointer; border-radius: 10px;
}
.a-nav button:hover { background: var(--a-panel-2); color: var(--a-ink); }

.a-main { flex: 1; padding: 30px 36px 60px; max-width: 1080px; }
.a-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.a-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.a-subtitle { color: var(--a-ink-faint); font-size: 0.88rem; margin: 4px 0 0; }

.a-status {
  background: rgba(76,175,125,0.12); border: 1px solid rgba(76,175,125,0.3);
  color: var(--a-green); padding: 11px 16px; border-radius: 10px; font-size: 0.86rem; margin-bottom: 20px;
}
.a-errors {
  background: rgba(229,103,95,0.12); border: 1px solid rgba(229,103,95,0.3);
  color: var(--a-red); padding: 11px 16px; border-radius: 10px; font-size: 0.86rem; margin-bottom: 20px;
}
.a-errors ul { margin: 0; padding-left: 18px; }

.a-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.a-stat { background: var(--a-panel); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 18px 20px; }
.a-stat-num { font-size: 1.7rem; font-weight: 700; }
.a-stat-label { color: var(--a-ink-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

.a-card { background: var(--a-panel); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 22px 24px; margin-bottom: 22px; }
.a-card-title { font-size: 1rem; font-weight: 600; margin: 0 0 16px; }

table.a-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.a-table th { text-align: left; color: var(--a-ink-faint); font-weight: 500; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 12px; border-bottom: 1px solid var(--a-border); }
.a-table td { padding: 12px; border-bottom: 1px solid var(--a-border); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-table img.thumb { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--a-panel-2); }

.a-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--a-border); cursor: pointer; background: var(--a-panel-2); color: var(--a-ink);
}
.a-btn:hover { border-color: rgba(255,255,255,0.2); }
.a-btn-gold { background: var(--a-gold); color: #14120b; border-color: var(--a-gold); }
.a-btn-gold:hover { background: #dab562; }
.a-btn-danger { color: var(--a-red); }
.a-btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.a-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.a-badge-green { background: rgba(76,175,125,0.15); color: var(--a-green); }
.a-badge-red { background: rgba(229,103,95,0.15); color: var(--a-red); }
.a-badge-gray { background: rgba(255,255,255,0.08); color: var(--a-ink-dim); }

.a-form label { display: block; font-size: 0.82rem; color: var(--a-ink-dim); margin-bottom: 6px; font-weight: 500; }
.a-form .a-field, .a-form input[type=text], .a-form input[type=email], .a-form input[type=password], .a-form input[type=number], .a-form input[type=date], .a-form input[type=url], .a-form select, .a-form textarea {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--a-border);
  background: var(--a-panel-2); color: var(--a-ink); font-size: 0.9rem; font-family: inherit; margin-bottom: 16px;
}
.a-form textarea { resize: vertical; min-height: 90px; }
.a-form input[type=file] { color: var(--a-ink-dim); margin-bottom: 16px; font-size: 0.84rem; }
.a-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a-check { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.a-check input { width: auto; margin: 0; }
.a-hint { color: var(--a-ink-faint); font-size: 0.78rem; margin: -10px 0 16px; }

.a-link-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--a-border); }
.a-link-row:last-child { border-bottom: none; }
.a-link-platform { font-weight: 600; font-size: 0.86rem; width: 130px; flex-shrink: 0; }
.a-link-url { flex: 1; color: var(--a-ink-dim); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.a-cover-preview { width: 100%; max-width: 180px; border-radius: 10px; margin-bottom: 14px; border: 1px solid var(--a-border); }

.a-login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--a-bg); padding: 20px; }
.a-login-card { width: 100%; max-width: 360px; background: var(--a-panel); border: 1px solid var(--a-border); border-radius: 16px; padding: 32px 28px; }
.a-login-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; }
.a-login-sub { color: var(--a-ink-faint); font-size: 0.85rem; margin: 0 0 24px; }

/* ==== Luxury gold + mobile-first app shell (v3) ==== */
:root { --a-gold-hi: #DDB97A; --a-gold-lo: #9A7840; --a-cream: #F7F4EE; --a-tabbar-h: 62px; }
@keyframes a-shine { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
@keyframes a-glow { 0%,100% { box-shadow: 0 0 20px -6px rgba(221,185,122,.35); } 50% { box-shadow: 0 0 30px -4px rgba(221,185,122,.55); } }
.a-shine { background: linear-gradient(90deg, var(--a-gold-lo) 0%, var(--a-gold-hi) 30%, var(--a-cream) 50%, var(--a-gold-hi) 70%, var(--a-gold-lo) 100%); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: a-shine 5s linear infinite; }

html { -webkit-text-size-adjust: 100%; }
body { background: radial-gradient(ellipse 90% 380px at 50% -80px, rgba(221,185,122,.13), transparent 70%) no-repeat, var(--a-bg); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body.a-noscroll { overflow: hidden; }
.a-title, .a-card-title, .a-login-title { font-family: "Cormorant Garamond", Georgia, serif; }
.a-title { font-size: 1.7rem; font-weight: 600; }
.a-card-title { font-size: 1.25rem; font-weight: 600; }
.a-stat-num { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2rem; font-weight: 600; background: linear-gradient(90deg, var(--a-gold-lo), var(--a-gold-hi), var(--a-cream), var(--a-gold-hi), var(--a-gold-lo)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: a-shine 7s linear infinite; }
.a-stat, .a-card { transition: border-color .25s, box-shadow .25s; }
.a-stat:hover, .a-card:hover { border-color: rgba(221,185,122,.32); }

/* buttons: 44px touch targets, gold shine on the primary */
.a-btn { min-height: 44px; padding: 10px 18px; justify-content: center; text-align: center; }
.a-btn-sm { min-height: 36px; padding: 6px 14px; }
.a-btn-gold { background: linear-gradient(90deg, var(--a-gold-lo) 0%, var(--a-gold-hi) 30%, var(--a-cream) 50%, var(--a-gold-hi) 70%, var(--a-gold-lo) 100%); background-size: 200% auto; border-color: var(--a-gold-hi); animation: a-shine 5s linear infinite; box-shadow: 0 0 24px -8px rgba(221,185,122,.6); }
.a-btn-gold:hover { background-color: transparent; animation-duration: 1.6s; }
.a-btn:active { transform: scale(.98); }
.a-form input[type=text], .a-form input[type=email], .a-form input[type=password], .a-form input[type=number], .a-form input[type=date], .a-form input[type=url], .a-form select, .a-form textarea { font-size: 16px; min-height: 46px; }
.a-form input:focus, .a-form select:focus, .a-form textarea:focus { outline: none; border-color: var(--a-gold-hi); box-shadow: 0 0 0 3px rgba(221,185,122,.18); }
.a-nav a.active { background: rgba(221,185,122,.14); color: var(--a-gold-hi); }
.a-brand span, .a-topbar-brand span { color: var(--a-gold); }

/* base (phones): top bar + bottom tab bar, no sidebar */
.a-shell { display: block; min-height: 100vh; }
.a-sidebar { display: none; }
.a-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(15,15,18,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--a-border); }
.a-topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; }
.a-main { padding: 20px 16px calc(var(--a-tabbar-h) + 34px + env(safe-area-inset-bottom)); max-width: none; }
.a-card { padding: 18px 16px; }
.a-row { grid-template-columns: 1fr; }
.a-header .a-btn { width: 100%; }
.a-link-row { flex-wrap: wrap; }
.a-link-platform { width: 100%; }

.a-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; display: flex; justify-content: space-around; background: rgba(23,23,27,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid rgba(221,185,122,.22); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.a-tabbar a, .a-tabbar button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; background: none; border: none; color: var(--a-ink-faint); font: 500 .66rem/1 "Inter", sans-serif; letter-spacing: .02em; white-space: nowrap; cursor: pointer; position: relative; }
.a-tabbar svg { width: 23px; height: 23px; }
.a-tabbar a.active, .a-tabbar button.active { color: var(--a-gold-hi); }
.a-tabbar a.active::before, .a-tabbar button.active::before { content: ""; position: absolute; top: -7px; width: 26px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--a-gold-lo), var(--a-cream), var(--a-gold-lo)); box-shadow: 0 0 10px rgba(221,185,122,.7); }

.a-sheet-backdrop { position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.55); }
.a-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--a-panel); border-top: 1px solid rgba(221,185,122,.3); border-radius: 20px 20px 0 0; padding: 10px 16px calc(var(--a-tabbar-h) + 16px + env(safe-area-inset-bottom)); }
.a-sheet[hidden], .a-sheet-backdrop[hidden] { display: none; }
.a-sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); margin: 0 auto 14px; }
.a-sheet-who { margin: 0 0 10px; font-weight: 600; }
.a-sheet-who small { display: block; color: var(--a-ink-faint); font-weight: 400; font-size: .78rem; margin-top: 2px; }
.a-sheet-item { display: block; width: 100%; text-align: left; padding: 15px 12px; border-radius: 12px; background: none; border: none; border-top: 1px solid var(--a-border); color: var(--a-ink); font: 500 .98rem "Inter", sans-serif; cursor: pointer; }
.a-sheet-item.active { color: var(--a-gold-hi); }
.a-sheet-out { color: var(--a-red); }

/* tables → cards on phones */
@media (max-width: 899px) {
  table.a-table, .a-table tbody, .a-table tr, .a-table td { display: block; width: 100%; }
  .a-table thead { display: none; }
  .a-table tr { background: var(--a-panel-2); border: 1px solid var(--a-border); border-radius: 12px; padding: 6px 14px; margin-bottom: 10px; }
  .a-table td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--a-border); text-align: right; }
  .a-table td:last-child { border-bottom: none; }
  .a-table td::before { content: attr(data-label); color: var(--a-ink-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; flex-shrink: 0; }
  .a-table td:not([data-label])::before { content: none; }
}

/* tablets/desktop: classic sidebar, no tab bar */
@media (min-width: 900px) {
  .a-shell { display: flex; }
  .a-sidebar { display: block; }
  .a-topbar, .a-tabbar, .a-sheet, .a-sheet-backdrop { display: none !important; }
  .a-main { padding: 30px 36px 60px; max-width: 1080px; }
  .a-card { padding: 22px 24px; }
  .a-row { grid-template-columns: 1fr 1fr; }
  .a-header .a-btn { width: auto; }
  .a-link-row { flex-wrap: nowrap; }
  .a-link-platform { width: 130px; }
}
@media (prefers-reduced-motion: reduce) { .a-shine, .a-btn-gold, .a-stat-num { animation: none; } }
.a-stat-num, .a-card-title, .a-title { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
@media (max-width: 899px) { .a-table td[colspan] { justify-content: center; text-align: center; } .a-table td[colspan]::before { content: none; } }
.a-btn + .a-hint, button.a-btn + .a-hint { margin-top: 12px; }
