:root {
  --um-blue: #00274c;
  --um-maize: #ffcb05;
  --um-blue-soft: #0f3d69;
  --um-blue-tint: #eaf0f7;
  --um-maize-soft: #fff2bf;
  --text-main: #1d2633;
  --text-soft: #4f5d75;
  --bg-page: #0d3b66;
  --bg-card: #ffffff;
  --bg-inner-surface: #f4f8fd;
  --border: #b7cae1;
  --border-strong: #a9bfd8;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #184a7b 0%, var(--bg-page) 58%, #0a2f54 100%);
  line-height: 1.5;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-shell {
  width: min(100%, 540px);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 14px 36px rgb(9 27 58 / 8%);
}

.brand {
  margin: 0;
  color: var(--um-blue);
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0.25rem 0 0;
}

.subtitle {
  margin-top: 0.15rem;
  color: var(--text-soft);
  font-weight: 600;
}

.helper-text,
.auth-note,
.muted {
  color: var(--text-soft);
}

.auth-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

label {
  font-weight: 600;
  display: grid;
  gap: 0.35rem;
}

input,
textarea,
select {
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font: inherit;
}

.input-helper {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.84rem;
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.7rem 0.95rem;
  background: var(--um-blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-button {
  background: #fff;
  color: var(--um-blue);
  border: 1px solid var(--um-blue);
}

.danger-button {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.small-button {
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
}

.auth-error {
  min-height: 1.25rem;
  margin: 0;
  color: #b00020;
  font-weight: 600;
}

.site-header {
  background: linear-gradient(180deg, #f7fbff 0%, #dce8f6 100%);
  border-bottom: 1px solid #abc4e2;
  border-top: 3px solid var(--um-blue);
  padding: 1rem 1.25rem;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.header-branding {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0;
}

.header-title-group {
  display: grid;
  gap: 0.1rem;
  justify-self: start;
  text-align: left;
  min-width: 0;
}

.header-logo {
  width: clamp(140px, 18vw, 220px);
  height: auto;
  justify-self: end;
  margin-right: 30px;
}

.header-flag {
  width: clamp(48px, 6vw, 72px);
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgb(0 39 76 / 18%);
  opacity: 0.9;
  justify-self: end;
}

.header-flag--nepal {
  box-shadow: none;
  border: none;
  outline: none;
}

.header-title-group h1 {
  line-height: 1.12;
  margin: 0.2rem 0 0;
  text-wrap: balance;
}

.header-title-group .brand {
  margin: 0;
}


@media (max-width: 640px) {
  .site-header {
    padding: 0.58rem 0.8rem;
  }

  .header-branding {
    grid-template-columns: auto auto;
    grid-template-areas:
      "title title"
      "logo flag";
    justify-content: start;
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.22rem;
  }

  .header-title-group {
    grid-area: title;
    gap: 0.02rem;
    padding-right: 0;
  }

  .header-title-group .brand {
    font-size: 0.8rem;
    letter-spacing: 0.006em;
  }

  .header-title-group h1 {
    font-size: clamp(1.05rem, 4.9vw, 1.28rem);
    line-height: 1.13;
    margin: 0.08rem 0 0;
    max-width: 18ch;
  }

  .header-logo {
    grid-area: logo;
    width: clamp(92px, 29vw, 118px);
    justify-self: start;
    align-self: center;
    margin-right: 0;
  }

  .header-flag {
    grid-area: flag;
    width: clamp(28px, 8.5vw, 36px);
    justify-self: start;
    align-self: center;
  }
}

.header-note {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1.25rem;
  background: rgb(6 45 84 / 78%);
  border-bottom: 1px solid rgb(144 180 218 / 45%);
}

.nav-link {
  text-decoration: none;
  color: #eef5ff;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.nav-link:hover {
  background: rgb(120 172 217 / 40%);
  color: #f4f9ff;
  box-shadow: inset 0 -2px 0 rgb(255 255 255 / 28%), 0 0 0 1px rgb(167 202 233 / 42%);
}

.nav-link.active {
  background: var(--um-maize);
  color: #062d54;
  box-shadow: 0 0 0 1px rgb(120 172 217 / 78%), inset 0 -2px 0 rgb(4 30 56 / 25%);
}

.nav-link.active:hover {
  background: #ffd941;
  color: #052849;
}

.nav-signout {
  margin-left: auto;
  background: rgb(255 255 255 / 12%);
  color: #eef5ff;
  border-color: rgb(238 245 255 / 55%);
  padding: 0.45rem 0.8rem;
}

.nav-signout:hover {
  background: rgb(255 255 255 / 22%);
}

.main-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 1.6rem;
  overflow-x: clip;
}

.content-section {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 24px rgb(0 24 48 / 14%);
  min-width: 0;
}

.hero-section h2 {
  margin-top: 0;
}

.callout {
  background: #eff6ff;
  border: 1px solid #c4d9f4;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-top: 0.9rem;
  color: #234369;
}

.hero-overview {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.hero-intro-panel h2,
.compact-info-card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.hero-intro-panel p {
  margin-top: 0.2rem;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-inner-surface);
  box-shadow: 0 2px 8px rgb(15 47 86 / 6%);
}

.compact-info-card {
  padding: 0.75rem 0.85rem;
}

#hub-champion-card {
  position: relative;
  padding-top: 0.95rem;
}

.compact-callout {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.section-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.section-heading-with-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.section-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.page-section-icon {
  width: 4.6rem;
  height: 4.6rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgb(0 39 76 / 16%));
}

.page-section-icon svg {
  width: 100%;
  height: 100%;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.compact-top {
  align-items: center;
}

.hub-champion-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.hub-champion-corner-icon {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  width: 4.2rem;
  height: 4.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(160deg, #ffe07a 0%, #ffcb3f 100%);
  border: 1px solid #d8af2b;
  box-shadow: 0 2px 7px rgb(0 39 76 / 16%);
}

.hub-champion-corner-icon svg {
  width: 2.95rem;
  height: 2.95rem;
}

.hub-champion-corner-icon .trophy-base {
  fill: #00274c;
}

.hub-champion-corner-icon .trophy-accent {
  fill: #ffcb05;
}

.inline-link {
  color: var(--um-blue);
  font-weight: 600;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.upcoming-calendar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-weight: 650;
  color: var(--um-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.16s ease;
}

.upcoming-calendar-link::after {
  content: "→";
  font-size: 0.88em;
  line-height: 1;
  transition: transform 0.16s ease;
}

.upcoming-calendar-link:hover {
  color: var(--um-blue-soft);
}

.upcoming-calendar-link:hover::after {
  transform: translateX(1px);
}

.entry-form {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin: 0.7rem 0 1rem;
  background: var(--bg-inner-surface);
  box-shadow: 0 2px 8px rgb(15 47 86 / 5%);
}

.hidden {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.card-grid,
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.home-tile-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.home-tile-grid .nav-tile {
  flex: 0 1 calc((100% - (2 * 0.85rem)) / 3);
}

@media (max-width: 1020px) {
  .home-tile-grid .nav-tile {
    flex-basis: calc((100% - 0.85rem) / 2);
  }
}

@media (max-width: 680px) {
  .home-tile-grid .nav-tile {
    flex-basis: 100%;
  }
}

.card,
.nav-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  background: var(--bg-inner-surface);
  box-shadow: 0 2px 8px rgb(15 47 86 / 6%);
  min-width: 0;
}

.card h3 {
  margin-top: 0;
}

.publications-list {
  display: grid;
  gap: 0;
}

.publication-item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}

.publication-item:first-child {
  padding-top: 0.35rem;
}

.publication-item:last-child {
  border-bottom: none;
  padding-bottom: 0.35rem;
}

.publication-title {
  margin: 0 0 0.58rem;
  font-size: 1.13rem;
  line-height: 1.4;
  font-weight: 700;
}

.publication-title a {
  color: var(--um-blue);
  text-decoration: none;
}

.publication-title a:hover {
  text-decoration: underline;
}

.publication-item p {
  margin: 0.32rem 0;
}

.publication-authors {
  font-size: 0.9rem;
  color: var(--text-main);
}

.publication-journal {
  font-style: italic;
  color: var(--text-soft);
}

.publication-date {
  font-size: 0.88rem;
  color: var(--text-soft);
}

.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.profile-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem 0.8rem;
  border-top: 3px solid var(--border-strong);
}

.profile-card.member-type-um {
  border-top-color: var(--um-blue-soft);
}

.profile-card.member-type-external {
  border-top-color: #ba8a00;
}

.profile-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.member-type-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.member-type-badge.member-type-um {
  background: var(--um-blue-tint);
  color: var(--um-blue);
  border: 1px solid #9fb9d8;
}

.member-type-badge.member-type-external {
  background: var(--um-maize-soft);
  color: #6e5200;
  border: 1px solid #e4c45a;
}

.profile-card h3 {
  margin: 0;
  line-height: 1.3;
}

.profile-card p {
  margin: 0;
  line-height: 1.35;
}

.profile-summary-snippet {
  color: var(--text-soft);
  margin-top: 0.05rem;
  line-height: 1.3;
}

.profile-card .item-actions {
  margin-top: 0.35rem;
}

.profile-detail-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(680px, 92vw);
}

.profile-detail-dialog::backdrop {
  background: rgb(5 25 51 / 45%);
}

.profile-detail-content {
  padding: 1rem 1.1rem;
  background: #fff;
}

.profile-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.profile-detail-header h3 {
  margin: 0;
}

.profile-detail-title-with-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-detail-body {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.profile-detail-body p {
  margin: 0;
}

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

.trip-report-card p {
  margin: 0.2rem 0;
}

.trip-report-card .item-actions {
  margin-top: 0.6rem;
}

.trip-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  margin: 0.8rem 0;
  background: #fff;
}

.trip-fieldset legend {
  font-weight: 700;
  color: var(--um-blue-soft);
  padding: 0 0.35rem;
}

.trip-report-detail {
  display: grid;
  gap: 0.65rem;
}

.trip-detail-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--bg-inner-surface);
}

.trip-detail-section h3 {
  margin: 0 0 0.25rem;
  color: var(--um-blue-soft);
  font-size: 1rem;
}

.trip-detail-section p {
  margin: 0;
  white-space: pre-wrap;
}

.nav-tile {
  text-decoration: none;
  color: var(--text-main);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.6rem;
  row-gap: 0.4rem;
  align-items: start;
  border-top: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(0 39 76 / 10%);
  border-top-color: var(--um-maize);
}

.tile-icon {
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-self: end;
  align-self: start;
  width: 4.2rem;
  height: 4.2rem;
  opacity: 1;
  filter: drop-shadow(0 1px 2px rgb(0 39 76 / 18%));
}

.tile-icon svg {
  width: 100%;
  height: 100%;
}

.tile-icon .icon-fill-primary,
.page-section-icon .icon-fill-primary {
  fill: #00274c;
}

.tile-icon .icon-fill-secondary,
.page-section-icon .icon-fill-secondary {
  fill: #f6f8fb;
}

.tile-icon .icon-fill-accent,
.page-section-icon .icon-fill-accent {
  fill: #ffcb05;
}

.tile-title {
  grid-column: 1;
  font-weight: 700;
  color: var(--um-blue-soft);
  padding-right: 0.25rem;
}

.tile-count {
  grid-column: 1;
  width: fit-content;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--um-blue);
  background: #fff9df;
  border: 1px solid #ecdca6;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.tile-desc {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 0.92rem;
  padding-right: 0.2rem;
}

.item-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.timeline {
  padding-left: 1rem;
  display: grid;
  gap: 0.7rem;
}

.timeline li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--bg-inner-surface);
  list-style-position: inside;
}

