:root {
  --bg: #060f1f;
  --bg-soft: #0a152b;
  --surface: rgba(13, 29, 56, 0.82);
  --surface-strong: rgba(10, 23, 43, 0.95);
  --border: rgba(35, 162, 220, 0.28);
  --text: #e6f3ff;
  --muted: #92a9c7;
  --accent: #00d7ff;
  --accent-strong: #09b8ff;
  --danger: #ff7b93;
  --shadow: 0 24px 80px rgba(2, 9, 19, 0.55);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Exo 2", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(4, 164, 211, 0.3), transparent 36%),
    radial-gradient(circle at 92% 92%, rgba(12, 80, 130, 0.36), transparent 36%),
    linear-gradient(122deg, #031022 0%, #070f20 42%, #050c18 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #60f2ff;
}

.site-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.glow-orb {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(46px);
}

.glow-orb.top {
  top: -120px;
  left: -100px;
  width: 380px;
  height: 380px;
  background: rgba(0, 197, 255, 0.22);
}

.glow-orb.bottom {
  right: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  background: rgba(16, 113, 175, 0.25);
}

.header-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(5, 14, 30, 0.78);
  border-bottom: 1px solid rgba(30, 121, 181, 0.34);
}

header {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 14px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(180deg, #67ecff 0%, #00a8f8 100%);
  box-shadow: 0 0 22px rgba(0, 195, 255, 0.72);
}

.brand-text {
  color: #80e6ff;
  text-shadow: 0 0 16px rgba(12, 199, 255, 0.55);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: #bedaf6;
  font-weight: 600;
  font-size: 15px;
}

nav a:hover {
  border-color: rgba(44, 197, 242, 0.35);
  background: rgba(8, 43, 72, 0.58);
  color: #e9fbff;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-weight: 700;
}

h2 {
  font-size: 36px;
  margin-bottom: 10px;
}

h3 {
  font-size: 25px;
  margin-bottom: 10px;
}

p,
label,
li,
td,
th,
input,
select,
textarea,
button {
  font-size: 16px;
}

.card {
  background: linear-gradient(168deg, rgba(14, 35, 67, 0.86) 0%, rgba(9, 22, 44, 0.93) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

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

.compact-card {
  max-width: 560px;
}

.search-result-card {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(64, 182, 232, 0.32);
  border-radius: 14px;
  background: rgba(7, 22, 42, 0.72);
}

.search-result-card p {
  margin: 0 0 10px;
}

.search-result-card p:last-child {
  margin-bottom: 0;
}

.search-result-label {
  display: inline-block;
  min-width: 132px;
  margin-right: 10px;
  color: var(--text);
  font-weight: 700;
}

.gamification-task-card {
  padding-bottom: 18px;
}

.gamification-label {
  margin: 14px 0 8px;
  color: #f0fbff;
  font-weight: 700;
}

.gamification-preview {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(64, 182, 232, 0.28);
  background: rgba(7, 20, 40, 0.76);
  line-height: 1.55;
  white-space: pre-wrap;
}

.gamification-preview-selected {
  border-color: rgba(0, 215, 255, 0.44);
  box-shadow: 0 0 0 1px rgba(0, 215, 255, 0.12) inset;
}

.gamification-meta {
  margin: 12px 0 0;
  color: var(--muted);
}

.gamification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.gamification-actions button {
  min-height: 42px;
  padding: 10px 14px;
}

.grid .card b {
  display: block;
  margin-bottom: 8px;
  color: #9dd5ff;
  letter-spacing: 0.02em;
}

.grid .card div:last-child {
  font-size: 36px;
  line-height: 1.2;
  color: var(--accent);
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(8, 21, 42, 0.82);
  box-shadow: var(--shadow);
}

.card > table {
  width: calc(100% - 16px);
  margin: 14px auto;
}

.profile-summary-table {
  margin-top: 14px;
  margin-bottom: 0;
}

.profile-summary-table th:first-child,
.profile-summary-table td:first-child {
  width: 260px;
}

.profile-summary-table td:last-child {
  color: #f0fbff;
  font-weight: 600;
}

th,
td {
  border-bottom: 1px solid rgba(29, 85, 134, 0.42);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #9ad8ff;
  background: rgba(11, 36, 61, 0.78);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

form.inline {
  display: inline-flex;
}

form p {
  margin: 0 0 12px;
}

form label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d6e7fb;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 124, 182, 0.55);
  background: rgba(4, 17, 34, 0.92);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 201, 255, 0.22);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

button {
  border: 1px solid rgba(30, 178, 235, 0.75);
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 18px;
  color: #012130;
  background: linear-gradient(102deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 0 30px rgba(0, 205, 255, 0.26);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(12, 209, 255, 0.38);
}

button:active {
  transform: translateY(0);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid rgba(30, 178, 235, 0.75);
  border-radius: 12px;
  color: #012130;
  background: linear-gradient(102deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 0 30px rgba(0, 205, 255, 0.26);
  font-weight: 700;
}

.btn-link:hover {
  color: #012130;
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(12, 209, 255, 0.38);
}

.btn-link-secondary {
  color: #d6e8ff;
  background: rgba(10, 31, 55, 0.85);
  border-color: rgba(53, 129, 183, 0.7);
  box-shadow: none;
}

.btn-link-secondary:hover {
  color: #d6e8ff;
  box-shadow: none;
  background: rgba(14, 41, 72, 0.9);
}

.action-cell {
  white-space: nowrap;
}

.action-separator {
  margin: 0 8px;
  color: rgba(122, 187, 224, 0.65);
}

.text-action,
.text-action-button {
  color: #46c9ff;
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
  min-height: 0;
  text-decoration: none;
  cursor: pointer;
}

.text-action:hover,
.text-action-button:hover {
  color: #80ddff;
  background: none;
  box-shadow: none;
  transform: none;
  text-decoration: underline;
}

.btn-secondary {
  color: #d6e8ff;
  background: rgba(10, 31, 55, 0.85);
  border-color: rgba(53, 129, 183, 0.7);
  box-shadow: none;
}

.btn-secondary:hover {
  box-shadow: none;
  background: rgba(14, 41, 72, 0.9);
}

.stats-chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-chart-actions .btn-secondary {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 14px;
  line-height: 1.2;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.messages li {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: rgba(7, 44, 64, 0.75);
  border: 1px solid rgba(22, 181, 241, 0.36);
  color: #bfe9ff;
}

.actions a,
.actions button {
  margin-right: 6px;
  margin-bottom: 6px;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 11, 23, 0.7);
}

.modal-card {
  width: min(560px, 100%);
  background: linear-gradient(168deg, rgba(14, 35, 67, 0.96) 0%, rgba(9, 22, 44, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    width: 100%;
  }

  h2 {
    font-size: 30px;
  }
}

@media (max-width: 640px) {
  main {
    padding: 20px 14px 30px;
  }

  header {
    padding: 12px 14px;
  }

  h2 {
    font-size: 26px;
  }

  th,
  td {
    padding: 10px;
    font-size: 15px;
  }
}
