* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-main: #07111f;
  --bg-deep: #030712;
  --panel: rgba(10, 19, 38, 0.82);
  --panel-strong: rgba(8, 16, 32, 0.95);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #8fa4c2;
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.16);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.16);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.14);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.25);
  --grid-line: rgba(56, 189, 248, 0.08);
}

body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(139,92,246,0.16), transparent 30%),
    linear-gradient(180deg, #081120 0%, #050b16 45%, #030712 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.35;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), rgba(0,0,0,0.2));
}

.container {
  width: min(1450px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 34px;
  position: relative;
  z-index: 1;
}

.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.topbar, .hero, .section-card, .ledger-section, .stat-card, .message {
  border-radius: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  padding: 16px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(56,189,248,0.95), rgba(139,92,246,0.9));
  box-shadow: 0 0 26px rgba(56,189,248,0.28);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.brand-text h1 {
  font-size: 1.85rem;
  line-height: 1.1;
  margin-bottom: 6px;
}

.brand-text p,
.section-card-header p,
.helper,
.ledger-helper,
.control-box p,
.stat-note,
.footer-note,
.message {
  color: var(--muted);
}

.top-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-stat, .hero-mini-card, .control-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.top-stat {
  min-width: 140px;
  padding: 12px 15px;
  border-radius: 16px;
}

.top-stat-label, .hero-mini-label, .stat-label, th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.top-stat-value {
  font-size: 1.08rem;
  font-weight: 700;
}

.hero {
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(56,189,248,0.10), rgba(139,92,246,0.10)), rgba(6, 14, 28, 0.72);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: var(--shadow-lg);
}

.hero-grid, .main-grid, .stats-grid {
  display: grid;
  gap: 24px;
}

.hero-grid {
  grid-template-columns: 1.7fr 1fr;
  gap: 22px;
}

.hero-badge-row, .button-row, .top-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-badge, .section-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #dbe8fb;
  font-size: 0.84rem;
  font-weight: 600;
}

.hero h2 {
  font-size: 2.1rem;
  margin: 12px 0;
  line-height: 1.1;
}

.hero p {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 780px;
  margin-bottom: 24px;
}

.market-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.main-price {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.change-pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.12);
  color: #8bf0ad;
}

.change-pill.down {
  color: #ffb4b4;
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.34);
}

.hero-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.hero-mini-card {
  border-radius: 18px;
  padding: 16px;
}

.hero-mini-value, .market-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.hero-mini-note {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.market-panel {
  padding: 20px;
  border-radius: 24px;
  background: rgba(5, 12, 24, 0.86);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-sm);
}

.panel-title-row, .market-stat, .section-card-header, .ledger-toolbar, .ledger-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9fe8ff;
  font-size: 0.84rem;
  font-weight: 700;
}

.live-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(56,189,248,0.7);
}

.market-stat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-stat {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.market-stat:last-child { border-bottom: none; }
.market-stat-label { color: var(--muted); }

.main-grid { grid-template-columns: 1.15fr 0.85fr; margin-bottom: 24px; }

.section-card, .ledger-section, .stat-card {
  padding: 22px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
}

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

th, td {
  padding: 14px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

th { background: rgba(255,255,255,0.04); }

tbody tr:hover td { background: rgba(255,255,255,0.03); }

.student-name { font-weight: 700; color: white; }
.student-sub { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

.coin-pill, .cash-pill, .tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.coin-pill { color: #8fe3ff; background: var(--cyan-soft); border: 1px solid rgba(56,189,248,0.28); }
.cash-pill { color: #ffd983; background: var(--amber-soft); border: 1px solid rgba(245,158,11,0.28); }
.tag-pill.green { color: #9ae8b6; background: var(--green-soft); border: 1px solid rgba(34,197,94,0.28); }
.tag-pill.purple { color: #cfbbff; background: var(--purple-soft); border: 1px solid rgba(139,92,246,0.28); }
.tag-pill.red { color: #ffb3b3; background: var(--red-soft); border: 1px solid rgba(239,68,68,0.28); }

.controls-grid, .ledger-feed { display: grid; gap: 16px; }
.control-box { border-radius: 20px; padding: 18px; }
.form-grid-2, .form-grid-1 { display: grid; gap: 10px; margin-bottom: 10px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }

input, select {
  width: 100%;
  background: rgba(4, 10, 20, 0.95);
  border: 1px solid rgba(148,163,184,0.16);
  color: var(--text);
  padding: 12px 13px;
  border-radius: 14px;
  font-size: 0.94rem;
  outline: none;
}

input:focus, select:focus {
  border-color: rgba(56,189,248,0.42);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.10);
}

button {
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-cyan { background: linear-gradient(135deg, #4fd6ff, #2caef2); color: #032033; }
.btn-green { background: linear-gradient(135deg, #53dd86, #1dbf60); color: #062b17; }
.btn-amber { background: linear-gradient(135deg, #ffc453, #f59e0b); color: #392300; }
.btn-red { background: linear-gradient(135deg, #ff7171, #ef4444); color: white; }

.message {
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.message.success { border-color: rgba(34,197,94,0.28); color: #9ae8b6; }
.message.error { border-color: rgba(239,68,68,0.28); color: #ffb3b3; }

.ledger-block {
  border-radius: 22px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.ledger-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
}

.ledger-main { margin-left: 12px; font-size: 1rem; font-weight: 700; color: white; margin-bottom: 7px; }
.ledger-sub { margin-left: 12px; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.block-id { font-size: 0.9rem; font-weight: 800; color: #96e4ff; margin-left: 12px; }
.block-time { font-size: 0.84rem; color: var(--muted); }

.stats-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-card { position: relative; }
.stat-value { font-size: 2rem; font-weight: 800; margin: 8px 0; }
.footer-note { text-align: center; font-size: 0.9rem; padding-top: 16px; }

@media (max-width: 1250px) {
  .hero-grid, .main-grid, .stats-grid { grid-template-columns: 1fr; }
  .hero-mini-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .container { width: min(100% - 18px, 1450px); }
  .hero-mini-grid, .form-grid-2, .stats-grid { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 1.45rem; }
  .hero h2 { font-size: 1.6rem; }
  .main-price { font-size: 2.15rem; }
}

.password-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.password-modal.hidden {
  display: none;
}

.password-modal-box {
  width: 100%;
  max-width: 420px;
  background: rgba(8, 16, 32, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.password-modal-box h3 {
  margin-bottom: 8px;
}

.password-modal-box p {
  margin-bottom: 14px;
  color: var(--muted);
}

.password-modal-box input {
  width: 100%;
  margin-bottom: 14px;
}

.password-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
