:root {
  --bg: #040b16;
  --card: rgba(11, 27, 45, 0.82);
  --line: rgba(162, 195, 229, 0.2);
  --text: #edf5ff;
  --muted: #a7bed9;
  --gold: #ffc15f;
  --cyan: #35d6ff;
  --danger: #ff7676;
  --ok: #4fe390;
  --shadow: 0 25px 55px rgba(3, 11, 23, 0.45);
  --radius-lg: 22px;
  --radius-md: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(980px 460px at 100% 0%, rgba(53, 214, 255, 0.13), transparent 55%),
    radial-gradient(900px 460px at 0% 100%, rgba(255, 193, 95, 0.11), transparent 57%),
    linear-gradient(145deg, #030915 0%, #061325 44%, #051122 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 1.15;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 5vw;
  background: rgba(7, 15, 29, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(11px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand strong {
  display: block;
  letter-spacing: 0.08em;
  font-size: 0.84rem;
}

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

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

.topnav a {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.44rem 0.86rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
  border-color: rgba(53, 214, 255, 0.52);
}

main {
  padding: 32px 5vw 62px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}

.auth {
  max-width: 540px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.auth h1 {
  font-size: 2rem;
}

code {
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

label {
  font-size: 0.82rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(7, 19, 33, 0.9);
  color: var(--text);
  border-radius: 10px;
  padding: 0.66rem 0.72rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(53, 214, 255, 0.58);
}

textarea {
  resize: vertical;
}

.stack {
  display: grid;
  gap: 8px;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.68rem 1rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-gold {
  color: #201400;
  background: linear-gradient(115deg, #ffb733, var(--gold));
}

.btn-ghost {
  color: var(--text);
  background: rgba(8, 20, 35, 0.84);
  border-color: var(--line);
}

.error {
  color: #ffc5c5;
  min-height: 18px;
  font-size: 0.83rem;
}

.hidden {
  display: none !important;
}

#dashboardPanel {
  display: grid;
  gap: 10px;
}

.summary {
  display: grid;
  gap: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.metrics article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.78);
  padding: 10px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-size: 1.25rem;
}

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

.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 20, 35, 0.84);
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
}

.tab.is-active {
  color: #1d1200;
  border-color: transparent;
  background: linear-gradient(120deg, var(--gold), #ffd99f);
}

.tab-panel {
  display: grid;
  gap: 12px;
}

.tab-panel h2 {
  font-size: 1.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.grid .full {
  grid-column: 1 / -1;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.68rem 0.6rem;
  vertical-align: top;
  font-size: 0.84rem;
}

th {
  color: #d4e3f5;
  background: rgba(6, 16, 29, 0.84);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td strong {
  display: block;
}

.tiny-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tiny-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: rgba(8, 20, 35, 0.84);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.72rem;
}

.tiny-btn.warn {
  border-color: rgba(255, 118, 118, 0.45);
  color: #ffd0d0;
}

.tiny-btn.ok {
  border-color: rgba(79, 227, 144, 0.42);
  color: #d2ffe3;
}

.badge {
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  font-size: 0.7rem;
  border: 1px solid var(--line);
}

.badge.paid {
  border-color: rgba(79, 227, 144, 0.48);
  color: #d2ffe3;
}

.badge.pending {
  border-color: rgba(255, 193, 95, 0.5);
  color: #ffe8bf;
}

.badge.failed {
  border-color: rgba(255, 118, 118, 0.48);
  color: #ffd2d2;
}

.materials-list {
  display: grid;
  gap: 8px;
}

.material-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(7, 17, 31, 0.74);
}

.material-card h4 {
  font-size: 1.26rem;
  margin-bottom: 6px;
}

.lesson-row {
  border: 1px solid rgba(162, 195, 229, 0.16);
  border-radius: 8px;
  padding: 7px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.narrow {
  max-width: 420px;
}

@media (max-width: 1120px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 740px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}
