:root {
  --ink: #12302a;
  --muted: #687873;
  --green-950: #062f29;
  --green-900: #0a4136;
  --green-800: #105846;
  --green-700: #137158;
  --green-500: #22a77d;
  --mint: #dff5eb;
  --lime: #dafa61;
  --cream: #f5f2ea;
  --paper: #fffefa;
  --line: #dce6e1;
  --red: #af4a45;
  --amber: #b96e15;
  --blue: #356f86;
  --shadow: 0 22px 70px rgba(8,48,40,.12);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f4f5ef; font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.panel-open { overflow: hidden; }
button, input { color: inherit; font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }
.environment-banner { min-height: 38px; padding: 7px 20px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #dcefe8; background: var(--green-950); font-size: 11px; }
.environment-banner i { width: 7px; height: 7px; border-radius: 50%; background: #68dfa9; box-shadow: 0 0 0 4px rgba(104,223,169,.13); }
.environment-banner strong { color: var(--lime); }

.admin-login { min-height: calc(100vh - 38px); padding: 55px 24px; position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 76% 15%, rgba(218,250,97,.13), transparent 24%), linear-gradient(135deg, #082e28, #0e5948); }
.admin-login::before, .admin-login::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; pointer-events: none; }
.admin-login::before { width: 560px; height: 560px; right: -270px; top: -290px; box-shadow: 0 0 0 75px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.018); }
.admin-login::after { width: 390px; height: 390px; left: -250px; bottom: -250px; box-shadow: 0 0 0 55px rgba(218,250,97,.025); }
.back-link { position: absolute; z-index: 2; left: 32px; top: 27px; color: #c2ded4; font-size: 12px; }
.back-link:hover { color: white; }
.login-card { width: min(430px, 100%); padding: 38px; position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.28); border-radius: 25px; background: rgba(255,255,255,.98); box-shadow: 0 35px 100px rgba(0,20,16,.38); }
.brand-mark { width: 48px; height: 48px; position: relative; border-radius: 15px; background: var(--lime); }
.brand-mark span { position: absolute; border: 2px solid var(--green-950); }
.brand-mark span:first-child { inset: 12px; }
.brand-mark span:nth-child(2) { inset: 18px; }
.brand-mark i { width: 11px; height: 11px; position: absolute; right: 8px; top: 8px; border: 2px solid var(--green-950); border-radius: 50%; background: var(--lime); }
.brand-mark.small { width: 39px; height: 39px; border-radius: 12px; }
.brand-mark.small span:first-child { inset: 10px; }
.brand-mark.small span:nth-child(2) { inset: 15px; }
.brand-mark.small i { width: 9px; height: 9px; right: 6px; top: 6px; }
.eyebrow, .topbar p, .section-heading p, .panel-heading p, .detail-panel header p { margin: 22px 0 5px; color: var(--green-700); font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.login-card h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.login-card form { margin-top: 24px; display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 750; }
.login-card input { width: 100%; min-height: 48px; padding: 0 14px; background: #f8faf7; border: 1px solid var(--line); border-radius: 11px; outline: 0; font-size: 13px; }
.login-card input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,167,125,.1); }
.login-card form button { min-height: 50px; color: white; background: var(--green-800); border-radius: 12px; font-weight: 800; box-shadow: 0 10px 25px rgba(16,88,70,.18); }
.login-card form button:hover { background: var(--green-700); }
.login-card form button:disabled { cursor: wait; opacity: .65; }
.form-message { min-height: 18px; margin: -3px 0 -5px !important; color: var(--red) !important; font-size: 10px !important; }
.security-note { margin-top: 18px; padding: 13px 14px; display: grid; gap: 2px; border-radius: 11px; background: var(--mint); }
.security-note strong { font-size: 10px; }
.security-note span { color: var(--muted); font-size: 9px; }

.admin-shell { min-height: calc(100vh - 38px); display: grid; grid-template-columns: 228px minmax(0,1fr); }
.sidebar { height: calc(100vh - 38px); padding: 27px 19px 21px; position: sticky; top: 0; display: flex; flex-direction: column; color: white; background: var(--green-950); }
.side-brand { padding: 0 7px 30px; display: flex; align-items: center; gap: 12px; }
.side-brand > span strong, .side-brand > span small { display: block; }
.side-brand strong { font-size: 14px; }
.side-brand small { margin-top: 1px; color: #84ad9f; font: 8px var(--mono); letter-spacing: .1em; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { min-height: 47px; padding: 0 13px; display: flex; align-items: center; gap: 11px; color: #a9c8bd; border-radius: 11px; font-size: 12px; font-weight: 700; }
.sidebar nav a i { width: 22px; font: normal 8px var(--mono); }
.sidebar nav a:hover { color: white; background: rgba(255,255,255,.06); }
.sidebar nav a.active { color: var(--green-950); background: var(--lime); }
.sidebar-note { margin-top: auto; padding: 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.04); }
.sidebar-note span { color: #83ab9d; font: 8px var(--mono); letter-spacing: .12em; }
.sidebar-note strong { margin-top: 6px; display: block; color: var(--lime); font-size: 17px; }
.sidebar-note p { margin: 5px 0 0; color: #9ec0b4; font-size: 9px; line-height: 1.6; }
.wallet-link { margin: 14px 0 0; color: #97b9ad; font-size: 9px; text-align: center; }
.admin-content { min-width: 0; }
.topbar { height: 82px; padding: 0 clamp(24px,4vw,54px); position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(18,48,42,.07); background: rgba(244,245,239,.91); backdrop-filter: blur(15px); }
.topbar p { margin: 0 0 1px; }
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.admin-identity { display: flex; align-items: center; gap: 9px; }
.admin-identity > span { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--green-800); border-radius: 50%; font-size: 10px; font-weight: 850; }
.admin-identity div { min-width: 0; }
.admin-identity strong, .admin-identity small { display: block; }
.admin-identity strong { font-size: 11px; }
.admin-identity small { color: var(--muted); font-size: 9px; }
.admin-identity button, .refresh-button { min-height: 35px; padding: 0 12px; color: var(--green-800); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: 9px; font-weight: 800; }
.admin-identity button:hover, .refresh-button:hover { background: var(--mint); }
.content-body { max-width: 1440px; padding: 39px clamp(24px,4vw,54px) 70px; display: grid; gap: 27px; }
.section-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading p, .panel-heading p { margin: 0 0 3px; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.metric-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.metric-grid article { min-height: 130px; padding: 20px; position: relative; overflow: hidden; border: 1px solid rgba(18,48,42,.07); border-radius: 17px; background: var(--paper); box-shadow: 0 8px 25px rgba(8,48,40,.045); }
.metric-grid article::after { content: ""; width: 70px; height: 70px; position: absolute; right: -30px; top: -30px; border: 1px solid rgba(19,113,88,.1); border-radius: 50%; box-shadow: 0 0 0 17px rgba(19,113,88,.035); }
.metric-grid span, .metric-grid strong, .metric-grid small { display: block; }
.metric-grid span { color: var(--muted); font-size: 10px; font-weight: 750; }
.metric-grid strong { margin-top: 12px; font-size: 27px; letter-spacing: -.04em; }
.metric-grid small { margin-top: 3px; color: #87958f; font-size: 9px; }
.panel { overflow: hidden; border: 1px solid rgba(18,48,42,.08); border-radius: 19px; background: var(--paper); box-shadow: 0 10px 32px rgba(8,48,40,.045); }
.panel-heading { padding: 21px 23px; border-bottom: 1px solid var(--line); }
.search-box { width: min(270px,42vw); min-height: 39px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: #f4f7f4; border: 1px solid var(--line); border-radius: 10px; }
.search-box span { color: #7a8d86; font-size: 18px; }
.search-box input { width: 100%; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 10px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: #7f8f89; background: #f7f9f6; font-size: 8px; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 14px; border-top: 1px solid #edf1ee; font-size: 10px; vertical-align: middle; white-space: nowrap; }
tbody tr:hover td { background: #fbfdfb; }
.account-cell { display: flex; align-items: center; gap: 10px; }
.account-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--green-800); border-radius: 10px; font-size: 9px; font-weight: 850; }
.account-cell strong, .account-cell small { display: block; }
.account-cell strong { font-size: 10px; }
.account-cell small { margin-top: 1px; color: var(--muted); font: 8px var(--mono); }
.status-pill { padding: 4px 7px; display: inline-flex; border-radius: 6px; color: var(--green-700); background: var(--mint); font-size: 8px; font-weight: 800; }
.status-pill.reviewing { color: var(--amber); background: #fff1d8; }
.status-pill.not_started { color: var(--muted); background: #edf1ee; }
.view-user { padding: 6px 9px; color: var(--green-700); background: var(--mint); border-radius: 7px; font-size: 8px; font-weight: 800; }
.table-state { height: 100px; color: var(--muted); text-align: center; }
.table-caption { margin: 0; padding: 11px 23px; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; }
.readonly-pill { padding: 5px 8px; color: var(--green-700); background: var(--mint); border-radius: 7px; font: 8px var(--mono); }
.event-list { display: grid; }
.event-item { padding: 14px 23px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #edf1ee; }
.event-item:first-child { border-top: 0; }
.event-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--green-700); background: var(--mint); border-radius: 9px; font-size: 10px; font-weight: 850; }
.event-item strong, .event-item small { display: block; }
.event-item strong { font-size: 10px; }
.event-item small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.event-item time { color: #82918c; font: 8px var(--mono); }
.list-state { min-height: 90px; margin: 0; display: grid; place-items: center; color: var(--muted); font-size: 10px; }

.detail-backdrop { position: fixed; z-index: 50; inset: 38px 0 0; display: flex; justify-content: flex-end; background: rgba(4,25,21,.44); backdrop-filter: blur(3px); }
.detail-panel { width: min(580px,94vw); height: 100%; overflow-y: auto; background: #f7f8f3; box-shadow: -20px 0 60px rgba(0,25,20,.2); }
.detail-panel > header { min-height: 82px; padding: 17px 24px; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(247,248,243,.95); backdrop-filter: blur(12px); }
.detail-panel header p { margin: 0 0 2px; }
.detail-panel h2 { margin: 0; font-size: 20px; }
.detail-panel header button { width: 36px; height: 36px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 10px; font-size: 21px; }
.detail-content { padding: 23px; display: grid; gap: 16px; }
.detail-hero { padding: 21px; color: white; border-radius: 17px; background: linear-gradient(135deg,var(--green-800),var(--green-950)); }
.detail-hero p { margin: 0; color: #a9d1c2; font: 9px var(--mono); }
.detail-hero h3 { margin: 7px 0 0; font-size: 24px; letter-spacing: -.035em; }
.detail-hero span { margin-top: 5px; display: block; color: #c6dfd6; font-size: 9px; }
.detail-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.detail-stats div, .detail-section { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.detail-stats small, .detail-stats strong { display: block; }
.detail-stats small { color: var(--muted); font-size: 8px; }
.detail-stats strong { margin-top: 5px; font-size: 14px; }
.detail-section h4 { margin: 0 0 10px; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-grid div { padding: 10px; border-radius: 9px; background: #f6f8f5; }
.detail-grid small, .detail-grid strong { display: block; }
.detail-grid small { color: var(--muted); font-size: 8px; }
.detail-grid strong { margin-top: 3px; overflow-wrap: anywhere; font-size: 9px; }
.mini-list { display: grid; gap: 7px; }
.mini-row { padding: 9px 10px; display: flex; justify-content: space-between; gap: 12px; border-radius: 9px; background: #f6f8f5; }
.mini-row strong, .mini-row small { display: block; }
.mini-row strong { font-size: 9px; }
.mini-row small { color: var(--muted); font-size: 8px; }
.mini-row b { font-size: 9px; white-space: nowrap; }
.empty-note { margin: 0; color: var(--muted); font-size: 9px; }
.toast { min-width: 180px; padding: 11px 15px; position: fixed; z-index: 90; left: 50%; bottom: 23px; opacity: 0; color: white; background: var(--green-950); border-radius: 10px; box-shadow: var(--shadow); pointer-events: none; font-size: 10px; transform: translate(-50%,12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 950px) {
  .admin-shell { grid-template-columns: 78px minmax(0,1fr); }
  .sidebar { padding-inline: 13px; }
  .side-brand { justify-content: center; padding-inline: 0; }
  .side-brand > span, .sidebar nav a span, .sidebar-note, .wallet-link { display: none; }
  .sidebar nav a { justify-content: center; padding: 0; }
  .sidebar nav a i { width: auto; }
}

@media (max-width: 700px) {
  .environment-banner span { display: none; }
  .admin-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: auto; min-height: 74px; padding: 12px 18px; }
  .topbar > div:first-child p { display: none; }
  .topbar h1 { font-size: 17px; }
  .admin-identity div { display: none; }
  .content-body { padding: 27px 16px 55px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-grid article { min-height: 110px; padding: 16px; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .admin-login { padding-inline: 16px; }
  .back-link { left: 18px; }
  .login-card { padding: 29px 23px; }
  .metric-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
