:root {
  --navy-950: #050b16;
  --navy-900: #081221;
  --navy-850: #0b1728;
  --navy-800: #0e1b2f;
  --line: rgba(139, 167, 205, .16);
  --line-strong: rgba(139, 167, 205, .25);
  --text: #edf5ff;
  --muted: #8295b0;
  --blue: #2f82ff;
  --cyan: #31d8ff;
  --green: #20d2a0;
  --red: #ff6473;
  --amber: #f6bb4d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--navy-950); }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 90% -10%, rgba(47,130,255,.11), transparent 28%), var(--navy-950); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.admin-access { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; min-height: 100vh; padding: 24px; overflow: hidden; background: var(--navy-950); }
.access-glow { position: absolute; width: 440px; height: 440px; border-radius: 50%; filter: blur(20px); opacity: .17; pointer-events: none; }
.access-glow-a { top: -260px; left: -120px; background: var(--blue); }
.access-glow-b { right: -260px; bottom: -300px; background: var(--cyan); }
.access-card { position: relative; width: min(100%, 480px); padding: 42px; border: 1px solid var(--line-strong); border-radius: 26px; background: linear-gradient(155deg, rgba(15,31,53,.98), rgba(8,18,33,.98)); box-shadow: var(--shadow); }
.access-logo { display: block; width: 180px; max-height: 48px; object-fit: contain; object-position: left center; margin-bottom: 40px; }
.eyebrow, .section-kicker { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(49,216,255,.11); }
.access-card h1 { margin: 17px 0 9px; font-size: 34px; letter-spacing: -.055em; }
.access-card p { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.access-card label, .filter-bar label > span, .wallet-form label > span { display: block; margin-bottom: 8px; color: #b7c5d8; font-size: 11px; font-weight: 750; }
.access-input-wrap { display: flex; align-items: center; min-height: 52px; border: 1px solid var(--line-strong); border-radius: 13px; background: #07101d; transition: border-color .2s, box-shadow .2s; }
.access-input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,130,255,.13); }
.access-input-wrap input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; color: var(--text); border: 0; outline: 0; background: transparent; }
.icon-button { padding: 10px 14px; color: var(--cyan); background: transparent; font-size: 11px; font-weight: 800; }
.access-submit { width: 100%; margin-top: 14px; }
.access-status { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.access-status.is-error { color: #ff929c; }
.access-card small { display: block; margin-top: 20px; padding-top: 18px; color: #647792; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.55; }

.admin-app { min-height: 100vh; }
.admin-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 78px; padding: 0 clamp(20px, 3vw, 48px); border-bottom: 1px solid var(--line); background: rgba(5,11,22,.91); backdrop-filter: blur(18px); }
.admin-brand { display: flex; align-items: center; gap: 13px; }
.admin-brand img { width: 164px; max-height: 42px; object-fit: contain; object-position: left center; }
.admin-brand span { padding-left: 13px; color: #8fa1ba; border-left: 1px solid var(--line-strong); font-size: 13px; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.live-state { display: flex; align-items: center; gap: 8px; margin-right: 4px; color: #a4b3c8; font-size: 11px; font-weight: 700; }
.live-state i, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(32,210,160,.1); }
.avatar-button { display: grid; place-items: center; width: 39px; height: 39px; color: #06101d; border-radius: 12px; background: linear-gradient(135deg, var(--cyan), var(--blue)); font-size: 11px; font-weight: 900; }

.admin-nav { position: sticky; top: 78px; z-index: 25; display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 10px clamp(20px, 3vw, 48px); overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(7,15,28,.94); backdrop-filter: blur(16px); scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.nav-button { flex: 0 0 auto; min-height: 42px; padding: 0 18px; color: #8295af; border: 1px solid var(--line); border-radius: 11px; background: #0d1a2d; font-size: 12px; font-weight: 780; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.nav-button:hover { color: #fff; border-color: rgba(49,216,255,.28); transform: translateY(-1px); }
.nav-button.is-active { color: #06111f; border-color: transparent; background: linear-gradient(100deg, var(--cyan), var(--blue)); box-shadow: 0 10px 28px rgba(47,130,255,.18); }

.admin-main { width: min(100% - 40px, 1540px); margin: 0 auto; padding: 26px 0 72px; }
.status-banner { display: flex; align-items: center; gap: 11px; min-height: 42px; margin-bottom: 24px; padding: 0 15px; color: #9fb0c6; border: 1px solid var(--line); border-radius: 12px; background: rgba(12,26,45,.72); font-size: 11px; }
.status-banner time { margin-left: auto; color: #637790; }
.status-banner.is-error { color: #ff9da6; border-color: rgba(255,100,115,.24); background: rgba(255,100,115,.07); }
.status-banner.is-error .status-dot { background: var(--red); box-shadow: 0 0 0 5px rgba(255,100,115,.1); }
.admin-view { display: none; animation: view-in .28s ease-out; }
.admin-view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 24px; }
.view-heading.compact { align-items: center; }
.view-heading h1 { margin: 8px 0 5px; font-size: clamp(28px, 3vw, 42px); line-height: 1.05; letter-spacing: -.055em; }
.view-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.owner-chip { display: flex; align-items: center; gap: 11px; min-width: 210px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-850); }
.owner-chip > span { display: grid; place-items: center; width: 36px; height: 36px; color: #06101d; border-radius: 10px; background: linear-gradient(135deg, var(--cyan), var(--blue)); font-size: 10px; font-weight: 900; }
.owner-chip strong, .owner-chip small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-chip strong { font-size: 12px; }
.owner-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(14,29,50,.95), rgba(8,18,33,.98)); box-shadow: 0 14px 45px rgba(0,0,0,.12); }
.metric-card { position: relative; min-height: 137px; padding: 21px; overflow: hidden; border-radius: 17px; }
.metric-card::after { content: ""; position: absolute; right: -36px; bottom: -56px; width: 125px; height: 125px; border-radius: 50%; background: rgba(47,130,255,.06); }
.metric-card > span { color: #8396b0; font-size: 11px; font-weight: 750; }
.metric-card strong { display: block; margin-top: 18px; color: #f3f8ff; font-size: 27px; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 5px; color: #687b95; font-size: 10px; }
.metric-card.metric-blue strong { color: var(--cyan); }
.metric-card.metric-green strong { color: var(--green); }
.overview-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 16px; margin-top: 16px; }
.panel { padding: 22px; border-radius: 18px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.text-button { padding: 5px; color: var(--cyan); background: transparent; font-size: 11px; font-weight: 800; }
.compact-list { display: grid; gap: 8px; }
.promotion-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.promotion-card { position: relative; overflow: hidden; }
.promotion-card::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:#4eb4ff; }
.promotion-card.is-private::before { background:#ad80ff; }
.promotion-card-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.promotion-card-top>span { color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.promotion-card h2 { margin:18px 0 12px; font-size:20px; }
.promotion-code { display:flex; align-items:center; gap:10px; padding:10px; border:1px solid var(--line); border-radius:12px; background:rgba(2,11,24,.42); }
.promotion-code code { flex:1; color:#9ed7ff; font:800 17px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.06em; }
.promotion-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:14px 0; }
.promotion-stats div { padding:10px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.025); }
.promotion-stats span,.promotion-stats strong { display:block; }
.promotion-stats span { color:var(--muted); font-size:9px; }
.promotion-stats strong { margin-top:5px; font-size:14px; }
.promotion-card>p { margin:0; color:var(--muted); font-size:11px; line-height:1.6; }
.compact-user { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 58px; padding: 9px 11px; color: var(--text); border: 1px solid var(--line); border-radius: 12px; background: rgba(7,16,29,.65); text-align: left; }
.compact-user:hover { border-color: rgba(49,216,255,.28); background: rgba(17,37,62,.78); }
.compact-user strong, .compact-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-user strong { font-size: 12px; }
.compact-user span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.compact-user b { color: var(--green); font-size: 12px; }
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.activity-grid button { min-height: 100px; padding: 15px; color: var(--text); border: 1px solid var(--line); border-radius: 13px; background: rgba(7,16,29,.65); text-align: left; transition: border-color .2s, transform .2s; }
.activity-grid button:hover { border-color: rgba(47,130,255,.38); transform: translateY(-2px); }
.activity-grid span { display: block; color: var(--muted); font-size: 10px; }
.activity-grid strong { display: block; margin-top: 18px; color: var(--cyan); font-size: 23px; }

.filter-bar { display: grid; grid-template-columns: minmax(260px,1fr) 150px auto auto; align-items: end; gap: 10px; margin-bottom: 16px; }
.filter-bar:has([data-records-status]) { grid-template-columns: minmax(250px,1fr) 190px 120px auto auto; }
.filter-bar input, .filter-bar select, .wallet-form input { width: 100%; min-height: 44px; padding: 0 13px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; background: #07111f; font-size: 12px; }
.filter-bar input:focus, .filter-bar select:focus, .wallet-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,130,255,.11); }
.table-meta, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #72859f; font-size: 10px; }
.table-meta { min-height: 36px; }
.pagination { margin-top: 16px; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #07111f; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th { padding: 14px; color: #71849f; background: #0a1627; font-size: 9px; font-weight: 850; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
td { padding: 14px; color: #cbd6e5; border-top: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(47,130,255,.055); }
.user-link { max-width: 250px; padding: 0; color: #e8f1fc; background: transparent; font-size: 11px; font-weight: 750; text-align: left; }
.user-link span { display: block; margin-top: 4px; color: #7890ae; font-size: 10px; font-weight: 500; }
.user-link:hover { color: var(--cyan); }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 9px; font-weight: 850; text-transform: capitalize; }
.status-good { color: #45e4b6; background: rgba(32,210,160,.12); }
.status-warn { color: #ffd277; background: rgba(246,187,77,.12); }
.status-bad { color: #ff8994; background: rgba(255,100,115,.12); }
.amount-positive { color: var(--green); font-weight: 800; }
.amount-negative { color: var(--red); font-weight: 800; }
.empty-row td { height: 220px; color: var(--muted); text-align: center; white-space: normal; }
.loading-row td { height: 150px; color: var(--muted); text-align: center; }

.primary-button, .secondary-button, .success-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 15px; border-radius: 10px; font-size: 11px; font-weight: 850; white-space: nowrap; transition: transform .18s, opacity .18s, border-color .18s; }
.primary-button { color: #06101d; background: linear-gradient(100deg, var(--cyan), var(--blue)); }
.secondary-button { color: #aebed2; border: 1px solid var(--line-strong); background: #0c192b; }
.success-button { color: #062218; background: var(--green); }
.danger-button { color: #fff; background: #9f3343; }
.primary-button:hover, .secondary-button:hover, .success-button:hover, .danger-button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .45; transform: none !important; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,5,13,.72); backdrop-filter: blur(5px); }
.user-modal { position: fixed; top: 50%; left: 50%; z-index: 70; display: none; width: min(880px, calc(100vw - 30px)); max-height: calc(100vh - 30px); overflow: auto; border: 1px solid var(--line-strong); border-radius: 22px; background: #091525; box-shadow: 0 35px 100px rgba(0,0,0,.5); transform: translate(-50%,-50%); }
.user-modal.is-open { display: block; animation: modal-in .22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%,-48%) scale(.985); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 24px 18px; border-bottom: 1px solid var(--line); background: rgba(9,21,37,.96); backdrop-filter: blur(12px); }
.modal-header h2 { margin: 7px 0 4px; font-size: 22px; letter-spacing: -.04em; }
.modal-header p { margin: 0; color: var(--muted); font-size: 11px; }
.modal-close { display: grid; place-items: center; width: 36px; height: 36px; color: #9fb0c5; border: 1px solid var(--line); border-radius: 10px; background: #0d1c30; font-size: 23px; }
.user-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; padding: 18px 24px 0; }
.user-summary div, .detail-stats div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #07111f; }
.user-summary span, .detail-stats span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.user-summary strong, .detail-stats strong { display: block; margin-top: 7px; color: #e7f0fb; font-size: 11px; overflow-wrap: anywhere; }
.modal-tabs { display: flex; gap: 7px; padding: 18px 24px 0; overflow-x: auto; scrollbar-width: none; }
.modal-tabs button { flex: 0 0 auto; min-height: 35px; padding: 0 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: #0c192b; font-size: 10px; font-weight: 800; }
.modal-tabs button.is-active { color: #06101d; border-color: transparent; background: var(--cyan); }
.modal-content { padding: 18px 24px 25px; }
.detail-panel { display: none; }
.detail-panel.is-active { display: block; }
.detail-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.wallet-form { display: grid; grid-template-columns: 160px minmax(220px,1fr) auto auto auto; align-items: end; gap: 10px; margin-top: 15px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.action-status { min-height: 18px; margin-top: 12px; color: var(--green); font-size: 11px; }
.action-status.is-error { color: var(--red); }
.detail-list { display: grid; gap: 9px; max-height: 450px; overflow: auto; }
.detail-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #07111f; }
.detail-item strong, .detail-item span { display: block; }
.detail-item strong { color: #e3edf9; font-size: 11px; }
.detail-item span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.detail-item .right { min-width: 130px; text-align: right; }
.detail-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; font-size: 11px; }
.referral-url { display: flex; align-items: center; gap: 12px; }
.referral-url code { flex: 1; padding: 14px 16px; overflow-wrap: anywhere; color: #bceeff; border: 1px solid var(--line); border-radius: 11px; background: #07111f; font-size: 11px; line-height: 1.5; }

.admin-nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 7px; padding: 0 5px; color: #06101d; border-radius: 999px; background: var(--cyan); font-size: 9px; font-weight: 900; }
.admin-nav-count[hidden] { display: none; }
.admin-inbox-layout { display: grid; grid-template-columns: minmax(280px,360px) minmax(0,1fr); gap: 16px; min-height: 650px; }
.admin-conversations-panel,.admin-chat-panel { padding: 0; overflow: hidden; }
.admin-message-search { display: flex; gap: 8px; padding: 15px; border-bottom: 1px solid var(--line); }
.admin-message-search input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; background: #07111f; font-size: 11px; }
.admin-message-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,130,255,.11); }
.admin-conversation-list { height: 590px; overflow-y: auto; }
.admin-conversation-row { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; gap: 10px; width: 100%; padding: 14px 13px; color: var(--text); border-bottom: 1px solid var(--line); background: transparent; text-align: left; transition: background .18s,border-color .18s; }
.admin-conversation-row:hover,.admin-conversation-row.is-active { background: rgba(47,130,255,.09); }
.admin-conversation-row.is-active { box-shadow: inset 3px 0 var(--blue); }
.conversation-avatar { display: grid; place-items: center; width: 39px; height: 39px; color: #062032; border-radius: 12px; background: linear-gradient(135deg,var(--cyan),var(--blue)); font-size: 10px; font-weight: 900; }
.conversation-copy { min-width: 0; }
.conversation-copy strong,.conversation-copy small,.conversation-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { color: #e8f1fc; font-size: 11px; }
.conversation-copy small { margin-top: 3px; color: #748aa7; font-size: 9px; }
.conversation-copy em { margin-top: 7px; color: #9aacbf; font-size: 9px; font-style: normal; }
.conversation-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 9px; }
.conversation-meta time { max-width: 70px; color: #657b97; font-size: 8px; line-height: 1.3; text-align: right; }
.conversation-meta b { display: grid; place-items: center; min-width: 20px; height: 20px; color: #06101d; border-radius: 999px; background: var(--cyan); font-size: 9px; }
.admin-chat-header { min-height: 82px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: rgba(10,22,39,.76); }
.admin-chat-header h2 { margin: 5px 0 3px; font-size: 18px; }
.admin-chat-header p { margin: 0; color: var(--muted); font-size: 10px; }
.admin-message-thread { display: flex; flex-direction: column; gap: 11px; height: 425px; overflow-y: auto; padding: 19px; background: radial-gradient(circle at 100% 0,rgba(47,130,255,.08),transparent 28%),#06101d; }
.admin-message-thread.is-modal { height: 360px; border: 1px solid var(--line); border-radius: 13px; }
.admin-message-bubble { width: fit-content; max-width: 78%; padding: 11px 13px 9px; border: 1px solid var(--line); border-radius: 13px; }
.admin-message-bubble.is-user { align-self: flex-start; border-bottom-left-radius: 4px; background: #0d1d31; }
.admin-message-bubble.is-admin { align-self: flex-end; color: #06101d; border-color: transparent; border-bottom-right-radius: 4px; background: linear-gradient(135deg,var(--cyan),#57a6ff); }
.admin-message-bubble > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-message-bubble strong { font-size: 9px; }
.admin-message-bubble time { color: inherit; opacity: .65; font-size: 8px; }
.admin-message-bubble p { margin: 7px 0 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.admin-message-bubble small { display: block; margin-top: 5px; font-size: 8px; opacity: .66; text-align: right; }
.admin-message-attachment { width: min(310px,62vw); margin: 9px 0 0; overflow: hidden; border: 1px solid rgba(132,164,211,.24); border-radius: 10px; background: rgba(2,8,18,.28); }
.admin-message-attachment a { display: grid; min-height: 105px; place-items: center; background: rgba(2,8,18,.4); }
.admin-message-attachment img { display: block; width: 100%; max-height: 260px; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
.admin-message-attachment.is-ready img { opacity: 1; }
.admin-message-attachment.is-error a { display: none; }
.admin-message-attachment figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; }
.admin-message-attachment figcaption strong { min-width: 0; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.admin-message-attachment figcaption span { flex: 0 0 auto; font-size: 8px; opacity: .72; }
.admin-message-attachment figcaption em { font-style: normal; }
.admin-message-compose { padding: 15px; border-top: 1px solid var(--line); background: #091525; }
.admin-message-compose textarea { width: 100%; min-height: 78px; resize: vertical; padding: 11px 12px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; background: #07111f; font-size: 11px; line-height: 1.5; }
.admin-message-compose textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,130,255,.1); }
.admin-message-compose > div { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-top: 9px; }
.admin-message-compose span { color: var(--muted); font-size: 9px; line-height: 1.4; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .filter-bar, .filter-bar:has([data-records-status]) { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .wallet-form { grid-template-columns: 1fr 1fr; }
  .admin-inbox-layout { grid-template-columns: 300px minmax(0,1fr); }
  .wallet-note { grid-column: span 1; }
}

@media (max-width: 720px) {
  .promotion-grid { grid-template-columns: 1fr; }
  .promotion-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-header { height: 68px; padding: 0 14px; }
  .admin-brand img { width: 130px; }
  .admin-brand span, .live-state, .header-actions > a { display: none; }
  .admin-nav { top: 68px; min-height: 58px; padding: 8px 12px; }
  .nav-button { min-height: 38px; padding: 0 14px; }
  .admin-main { width: min(100% - 24px,1540px); padding-top: 18px; }
  .status-banner { align-items: flex-start; padding: 11px 13px; }
  .status-banner time { display: none; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .owner-chip { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 118px; padding: 16px; }
  .metric-card strong { margin-top: 14px; font-size: 23px; }
  .panel { padding: 15px; }
  .activity-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar, .filter-bar:has([data-records-status]) { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .filter-bar .primary-button, .filter-bar .secondary-button { width: 100%; }
  .access-card { padding: 30px 22px; }
  .user-modal { top: 10px; left: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 20px); transform: none; }
  .user-modal.is-open { animation: none; }
  .modal-header, .modal-content { padding-left: 16px; padding-right: 16px; }
  .user-summary, .modal-tabs { padding-left: 16px; padding-right: 16px; }
  .user-summary { grid-template-columns: 1fr 1fr; }
  .detail-stats, .wallet-form { grid-template-columns: 1fr; }
  .admin-inbox-layout { grid-template-columns: 1fr; }
  .admin-conversation-list { height: 330px; }
  .admin-message-thread { height: 380px; }
  .admin-message-compose > div { align-items: stretch; flex-direction: column; }
  .detail-item { flex-direction: column; }
  .detail-item .right { min-width: 0; text-align: left; }
  .referral-url { align-items: stretch; flex-direction: column; }
}

@media (max-width: 430px) {
  .metric-grid, .activity-grid { grid-template-columns: 1fr; }
  .header-actions { gap: 6px; }
  .header-actions .secondary-button { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
