:root {
  --bg: #071217;
  --bg-soft: #0c1b21;
  --surface: #11252c;
  --surface-2: #17343d;
  --surface-3: #0d1d23;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6fffc;
  --muted: #bfd2cb;
  --accent: #c8ff4d;
  --accent-2: #62d6ff;
  --orange: #ff9c2f;
  --danger: #ff6b6b;
  --success: #37d67a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --radius-sm: 14px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 255, 77, 0.72) rgba(10, 23, 28, 0.96);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at top left, rgba(98, 214, 255, 0.1), transparent 32%),
    radial-gradient(circle at top right, rgba(200, 255, 77, 0.09), transparent 28%),
    linear-gradient(180deg, #071217 0%, #09171c 30%, #071217 100%);
  overflow-x: hidden;
}

body.is-auth {
  display: grid;
  min-height: 100vh;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(7, 18, 23, 0.98), rgba(11, 28, 34, 0.94));
  border-left: 1px solid rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(200, 255, 77, 0.92), rgba(255, 156, 47, 0.88));
  border: 2px solid rgba(7, 18, 23, 0.92);
  border-radius: 999px;
}

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

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
.auth-logo,
.kicker,
.stat-card strong,
button {
  font-family: "Syne", "Segoe UI", system-ui, sans-serif;
}

button,
.nav a {
  min-height: 44px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 56px 24px;
}

.auth-card,
.panel,
.request-card,
.gallery-admin-card,
.stat-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 52, 61, 0.92), rgba(13, 29, 35, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card::before,
.panel::before,
.request-card::before,
.gallery-admin-card::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(98, 214, 255, 0.1), transparent 42%);
}

.auth-card {
  width: min(100%, 575px);
  padding: clamp(32px, 5vw, 44px);
  border-radius: 26px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-bottom: 18px;
  padding: 9px 16px;
  border: 1px solid rgba(200, 255, 77, 0.26);
  border-radius: 16px;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(200, 255, 77, 0.08);
}

.auth-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 6vw, 3.35rem);
}

.auth-copy {
  max-width: 470px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.7;
}

.admin-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 98px;
  padding: 10px clamp(18px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 18, 23, 0.92);
  backdrop-filter: blur(18px);
}

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

.site-brand img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.site-brand span {
  font-family: "Syne", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.site-brand strong {
  color: var(--accent);
}

.site-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.site-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(236, 246, 242, 0.9);
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.site-menu a:hover,
.site-menu a.is-active {
  color: var(--accent);
  border-color: rgba(200, 255, 77, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.site-menu a:hover {
  transform: translateY(-2px);
}

.site-menu .quote-link {
  min-width: 142px;
  color: #fff8ef;
  background: linear-gradient(135deg, #ff9c2f, #ff7a18);
  box-shadow: 0 18px 40px rgba(255, 122, 24, 0.22);
}

.is-admin .admin-layout {
  min-height: calc(100vh - 98px);
  padding: 0 clamp(18px, 3vw, 28px) 28px;
  gap: 28px;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 18, 23, 0.84);
  backdrop-filter: blur(18px);
}

.is-admin .sidebar {
  top: 98px;
  height: calc(100vh - 126px);
  margin-top: 0;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12, 35, 42, 0.96), rgba(7, 20, 26, 0.98));
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(200, 255, 77, 0.24);
  border-radius: 18px;
  color: #091017;
  font-weight: 950;
  background: var(--accent);
  box-shadow: 0 18px 40px rgba(200, 255, 77, 0.14);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.03em;
}

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

.nav {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.nav a {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 850;
  padding: 14px 16px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.nav a::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(200, 255, 77, 0.32);
  box-shadow: 0 0 0 5px rgba(200, 255, 77, 0.06);
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  border-color: rgba(200, 255, 77, 0.3);
  background: rgba(200, 255, 77, 0.07);
  transform: translateY(-2px);
}

.nav a.is-active::before {
  background: var(--accent);
}

.logout-form {
  margin-top: auto;
}

.admin-main {
  width: min(100% - 48px, 1500px);
  margin-inline: auto;
  padding: 26px 0 54px;
}

.is-admin .admin-main {
  width: 100%;
  min-width: 0;
  padding: 0 0 26px;
}

.topbar,
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  position: relative;
  margin-bottom: 24px;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(5, 14, 18, 0.28), rgba(5, 14, 18, 0.9)),
    linear-gradient(135deg, rgba(98, 214, 255, 0.16), rgba(200, 255, 77, 0.08));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.is-admin .topbar {
  min-height: 116px;
  margin-bottom: 18px;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 34px 28px auto;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(200, 255, 77, 0.14), transparent 68%);
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  border-radius: 999px;
  background: rgba(200, 255, 77, 0.58);
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.04;
}

