@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #171a2b;
  --surface: #20243a;
  --surface-soft: #252a43;
  --field: #171a2c;
  --line: #373d5b;
  --text: #f8f8ff;
  --muted: #b9bed4;
  --accent: #ffd454;
  --accent-text: #242335;
  --blue: #c8c6ff;
  --red: #ffb5b8;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 Manrope, system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 38px); line-height: 1.2; letter-spacing: -.045em; }
h2 { margin-bottom: 16px; font-size: 19px; line-height: 1.3; letter-spacing: -.03em; }
h3 { margin-bottom: 8px; font-size: 16px; line-height: 1.3; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.shell { max-width: 1080px; margin: auto; padding: 22px 28px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -.055em; white-space: nowrap; }
.brand em { color: var(--muted); font-style: normal; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--accent-text); font-size: 22px; font-weight: 800; letter-spacing: -.16em; padding-right: 4px; }
.mark span { color: #85630d; }
.topright { display: flex; align-items: center; gap: 9px; }
.user-chip { font-weight: 700; }
.role { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }

.tabs { display: flex; width: max-content; max-width: 100%; gap: 6px; margin: 22px 0 30px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tab { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab-icon { font-size: 18px; line-height: 1; font-weight: 500; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.hero p { margin: 0; color: var(--muted); }
.eyebrow { display: none; }
.balance { min-width: 225px; padding: 16px 19px; border: 1px solid #ffe494; border-radius: 16px; background: var(--accent); color: var(--accent-text); text-align: left; }
.balance span { display: block; font-size: 11px; font-weight: 800; }
.balance strong { display: block; margin-top: 4px; font-size: 23px; font-weight: 800; letter-spacing: -.04em; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
.card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card.accent { border-color: #9d8550; background: #2e2b36; }
.card p:last-child { margin-bottom: 0; }
.card-header, .row-between { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.card-symbol { display: none; }
.home-grid { align-items: start; }
.channel-form { margin-top: 20px; }
.channel-form .btn { width: 100%; display: flex; justify-content: space-between; }
.channel-item { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.channel-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--accent); }
.channel-item strong { font-size: 14px; }
.offers-area { min-width: 0; }
.offer-list { display: grid; gap: 12px; }
.offer-card { padding: 20px; }
.offer-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.offer-number { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: #39354a; color: var(--accent); font-size: 12px; font-weight: 800; }
.offer-heading { flex: 1; min-width: 0; }
.offer-heading h3 { margin: 0; font-size: 19px; }
.offer-card > p { margin-bottom: 12px; }
.offer-terms { padding: 11px 13px; border-radius: 10px; background: var(--surface-soft); color: #e5e5f0; font-size: 12px; }
.offer-action { display: flex; gap: 8px; margin-top: 16px; }
.offer-action select { flex: 1; }
.offer-action .btn { min-width: 125px; }
.binding-inline, .offer-extra { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.binding-inline .code { margin: 9px 0; }
.binding-inline > .btn, .offer-extra > .btn { margin-top: 10px; }

.badge { display: inline-block; padding: 5px 10px; border-radius: 99px; background: #343850; color: #e8e9f7; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.approved, .badge.received, .badge.paid { background: #4a402a; color: var(--accent); }
.badge.review, .badge.queued, .badge.requested { background: #48402f; color: #ffdb88; }
.badge.rejected { background: #493544; color: var(--red); }
.badge.pending, .badge.moderation { background: #343d5a; color: #c9d3ff; }
.btn { padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; background: var(--accent); color: var(--accent-text); font-weight: 800; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .46; cursor: not-allowed; }
.btn.secondary { border-color: var(--line); background: #303650; color: var(--text); }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.btn.danger { border-color: #795461; background: #49313d; color: var(--red); }
.btn.small { padding: 7px 10px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

label { display: block; margin-bottom: 7px; color: #d5d7e7; font-size: 11px; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 43px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--field); color: var(--text); }
input::placeholder, textarea::placeholder { color: #8289a7; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ffd45422; }
textarea { min-height: 76px; resize: vertical; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { padding: 12px 14px; border: 1px solid #69593d; border-radius: 11px; background: #383342; color: #f9e2a4; font-size: 12px; }
.stat { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.05em; }
.data-list { display: grid; gap: 10px; }
.data-row { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.data-row p { margin: 4px 0; }
.data-row .row-between { align-items: center; }
.code { display: block; padding: 12px; border: 1px dashed #8d7849; border-radius: 11px; background: #3a3540; color: var(--accent); text-align: center; font: 800 18px ui-monospace, monospace; letter-spacing: .05em; overflow-wrap: anywhere; }
.empty { padding: 34px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty .icon { margin-bottom: 8px; font-size: 29px; }
.pill-link { display: inline-block; max-width: 100%; margin-top: 6px; padding: 5px 9px; border: 1px solid #555779; border-radius: 99px; color: var(--blue); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; margin: 18px 0; background: var(--line); }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.metric { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.metric span { color: var(--muted); font-size: 11px; font-weight: 800; }
.metric strong { font-size: 30px; font-weight: 800; letter-spacing: -.05em; }
.metric small { color: var(--muted); }
.work-queue, .settings-stack { display: grid; gap: 12px; }
.queue-group { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.queue-group summary { display: flex; align-items: center; gap: 13px; padding: 16px 18px; list-style: none; font-size: 15px; font-weight: 800; cursor: pointer; }
.queue-group summary::-webkit-details-marker { display: none; }
.queue-group summary > span:nth-child(2) { flex: 1; }
.queue-group summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.queue-group summary b { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 5px; border-radius: 8px; background: #4a402a; color: var(--accent); font-size: 12px; }
.queue-group summary:after { content: '⌄'; color: var(--muted); font-size: 18px; }
.queue-group[open] summary:after { transform: rotate(180deg); }
.queue-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 10px; background: #37354b; color: var(--accent); font-size: 19px; }
.queue-content { padding: 18px; border-top: 1px solid var(--line); }
.queue-content > .section-heading { display: none; }
.queue-content > .grid { margin: 0; }
.queue-content .empty { padding: 25px; }

.loading { display: grid; place-content: center; min-height: 100vh; text-align: center; }
.loading .mark { margin: auto; }
.login { max-width: 430px; margin: 8vh auto; padding: 28px; }
.login h1 { font-size: 31px; }
.login .mark { margin-bottom: 20px; }
#toast { position: fixed; bottom: 24px; left: 50%; z-index: 30; max-width: 90vw; padding: 12px 18px; border-radius: 11px; background: var(--accent); color: var(--accent-text); font-weight: 800; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); transition: .2s; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #ffc2c5; }
.footer { margin-top: 42px; color: #8b91ad; font-size: 12px; }

@media (max-width: 900px) {
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
  .hero { align-items: start; }
  .balance { min-width: 205px; }
}
@media (max-width: 600px) {
  .shell { padding: 16px 15px 108px; }
  .topbar { padding-bottom: 14px; }
  .brand { font-size: 17px; }
  .user-chip, .role { display: none; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; justify-content: space-around; width: 100%; max-width: none; margin: 0; padding: 7px max(14px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; background: #20243af2; backdrop-filter: blur(16px); }
  .tab { display: grid; flex: 1; justify-items: center; gap: 2px; padding: 7px 3px; font-size: 10px; }
  .tab-icon { font-size: 20px; }
  .hero { display: block; margin: 26px 0 24px; }
  .hero p { font-size: 13px; }
  .balance { width: 100%; margin-top: 20px; }
  .grid { gap: 14px; }
  .card { padding: 18px; }
  .offer-action { display: grid; }
  .offer-action .btn { width: 100%; }
  .section-heading { align-items: start; }
  .section-heading > .muted { max-width: 145px; text-align: right; }
  .offers-area > .section-heading > .muted { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .metrics { gap: 7px; }
  .metric { padding: 11px 9px; }
  .metric span { font-size: 10px; }
  .metric strong { font-size: 25px; }
  .metric small { font-size: 9px; }
  .queue-group summary { gap: 8px; padding: 13px; font-size: 13px; }
  .queue-group summary small { font-size: 10px; }
  .queue-icon { width: 30px; height: 30px; font-size: 16px; }
  .queue-content { padding: 13px; }
  #toast { bottom: 87px; }
}
