* {
  box-sizing: border-box;
}

:root {
  --bg: #08080b;
  --panel: rgba(22, 22, 27, .72);
  --panel2: rgba(255,255,255,.06);
  --text: #f7efe4;
  --muted: #aaa199;
  --line: rgba(255,255,255,.12);
  --gold: #d8b46a;
  --violet: #a78bfa;
  --red: #fb7185;
  --green: #86efac;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(167,139,250,.24), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(216,180,106,.20), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(251,113,133,.12), transparent 42%),
    linear-gradient(135deg, #07070a 0%, #111014 50%, #090706 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.authShell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 52px;
}

.hero h1 {
  margin: 28px 0 18px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: .92;
  letter-spacing: -.075em;
}

.hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.badge {
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(216,180,106,.08);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.stats {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stats div {
  min-width: 132px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(18px);
}

.stats strong {
  display: block;
  font-size: 28px;
}

.stats span {
  color: var(--muted);
  font-size: 13px;
}

.authCard, .adminForm, .metric, .taskCard, .empty {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  backdrop-filter: blur(24px);
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
}

.authCard {
  padding: 28px;
  border-radius: 34px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.22);
}

.tabs button, nav button {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.tabs button {
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 800;
}

.tabs button.active, nav button.active {
  color: var(--text);
  background: rgba(255,255,255,.10);
}

form {
  display: grid;
  gap: 16px;
}

.authCard form {
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  outline: none;
  color: var(--text);
  background: rgba(0,0,0,.24);
}

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

input:focus, textarea:focus, select:focus {
  border-color: rgba(216,180,106,.65);
  box-shadow: 0 0 0 4px rgba(216,180,106,.09);
}

.primary {
  border: 0;
  border-radius: 20px;
  padding: 16px 18px;
  color: #111;
  font-weight: 950;
  background: linear-gradient(135deg, #f5d98e, var(--gold), var(--violet));
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 14px;
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.hidden {
  display: none !important;
}

.err {
  color: var(--red);
}

.ok {
  color: var(--green);
}

.topbar {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: grid;
  grid-template-columns: 260px 1fr 230px;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  cursor: pointer;
}

.mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 950;
  background: linear-gradient(135deg, var(--gold), var(--violet));
}

.brand span, .userbox span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.topbar nav {
  justify-self: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.18);
  display: flex;
  gap: 6px;
}

.topbar nav button {
  border-radius: 16px;
  padding: 11px 14px;
  font-weight: 800;
}

.userbox {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  text-align: right;
}

.boardShell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 70px;
}

.screen {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: rgba(255,255,255,.035);
}

.headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.headline h1 {
  margin: 18px 0 10px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: .92;
  letter-spacing: -.07em;
}

.headline p {
  max-width: 700px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}

.dashGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.metric {
  min-height: 170px;
  padding: 24px;
  border-radius: 28px;
}

.metric span {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 34px;
  font-size: 42px;
  letter-spacing: -.06em;
}

.metric p {
  margin: 6px 0 0;
  color: var(--muted);
}

.quick {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick button {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255,255,255,.06);
  font-weight: 850;
}

.tasksGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.taskCard {
  min-height: 260px;
  padding: 24px;
  border-radius: 28px;
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.taskTop, .taskBottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.taskTop span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.taskTop b {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(216,180,106,.10);
  color: var(--gold);
}

.taskCard h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.05em;
}

.taskCard p {
  color: var(--muted);
  line-height: 1.55;
}

.taskBottom em {
  color: var(--muted);
  font-style: normal;
}

.taskBottom button {
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  color: #111;
  font-weight: 900;
  background: var(--gold);
}

.adminForm {
  margin-top: 18px;
  padding: 26px;
  border-radius: 30px;
}

.adminForm h2 {
  margin: 0 0 18px;
  font-size: 32px;
  letter-spacing: -.05em;
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 160px;
  gap: 14px;
}

.empty {
  padding: 34px;
  border-radius: 28px;
  color: var(--muted);
}

.empty.big {
  min-height: 320px;
  display: grid;
  place-items: center;
  font-size: 24px;
}

@media (max-width: 900px) {
  .authShell, .topbar, .dashGrid, .tasksGrid, .formGrid {
    grid-template-columns: 1fr;
  }

  .topbar nav {
    justify-self: stretch;
    overflow-x: auto;
  }

  .userbox {
    justify-content: flex-start;
    text-align: left;
  }

  .headline {
    display: grid;
  }
}

.clickable {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.clickable:hover {
  transform: translateY(-3px);
  border-color: rgba(216,180,106,.42);
  background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
}

.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.64);
  backdrop-filter: blur(18px);
}

.taskModal {
  width: min(860px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(167,139,250,.18), transparent 36%),
    linear-gradient(180deg, rgba(28,28,34,.96), rgba(13,13,17,.96));
  box-shadow: 0 40px 120px rgba(0,0,0,.72);
}

.modalHead {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.modalHead span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.modalHead h2 {
  margin: 10px 0 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .92;
  letter-spacing: -.07em;
}

.modalClose {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255,255,255,.06);
  font-size: 26px;
}

.modalMeta {
  margin: 22px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modalMeta b {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(216,180,106,.08);
}

.modalDescription,
.submitBox,
.feedbackBox {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.045);
}

.modalDescription h3,
.submitBox h3,
.feedbackBox h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -.04em;
}

.modalDescription p,
.feedbackBox p {
  color: var(--muted);
  line-height: 1.65;
}

.flagRow {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 12px;
}

.stars {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.stars button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  font-size: 24px;
}