h1 {
  font-size: clamp(2.2rem, 4.8vw, 4.3rem);
}

h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.user-pill,
.count {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 850;
}

.user-pill,
.count,
.text-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.text-link {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
  outline: none;
}

.auth-card input {
  min-height: 68px;
  border-radius: 18px;
  padding-inline: 20px;
  font-size: 1.08rem;
}

.auth-card button[type="submit"] {
  width: 100%;
  min-height: 64px;
  margin-top: 24px;
  font-size: 1.18rem;
}

.admin-entry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  margin-top: 12px;
  border-radius: 999px;
  color: #091017;
  background: var(--accent);
  font-family: "Syne", "Segoe UI", system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.admin-entry-button:hover {
  transform: translateY(-2px);
}

.auth-card label {
  margin-top: 20px;
  color: rgba(236, 246, 242, 0.92);
  font-size: 0.98rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(200, 255, 77, 0.48);
  box-shadow: 0 0 0 4px rgba(200, 255, 77, 0.1);
}

input[type="file"] {
  color: var(--muted);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #091017;
  background: var(--accent);
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
}

button.ghost {
  width: 100%;
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

button.ghost:hover {
  color: var(--accent);
  border-color: rgba(200, 255, 77, 0.45);
}

button.danger {
  width: 100%;
  margin-top: 10px;
  color: #fff4f4;
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.18);
}

button.compact {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
}

.alert {
  border-radius: var(--radius-sm);
  margin: 0 0 16px;
  padding: 12px 14px;
  font-weight: 850;
}

.alert.error {
  color: #fee2e2;
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(185, 28, 28, 0.18);
}

.alert.success {
  color: #dcfce7;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat-card {
  min-height: 150px;
  padding: 22px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.stat-card:hover {
  border-color: rgba(200, 255, 77, 0.28);
  transform: translateY(-4px);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  color: var(--accent);
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 18px;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-head {
  margin-bottom: 20px;
}

.empty {
  margin-bottom: 0;
  color: var(--muted);
}

.compact-list {
  display: grid;
  gap: 12px;
}

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.compact-row strong,
.compact-row span {
  display: block;
}

.compact-row span {
  color: var(--muted);
}

.compact-row a {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.thumb-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.thumb-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #080b0f;
}

.request-list {
  display: grid;
  gap: 14px;
}

.request-card {
  padding: 20px;
}

.request-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.request-card strong,
.request-card a {
  display: block;
}

.request-card header strong {
  font-size: 1.08rem;
}

.request-card header a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.request-card header span {
  color: var(--muted);
  font-weight: 850;
}

.request-card p {
  margin: 14px 0;
  color: rgba(236, 246, 242, 0.9);
  overflow-wrap: anywhere;
}

.request-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.request-card form {
  margin-top: 14px;
}

.request-card dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.request-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.upload-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 170px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

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

.gallery-admin-card {
  overflow: hidden;
}

.gallery-admin-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: #080b0f;
}

.gallery-admin-card form {
  padding: 16px;
}

.gallery-admin-card form + form {
  padding-top: 0;
}

.gallery-admin-card button {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .admin-layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .site-brand span {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .gallery-admin-grid {
    grid-template-columns: 1fr 1fr;
  }

  .upload-form,
  .request-card dl {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .admin-site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .site-brand span {
    display: inline;
  }

  .site-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .site-menu a {
    flex: 1 1 145px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .is-admin .admin-layout {
    min-height: auto;
    padding: 0 14px 24px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .is-admin .sidebar {
    height: auto;
    margin-top: 16px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
  }

  .logout-form {
    margin-top: 16px;
  }

  .topbar,
  .panel-head,
  .request-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-main {
    width: min(100% - 28px, 1500px);
  }

  .two-column,
  .gallery-admin-grid,
  .upload-form,
  .request-card dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-card {
    padding: 24px;
  }

  .admin-main {
    width: min(100% - 24px, 1500px);
    padding-top: 18px;
  }

  .topbar {
    padding: 24px;
    border-radius: 22px;
  }

  .site-brand img {
    width: 62px;
    height: 62px;
  }

  .site-brand span {
    font-size: 1.55rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .stats-grid,
  .thumb-strip,
  .nav {
    grid-template-columns: 1fr;
  }

  button.compact {
    width: 100%;
  }
}