.preview-list li {
  list-style-type: disc;
}

.compact-preview {
  margin: 0;
  gap: 0.45rem;
  padding-left: 0;
}

.compact-preview li {
  list-style: none;
  padding: 0.45rem 0.6rem;
  font-size: 0.92rem;
}

.meta {
  color: var(--text-soft);
}

.calendar-agenda {
  display: grid;
  gap: 1.4rem;
}

.calendar-section {
  display: grid;
  gap: 0.9rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid #d8e4f3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fafdff 0%, #f5f9ff 100%);
}

.calendar-section-heading {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #0b3c86;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 2px solid #b8cceb;
  padding-bottom: 0.35rem;
}

.agenda-month-group {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.agenda-month-heading {
  margin: 0;
  font-size: 0.95rem;
  color: var(--um-blue-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: 1px solid #cfdeef;
  padding-top: 0.55rem;
}

.agenda-events {
  display: grid;
  gap: 0.5rem;
}

.agenda-event-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--bg-inner-surface);
  box-shadow: 0 2px 8px rgb(15 47 86 / 5%);
  display: grid;
  gap: 0.2rem;
}

.agenda-event-title {
  margin: 0;
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.97rem;
  line-height: 1.3;
}

.agenda-event-meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.calendar-section-past .agenda-event-row,
.agenda-event-row.past-event {
  background: #f8fbfe;
  border-color: #dce6f2;
}