.stars button.active {
  color: #111;
  border-color: rgba(216,180,106,.8);
  background: linear-gradient(135deg, #f5d98e, var(--gold));
}

.locked {
  opacity: .72;
}

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

  .taskModal {
    padding: 20px;
    border-radius: 26px;
  }
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.25);
}

.leaderCard {
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(216,180,106,.20), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
  backdrop-filter: blur(24px);
}

.leaderCard span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.leaderCard h2 {
  margin: 18px 0 8px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .95;
  letter-spacing: -.06em;
}

.leaderCard p {
  margin: 0;
  color: var(--muted);
}

.scoreTableWrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(24px);
}

.scoreTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.scoreTable th,
.scoreTable td {
  padding: 18px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.scoreTable th {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.scoreTable tbody tr:hover {
  background: rgba(255,255,255,.045);
}

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

.scoreTable .rank {
  color: var(--gold);
  font-weight: 900;
}

.danger {
  border: 1px solid rgba(251,113,133,.35);
  border-radius: 16px;
  padding: 11px 14px;
  color: #fecdd3;
  background: rgba(251,113,133,.10);
  cursor: pointer;
}

.adminTasks {
  margin-top: 18px;
}

.scoreTable td span {
  color: var(--muted);
  font-size: 13px;
}

/* DDCAP UI FIX v18 */

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 14, .62);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand strong {
  font-size: 26px;
  letter-spacing: -.04em;
}

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

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar nav button,
.actions button,
.ghost,
.primary {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 16px;
  color: var(--text);
  background: rgba(255,255,255,.055);
  cursor: pointer;
  font-weight: 800;
  transition: .18s ease;
}

.sidebar nav button {
  text-align: left;
  width: 100%;
}

.sidebar nav button:hover,
.actions button:hover,
.ghost:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.095);
}

.sidebar nav button.active,
.primary {
  border-color: rgba(216,180,106,.45);
  background: linear-gradient(135deg, rgba(216,180,106,.26), rgba(255,255,255,.06));
  color: #fff7df;
}

.userBox {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.045);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.userBox strong {
  font-size: 18px;
}

.userBox span {
  color: var(--gold);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.content {
  padding: 34px;
}

.actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.adminForm {
  max-width: 880px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(24px);
}

.adminForm h2 {
  margin-top: 0;
  font-size: 28px;
}

.adminForm label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 800;
}

.adminForm input,
.adminForm select,
.adminForm textarea,
#flagInput,
#feedbackComment {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  color: var(--text);
  background: rgba(0,0,0,.25);
  outline: none;
}

.adminForm textarea,
#feedbackComment {
  min-height: 130px;
  resize: vertical;
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.ok {
  color: #86efac;
  font-weight: 800;
}

.err {
  color: #fda4af;
  font-weight: 800;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar nav button {
    width: auto;
  }

  .content {
    padding: 18px;
  }

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

/* MODAL FIX v19 */

.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  padding: 28px;
  background:
    radial-gradient(circle at center, rgba(216,180,106,.12), transparent 38%),
    rgba(0,0,0,.72);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 34px;
  border: 1px solid rgba(216,180,106,.28);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(31,29,26,.98), rgba(16,16,20,.98));
  box-shadow:
    0 40px 120px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.modalClose {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
}

.modalClose:hover {
  background: rgba(255,255,255,.12);
}

.taskMeta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 58px 22px 0;
}

.taskMeta .tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid rgba(216,180,106,.28);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(216,180,106,.10);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.modal h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: .95;
  letter-spacing: -.06em;
}

.modal p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

#flagForm {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#flagForm label {
  color: var(--muted);
  font-weight: 900;
}

#flagInput {
  margin-top: 8px;
  height: 58px;
  font-size: 16px;
}

#flagForm .primary {
  height: 60px;
  font-size: 17px;
}

.feedbackBox {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.045);
}

.stars {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.stars button {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.stars button.active {
  color: var(--gold);
  border-color: rgba(216,180,106,.45);
  background: rgba(216,180,106,.14);
}

@media (max-width: 620px) {
  .modalBackdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    padding: 26px 20px;
    border-radius: 26px;
  }

  .modalClose {
    top: 16px;
    right: 16px;
  }
}

/* FEEDBACK ADMIN v20 */

.adminSectionTitle {
  margin: 34px 0 16px;
}

.adminSectionTitle h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -.04em;
}

.adminSectionTitle p {
  margin: 0;
  color: var(--muted);
}

.feedbackTable td {
  vertical-align: top;
}

.feedbackTable td:last-child {
  max-width: 420px;
  white-space: normal;
  line-height: 1.45;
}

.feedbackTable b {
  color: var(--gold);
}

/* TASK FILES v23 */

.attachForm {
  margin-top: 24px;
}

.taskFilesBox {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.045);
}

.taskFilesBox h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.taskFilesList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.downloadBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(216,180,106,.28);
  border-radius: 18px;
  color: var(--text);
  background: rgba(216,180,106,.10);
  text-decoration: none;
  font-weight: 900;
}

.downloadBtn:hover {
  background: rgba(216,180,106,.16);
}

.downloadBtn span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

/* ADMIN EDIT MODAL v25 */

.adminEditModal {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.adminEditForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.adminEditForm small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.switchLine {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  cursor: pointer;
}

.switchLine input {
  width: 18px;
  height: 18px;
}

.switchLine span {
  font-weight: 900;
}

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

#adminEditMsg {
  min-height: 20px;
  margin: 0;
  font-weight: 800;
}
