:root {
  --bg: #edf9f1;
  --white: #ffffff;
  --line: #c8ecd1;
  --text: #0f2f1a;
  --muted: #65806e;
  --green: #0ea44b;
  --green-2: #1ec661;
  --green-3: #dff8e8;
  --danger: #cf304f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Manrope, sans-serif;
  background: linear-gradient(150deg, #ffffff 0%, #ecf9f0 48%, #def6e7 100%);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
}

.brand {
  text-decoration: none;
  color: inherit;
  display: grid;
  line-height: 1;
}

.brand span {
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
}

.brand b {
  font-size: 26px;
  color: var(--green);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a,
.tabs a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.nav a.active,
.tabs a.active {
  background: #101412;
  color: #fff;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hello {
  font-weight: 700;
  color: var(--muted);
}

.container {
  max-width: 1180px;
  margin: 16px auto 36px;
  padding: 0 14px;
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(16, 116, 50, 0.08);
}

h1, h2, h3 {
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
}

.link-muted {
  margin-top: 12px;
  display: inline-block;
  color: var(--muted);
}

.flash {
  max-width: 1180px;
  margin: 12px auto 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}

.flash.ok {
  background: var(--green-3);
  border: 1px solid #9fe0b4;
}

.flash.error {
  background: #fde8ec;
  border: 1px solid #f1b2c0;
  color: #6f1b2b;
}

.danger {
  color: var(--danger);
  font-weight: 700;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(16, 116, 50, 0.08);
}

.bank-card {
  background: linear-gradient(130deg, #0ea44b, #2ecc64);
  color: #fff;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bank-card.secondary {
  background: linear-gradient(130deg, #0f2f1a, #245939);
}

.coin-card {
  background-image:
    linear-gradient(120deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05)),
    linear-gradient(130deg, #17b25a, #0d7d3c);
}

.jon-card {
  background-image:
    radial-gradient(circle at 85% 20%, rgba(255, 219, 111, 0.45), transparent 35%),
    linear-gradient(130deg, #18130a, #2d220d 55%, #1e1809);
  border: 1px solid rgba(255, 212, 96, 0.3);
}

.card-title {
  margin: 0;
  font-weight: 700;
  opacity: 0.9;
}

.card-balance {
  margin: 22px 0 18px;
  font-size: 30px;
  font-weight: 800;
}

.card-meta {
  margin-top: auto;
  opacity: 0.86;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f9fefb;
}

.stat small {
  color: var(--muted);
}

.stat b {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.exchange-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.chart-panel {
  width: 100%;
}

.chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tv-chart {
  width: 100%;
  height: min(74vh, 620px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #1f392f;
  background: #0b1210;
}

.active-tool {
  background: #101412;
  color: #fff;
}

.hero-bank {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: center;
}

.hero-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(120deg, var(--green-2), var(--green));
}

.hero-rates {
  display: grid;
  gap: 10px;
}

.rate-badge {
  border: 1px solid #aee3bc;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f4fff8;
}

.rate-badge.jon {
  border-color: #e6cd7a;
  background: #fff8e6;
}

.rate-badge small {
  color: var(--muted);
}

.rate-badge b {
  display: block;
  margin-top: 2px;
  font-size: 26px;
}

.auth {
  max-width: 460px;
  margin: 26px auto;
}

.form,
.inline-form {
  display: grid;
  gap: 8px;
}

.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

label {
  font-weight: 700;
}

input,
button,
select {
  font: inherit;
}

input {
  border: 1px solid #b8e6c4;
  border-radius: 11px;
  background: #fbfffc;
  color: var(--text);
  padding: 10px 11px;
}

select {
  border: 1px solid #b8e6c4;
  border-radius: 11px;
  background: #fbfffc;
  color: var(--text);
  padding: 10px 11px;
}

button,
.ghost {
  border: 0;
  border-radius: 11px;
  padding: 10px 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

button {
  background: linear-gradient(120deg, var(--green-2), var(--green));
  color: #fff;
}

.ghost {
  background: #effaf2;
  color: #205436;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead th {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef6f1;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 106px;
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.stat-card b {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.row-actions {
  display: grid;
  gap: 7px;
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
  }

  .hero-bank {
    grid-template-columns: 1fr;
  }
}
