:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5e6875;
  --line: #d8dee7;
  --panel: #ffffff;
  --soft: #f4f6f9;
  --navy: #12233a;
  --blue: #2364d2;
  --red: #cc2936;
  --gold: #b88927;
  --green: #14805e;
  --shadow: 0 16px 40px rgba(18, 35, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f9fc;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.wrap {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.auth-copy h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.login-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 46px);
  align-items: center;
}

.anc-logo {
  width: min(260px, 30vw);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(18, 35, 58, 0.16));
}

.login-hero-text {
  min-width: 0;
}

.auth-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
  margin-top: 30px;
}

.auth-point {
  min-height: 106px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.auth-point strong {
  display: block;
  margin-bottom: 8px;
}

.auth-point span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-inner {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tabs,
.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.tabs button,
.segmented button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.tabs button.active,
.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(18, 35, 58, 0.1);
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 100, 210, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.btn.compact {
  min-height: 38px;
  padding: 0 11px;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.btn.danger {
  background: var(--red);
}

.btn.success {
  background: var(--green);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

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

.event-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.event-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.event-cover,
.gallery-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: #e8edf4;
  color: var(--muted);
  overflow: hidden;
}

.event-cover {
  min-height: 170px;
}

.event-cover img,
.event-cover video,
.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.upload-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upload-card.selected-card {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 100, 210, 0.14);
}

.thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: #e8edf4;
  color: var(--muted);
  overflow: hidden;
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-icon {
  font-size: 42px;
}

.upload-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.upload-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.upload-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.description {
  color: #2b3542;
  font-size: 14px;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.pending {
  background: #fff5db;
  color: #8a6200;
}

.badge.approved {
  background: #e7f7f1;
  color: #0e6d50;
}

.badge.rejected {
  background: #ffe8eb;
  color: #a61f2c;
}

.actions,
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.react {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.react.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef5ff;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 10px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-btn.active {
  background: var(--navy);
  color: #fff;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

.selected-row {
  background: #eef5ff;
}

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

.gallery-tile {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gallery-tile.cover-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 133, 38, 0.16);
}

.gallery-thumb {
  aspect-ratio: 1 / 1;
}

.gallery-caption {
  display: grid;
  gap: 4px;
  padding: 10px;
  font-size: 13px;
}

.gallery-caption span {
  color: var(--muted);
}

.gallery-caption .btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.cover-badge {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  color: var(--navy);
  background: rgba(184, 133, 38, 0.14);
}

.cover-badge svg {
  width: 14px;
  height: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 14, 20, 0.92);
}

.lightbox.open {
  display: flex;
}

.lightbox-stage {
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: min(1180px, calc(100vw - 128px));
  max-height: calc(100vh - 80px);
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.lightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  color: #fff;
}

.lightbox-close,
.lightbox-arrow {
  position: fixed;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.lightbox-close {
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
}

.lightbox-arrow {
  top: 50%;
  width: 54px;
  height: 70px;
  font-size: 54px;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-arrow.left {
  left: 18px;
}

.lightbox-arrow.right {
  right: 18px;
}

.message {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.message.error {
  border-color: #f2b7be;
  background: #fff1f3;
  color: #8a1824;
}

.message.success {
  border-color: #9ed9c5;
  background: #effaf6;
  color: #0d684c;
}

.upload-progress {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  width: min(420px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.upload-progress-label {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.upload-progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #dfe6ef;
}

.upload-progress-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.2s ease;
}

.upload-progress-track div.indeterminate {
  animation: upload-progress-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes upload-progress-pulse {
  from {
    transform: translateX(-40%);
  }

  to {
    transform: translateX(190%);
  }
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(16, 24, 32, 0.48);
}

.dialog.open {
  display: flex;
}

.dialog-box {
  width: min(920px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.dialog-media {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  background: #0c1118;
}

.comments {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.comment {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.comment strong {
  display: block;
  margin-bottom: 4px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .auth-layout,
  .layout,
  .grid,
  .event-grid,
  .login-hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

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

  .login-hero {
    justify-items: start;
  }

  .anc-logo {
    width: 190px;
  }

  .auth-points {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .userbar,
  .toolbar-left,
  .toolbar-right,
  .tabs,
  .segmented {
    width: 100%;
  }

  .tabs button,
  .segmented button {
    flex: 1;
  }

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

  .lightbox-stage {
    max-width: calc(100vw - 78px);
  }

  .lightbox-arrow {
    width: 40px;
    height: 58px;
    font-size: 40px;
  }
}