.calendar-section-past .agenda-event-title,
.calendar-section-past .agenda-event-meta {
  color: #5f6f86;
}

.calendar-section-past {
  background: linear-gradient(180deg, #f8fbfe 0%, #f3f7fc 100%);
}

.agenda-event-row .item-actions {
  margin-top: 0.35rem;
  gap: 0.35rem;
}

.agenda-event-row .item-actions button {
  padding: 0.2rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 500;
  border-radius: 6px;
  opacity: 0.82;
}

.agenda-event-row .item-actions button:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .auth-card,
  .content-section {
    padding: 1rem;
  }

  .section-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-signout {
    margin-left: 0;
  }

  .hero-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 0.95rem;
  }

  .header-branding {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title flag"
      "logo logo";
    align-items: start;
    gap: 0.35rem 0.75rem;
  }

  .header-title-group {
    grid-area: title;
    gap: 0.05rem;
    padding-right: 0.25rem;
  }

  .header-title-group .brand {
    font-size: 0.86rem;
    letter-spacing: 0.008em;
  }

  .header-title-group h1 {
    font-size: clamp(1.15rem, 5.2vw, 1.5rem);
    line-height: 1.18;
    max-width: 20ch;
  }

  .header-logo {
    grid-area: logo;
    width: clamp(136px, 52vw, 210px);
    margin-right: 0;
    justify-self: start;
  }

  .header-flag {
    grid-area: flag;
    width: clamp(34px, 12vw, 52px);
    justify-self: end;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
  }

  .nav-link,
  .nav-signout {
    width: 100%;
    text-align: center;
    padding: 0.55rem 0.65rem;
    font-size: 0.94rem;
    line-height: 1.2;
  }

  .nav-signout {
    margin-left: 0;
    grid-column: 1 / -1;
  }

  .main-content {
    padding: 1rem 0.9rem 1.25rem;
  }

  .content-section {
    padding: 0.95rem;
    margin-bottom: 0.85rem;
  }

  .hero-overview,
  .card-grid,
  .tile-grid,
  .profile-grid,
  .trip-report-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hub-champion-corner-icon {
    width: 3.2rem;
    height: 3.2rem;
  }

  .hub-champion-corner-icon svg {
    width: 2.2rem;
    height: 2.2rem;
  }

  .tile-icon {
    width: 3.25rem;
    height: 3.25rem;
  }

  .publication-title {
    font-size: 1rem;
  }

  .calendar-section {
    padding: 0.85rem 0.8rem 0.9rem;
  }

  .agenda-event-row {
    padding: 0.6rem 0.65rem;
  }

  button,
  .button-link {
    min-height: 2.5rem;
  }
}

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

  .header-title-group h1 {
    max-width: 16ch;
  }

  .item-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .small-button {
    width: 100%;
  }
}
