/* ============================================================
   ARL - Classic Journal Theme
   ระบบสารสนเทศด้านบริการวิชาการ วิจัย
   คณะบริหารธุรกิจ มหาวิทยาลัยแม่โจ้
   ------------------------------------------------------------
   Theme: Navy #1a365d + Maroon #8b1a1a (Academic Journal)
   ============================================================ */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
  /* Brand — Navy + Maroon (Classic Journal) */
  --color-navy:        #1d4278;
  --color-navy-dark:   #142f5e;
  --color-navy-light:  #2d56a0;
  --color-navy-50:     #edf3fb;
  --color-navy-100:    #d3e2f4;

  /* Accent: Slate gray (เปลี่ยนจาก maroon → เทา ตามคำขอ)
     ชื่อตัวแปรยังคงเดิมเพื่อไม่ต้องไล่แก้หลายจุด */
  --color-maroon:      #4a5160;   /* slate-600 ish */
  --color-maroon-dark: #2c333f;   /* deep slate */
  --color-maroon-light:#7a808e;   /* light slate */
  --color-maroon-50:   #f2f3f5;   /* surface */
  --color-maroon-100:  #d8dbe1;   /* border */

  /* True red — เก็บไว้สำหรับ danger alert (ไม่ใช่ accent) */
  --color-red:         #b91c1c;
  --color-red-dark:    #7f1d1d;
  --color-red-50:      #fef2f2;

  /* Aliases (kept for backward-compat in components) */
  --color-primary:        var(--color-navy);
  --color-primary-dark:   var(--color-navy-dark);
  --color-primary-light:  var(--color-navy-light);
  --color-primary-50:     var(--color-navy-50);
  --color-primary-100:    var(--color-navy-100);
  --color-accent:         var(--color-maroon);
  --color-accent-dark:    var(--color-maroon-dark);

  /* Neutrals (cream/parchment for journal feel) */
  --color-bg:           #f7f5f0;     /* parchment */
  --color-bg-alt:       #faf8f3;
  --color-surface:      #ffffff;
  --color-surface-2:    #fafaf8;
  --color-border:       #d8d3c5;
  --color-border-strong:#b8b09a;

  --color-text:        #1c2333;
  --color-text-muted:  #4a5063;
  --color-text-light:  #6b7185;

  /* Status */
  --color-success: #2f7d4f;
  --color-warning: #b8860b;
  --color-danger:  var(--color-red);
  --color-info:    var(--color-navy);

  /* Shadow (subtle) */
  --shadow-sm: 0 1px 2px 0 rgba(26, 54, 93, 0.06);
  --shadow-md: 0 4px 8px -2px rgba(26, 54, 93, 0.10), 0 2px 4px -2px rgba(26, 54, 93, 0.05);
  --shadow-lg: 0 14px 30px -8px rgba(26, 54, 93, 0.15);

  /* Typography — Serif for academic feel */
  --font-serif: "Cormorant Garamond", "Tinos", "Times New Roman", Georgia, "Sarabun", serif;
  --font-sans:  "Sarabun", "Prompt", "Tahoma", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-serif);

  /* Layout */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  --container-max: 1200px;

  --t-fast: 150ms ease;
  --t-base: 220ms ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-maroon);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--t-fast);
}
a:hover { color: var(--color-maroon-dark); }
a:focus-visible {
  outline: 2px solid var(--color-maroon);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Headings — serif for academic feel */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--color-navy);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.4rem); }

p { margin: 0 0 1rem; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 9999;
  font-family: var(--font-sans);
}
.skip-link:focus { left: 0; color: #fff; text-decoration: none; }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 768px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }

main { flex: 1 0 auto; padding-block: 1.5rem 2rem; }

/* ---------- Site Banner / Masthead (Academic Journal) ---------- */
.site-banner {
  background: var(--color-navy);
  color: #fff;
  border-bottom: 4px solid var(--color-maroon);
  position: relative;
}
.site-banner::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 4px;
  background: var(--color-navy);
}

.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding-block: 1.25rem;
}
@media (max-width: 720px) {
  .masthead { grid-template-columns: auto 1fr; }
  .masthead__meta { display: none; }
}

.crest {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}
.crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.masthead__title {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: #fff;
  letter-spacing: 0.01em;
}
.masthead__subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
  color: #cdd9ec;
  font-weight: 400;
}
.masthead__th {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  margin: 0.25rem 0 0;
  color: #b8c6df;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.masthead__meta {
  text-align: right;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: #cdd9ec;
  line-height: 1.5;
}
.masthead__meta strong {
  display: block;
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}

/* Decorative rule (Roman style) */
.banner-rule {
  height: 1px;
  background: rgba(255,255,255,0.18);
  margin: 0;
}

/* ---------- Navigation ---------- */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 1rem;
}
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-navy);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.navbar__brand:hover { color: var(--color-maroon); }

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar__menu a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.navbar__menu a:hover {
  color: var(--color-navy);
  border-bottom-color: var(--color-navy-light);
}
.navbar__menu a.is-active {
  color: var(--color-maroon);
  border-bottom-color: var(--color-maroon);
  font-weight: 600;
}

.navbar__toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
  transition: background var(--t-fast);
}
.navbar__toggle:hover { background: var(--color-navy-50); }
.navbar__toggle .bar {
  width: 22px; height: 2px;
  background: currentColor; position: relative; display: block;
  transition: all var(--t-base);
}
.navbar__toggle .bar::before,
.navbar__toggle .bar::after {
  content: ''; position: absolute; left: 0;
  width: 22px; height: 2px; background: currentColor;
  transition: all var(--t-base);
}
.navbar__toggle .bar::before { top: -7px; }
.navbar__toggle .bar::after  { top: 7px; }
.navbar__toggle[aria-expanded="true"] .bar { background: transparent; }
.navbar__toggle[aria-expanded="true"] .bar::before { top: 0; transform: rotate(45deg); }
.navbar__toggle[aria-expanded="true"] .bar::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .navbar__toggle { display: inline-flex; }
  .navbar__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    gap: 0;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  }
  .navbar__menu.is-open {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .navbar__menu a {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    border-left: 3px solid transparent;
  }
  .navbar__menu a.is-active {
    border-bottom-color: var(--color-border);
    border-left-color: var(--color-maroon);
    background: var(--color-maroon-50);
  }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.breadcrumb ol {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.4rem;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.4rem; }
.breadcrumb li + li::before {
  content: '›';
  color: var(--color-border-strong);
  font-size: 1rem;
}
.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--color-maroon); text-decoration: underline; }
.breadcrumb [aria-current="page"] {
  color: var(--color-maroon);
  font-weight: 500;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base);
}
.card:hover { box-shadow: var(--shadow-md); }

.card__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-navy);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-maroon);
  display: inline-block;
}

/* Section headings — academic style with rule below */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--color-navy);
}
.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-maroon);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.section-rule {
  width: 60px; height: 3px;
  background: var(--color-maroon);
  margin: 0.6rem 0 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  line-height: 1.2;
  min-height: 42px;
  letter-spacing: 0.02em;
}
.btn:focus-visible {
  outline: 2px solid var(--color-maroon);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}
.btn--primary:hover { background: var(--color-navy-dark); border-color: var(--color-navy-dark); color: #fff; text-decoration: none; }

.btn--accent {
  background: var(--color-maroon);
  color: #fff;
  border-color: var(--color-maroon);
}
.btn--accent:hover { background: var(--color-maroon-dark); border-color: var(--color-maroon-dark); color: #fff; text-decoration: none; }

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-navy);
  border-color: var(--color-border-strong);
}
.btn--secondary:hover {
  background: var(--color-navy-50);
  border-color: var(--color-navy);
  color: var(--color-navy);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-maroon);
}
.btn--ghost:hover { background: var(--color-maroon-50); text-decoration: none; }

.btn--block { width: 100%; }
.btn--sm { padding: 0.4rem 0.85rem; font-size: 0.84rem; min-height: 32px; }
.btn--lg { padding: 0.85rem 1.75rem; font-size: 1rem; min-height: 50px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-navy);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.form-label .req { color: var(--color-maroon); margin-left: 2px; }

.form-control,
.form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  min-height: 42px;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px var(--color-navy-100);
}
.form-control::placeholder { color: var(--color-text-light); }

.form-help { font-size: 0.82rem; color: var(--color-text-light); margin-top: 0.3rem; font-style: italic; }

.input-group { display: flex; align-items: stretch; gap: 0; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Radio pills */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-pill { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: all var(--t-fast);
  font-family: var(--font-sans);
}
.radio-pill:hover span { border-color: var(--color-navy); color: var(--color-navy); }
.radio-pill input:checked + span {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}
.radio-pill input:focus-visible + span {
  outline: 2px solid var(--color-maroon);
  outline-offset: 2px;
}

/* ---------- Tables (Academic data tables) ---------- */
.table-wrapper {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  min-width: 600px;
}
.table thead th {
  background: var(--color-navy);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--color-maroon);
  white-space: nowrap;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:nth-child(even) { background: var(--color-bg-alt); }
.table tbody tr:hover { background: var(--color-navy-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }

@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack { min-width: 0; }
  .table-stack tbody tr {
    display: block;
    padding: 0.85rem;
    border-bottom: 1px solid var(--color-border);
  }
  .table-stack tbody tr:nth-child(even) { background: transparent; }
  .table-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border: none;
    text-align: right;
  }
  .table-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-navy);
    font-size: 0.82rem;
    text-align: left;
    flex: 0 0 auto;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

/* ---------- Grid ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.info-hub {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .info-hub { grid-template-columns: 1fr; }
}

/* ---------- KPI / Stats ---------- */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.25rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
  /* per-card accent — overridden by nth-child below */
  --sc-accent:       #1d4278;
  --sc-accent-bg:    #edf3fb;
  --sc-accent-glow:  rgba(29,66,120,0.14);
}
/* top accent stripe */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--sc-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
/* decorative bubble */
.stat-card::after {
  content: '';
  position: absolute;
  right: -28px; bottom: -28px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--sc-accent-bg);
  opacity: 0.55;
  pointer-events: none;
  transition: transform var(--t-base), opacity var(--t-base);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px -6px var(--sc-accent-glow), 0 3px 8px -3px var(--sc-accent-glow);
}
.stat-card:hover::after { transform: scale(1.15); opacity: 0.7; }

/* per-card colors */
.stat-card:nth-child(1) { --sc-accent:#1d4278; --sc-accent-bg:#edf3fb; --sc-accent-glow:rgba(29,66,120,0.16); }
.stat-card:nth-child(2) { --sc-accent:#0e7f74; --sc-accent-bg:#e5f5f3; --sc-accent-glow:rgba(14,127,116,0.16); }
.stat-card:nth-child(3) { --sc-accent:#b07d12; --sc-accent-bg:#fdf5e0; --sc-accent-glow:rgba(176,125,18,0.16); }
.stat-card:nth-child(4) { --sc-accent:#6248b5; --sc-accent-bg:#f0ecfc; --sc-accent-glow:rgba(98,72,181,0.16); }

.stat-card__icon {
  width: 44px;
  height: 44px;
  background: var(--sc-accent-bg);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--sc-accent);
  margin-bottom: 0.55rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background var(--t-base), color var(--t-base), transform var(--t-base);
  border: 1px solid color-mix(in srgb, var(--sc-accent) 18%, transparent);
}
.stat-card:hover .stat-card__icon {
  background: var(--sc-accent);
  color: #fff;
  transform: scale(1.1) rotate(-4deg);
}

.stat-card__label {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
}
.stat-card__value {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--sc-accent);
  margin: 0;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}
.stat-card__hint {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--color-text-light);
  margin: 0;
  font-style: italic;
  position: relative;
  z-index: 1;
}

/* ---------- Login Page ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-bg);
}
@media (min-width: 900px) {
  .login-shell { grid-template-columns: 1.1fr 1fr; }
}

.login-side {
  padding: 2.5rem;
  display: none;
  flex-direction: column;
  justify-content: center;
  background: var(--color-navy);
  color: #fff;
  position: relative;
  border-bottom: 4px solid var(--color-maroon);
}
.login-side::before {
  content: '';
  position: absolute;
  inset: 1.5rem;
  border: 1px solid rgba(255,255,255,0.18);
  pointer-events: none;
}
@media (min-width: 900px) { .login-side { display: flex; } }
.login-side__content { position: relative; z-index: 1; max-width: 480px; padding: 2rem; }
.login-side .crest {
  width: 80px; height: 80px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  border-color: rgba(255,255,255,0.85);
}
.login-side h1 {
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.login-side .h-rule {
  width: 56px; height: 2px;
  background: var(--color-maroon-light);
  margin: 1rem 0;
}
.login-side p {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  opacity: 0.95;
  line-height: 1.7;
}
.login-side .th-name {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.92rem;
  margin-top: 1rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.login-features li:last-child { border-bottom: none; }
.login-features li::before {
  content: '§';
  color: var(--color-maroon-light);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-maroon);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}
@media (min-width: 480px) { .login-card { padding: 2.5rem; } }
.login-card .crest {
  width: 64px; height: 64px;
  margin: 0 auto 1.25rem;
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}
.login-card h2 {
  text-align: center;
  margin-bottom: 0.25rem;
  font-family: var(--font-serif);
}
.login-card__subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  font-style: italic;
  font-family: var(--font-serif);
}

/* Floating label */
.field { position: relative; }
.field .form-control { padding-top: 1.4rem; padding-bottom: 0.5rem; }
.field .form-label {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  pointer-events: none;
  color: var(--color-text-light);
  background: transparent;
  transition: all var(--t-fast);
  font-weight: 500;
}
.field .form-control:focus + .form-label,
.field .form-control:not(:placeholder-shown) + .form-label {
  top: 0.4rem;
  transform: translateY(0);
  font-size: 0.72rem;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
}
.password-toggle:hover { color: var(--color-navy); background: var(--color-navy-50); }

/* ---------- Hero / Search ---------- */
.hero {
  background: var(--color-navy);
  color: #fff;
  padding: 2.5rem 1.75rem 3rem;
  border-radius: 0;
  margin-block: 0.5rem 1.5rem;
  position: relative;
  border-bottom: 4px solid var(--color-maroon);
}
.hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-maroon-light);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.hero h1 {
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.hero p {
  opacity: 0.92;
  max-width: 56ch;
  margin-bottom: 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
}
.hero .h-rule {
  width: 80px; height: 3px;
  background: var(--color-maroon);
  margin: 0.75rem 0 1.25rem;
}

.search-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.search-box .form-control {
  flex: 1 1 240px;
  border: none;
  background: transparent;
  font-size: 1rem;
  padding-left: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231a365d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
}
.search-box .form-control:focus { box-shadow: none; }
.search-box .form-select { flex: 0 1 200px; }

/* ---------- Alerts / Badges ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-left-width: 4px;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  font-family: var(--font-sans);
}
.alert--info    { background: var(--color-navy-50); border-color: var(--color-navy);    color: var(--color-navy-dark); }
.alert--success { background: #ecf5ee;              border-color: var(--color-success); color: #154d2c; }
.alert--warning { background: #fdf6e7;              border-color: var(--color-warning); color: #6b4d04; }
.alert--danger  { background: var(--color-red-50);  border-color: var(--color-red);     color: var(--color-red-dark); }

.badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  color: #fff;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}
.badge--maroon { background: var(--color-maroon); }
.badge--outline {
  background: transparent;
  color: var(--color-navy);
  border: 1px solid var(--color-navy);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
}
.pagination a, .pagination span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-navy);
  font-weight: 500;
  font-size: 0.88rem;
  text-decoration: none;
}
.pagination a:hover { border-color: var(--color-navy); background: var(--color-navy-50); }
.pagination .is-active {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }

/* ---------- News list (academic) ---------- */
.card--news-hub,
.card--shortcut-hub {
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

.card--news-hub::before,
.card--shortcut-hub::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--color-navy), var(--color-maroon));
}

.card--news-hub {
  background:
    linear-gradient(180deg, rgba(237, 243, 251, 0.82), rgba(255, 255, 255, 0) 160px),
    var(--color-surface);
}

.card--shortcut-hub {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(250, 248, 243, 0.9), rgba(237, 243, 251, 0.8)),
    var(--color-surface);
}

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  border: 1px solid transparent;
  border-bottom-color: var(--color-border);
  padding: 0.9rem 0.75rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  border-radius: var(--radius-md);
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
  margin: 0 -0.25rem 0.25rem;
}
.news-list li:last-child { border-bottom: none; }
.news-list li:hover {
  background: #fff;
  border-color: var(--color-navy-100);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.news-list .news-num {
  flex: 0 0 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-top: 3px;
  transition: background var(--t-base), transform var(--t-base);
}
.news-list li:hover .news-num {
  background: linear-gradient(135deg, var(--color-maroon-dark), var(--color-maroon-light));
  transform: scale(1.08);
}
.news-item__body { flex: 1; min-width: 0; }
.news-list a {
  color: var(--color-navy);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.45;
  display: block;
  transition: color var(--t-fast), transform var(--t-fast);
}
.news-list li:hover a { color: var(--color-maroon-dark); }
.news-list a:hover { color: var(--color-navy-dark); }
.news-list .news-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-text-light);
  font-size: 0.78rem;
  margin-top: 0.3rem;
  font-style: italic;
}
.news-badge {
  display: inline-block;
  background: var(--color-navy);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.08rem 0.45rem;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-left: 0.4rem;
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
}

.btn--news-more {
  box-shadow: inset 0 0 0 1px rgba(29, 66, 120, 0.12);
}

/* ---------- Activity cards ---------- */
.activity-grid { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .activity-grid { grid-template-columns: repeat(3, 1fr); } }
.activity-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--t-base);
  display: flex;
  flex-direction: column;
}
.activity-card:hover { box-shadow: var(--shadow-md); }
.activity-card__image {
  aspect-ratio: 16/10;
  background: var(--color-navy-50) center/cover no-repeat;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--color-maroon);
}
.activity-card__image img { width: 100%; height: 100%; object-fit: cover; }

.activity-card__trigger {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.activity-card__body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.activity-card__title {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-navy);
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.activity-card__title:hover { color: var(--color-maroon); text-decoration: none; }
.activity-card__date {
  color: var(--color-text-light);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-navy);
  color: #cdd9ec;
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
  border-top: 4px solid var(--color-maroon);
  font-family: var(--font-sans);
}
.site-footer h4 {
  color: #fff;
  font-family: var(--font-serif);
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.site-footer a { color: #cdd9ec; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__inner {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: #b8c6df;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
}

/* ---------- Utilities ---------- */
.flex          { display: flex; }
.flex-wrap     { flex-wrap: wrap; }
.flex-between  { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--color-text-muted); }
.text-light    { color: var(--color-text-light); }
.fw-bold       { font-weight: 600; }
.serif         { font-family: var(--font-serif); }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }

.d-none { display: none !important; }
@media (max-width: 768px) { .d-md-none { display: none !important; } }
@media (min-width: 769px) { .d-md-block { display: block !important; } }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print */
@media print {
  .navbar, .site-footer, .site-banner, .btn, .pagination, .breadcrumb { display: none !important; }
  body { background: #fff; }
  .card, .table-wrapper { box-shadow: none; border-color: #999; }
  .table thead th { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
}

/* ---------- Quick Link / Shortcut Tiles ---------- */
.shortcut-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  flex: 1;
}

.shortcut-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.4rem 0.75rem 1.25rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-navy);
  transition: all var(--t-base);
  min-height: 118px;
  position: relative;
  overflow: hidden;
}
.shortcut-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-navy), var(--color-navy-light));
  transform-origin: left;
  transform: scaleX(0.25);
  opacity: 0.2;
  transition: transform var(--t-base), opacity var(--t-base);
}
.shortcut-tile:hover::before {
  transform: scaleX(1);
  opacity: 1;
}
.shortcut-tile:hover {
  border-color: var(--color-navy-100);
  background: var(--color-navy-50);
  box-shadow: 0 6px 20px -4px rgba(29,66,120,0.14), 0 2px 6px -2px rgba(29,66,120,0.08);
  text-decoration: none;
  color: var(--color-navy);
  transform: translateY(-3px);
}
.shortcut-tile__icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--color-navy-50), var(--color-navy-100));
  border-radius: var(--radius-xl);
  display: grid;
  place-items: center;
  color: var(--color-navy);
  margin: 0 auto 0.8rem;
  transition: background var(--t-base), color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  box-shadow: 0 2px 6px rgba(29,66,120,0.10);
  flex-shrink: 0;
}
.shortcut-tile:hover .shortcut-tile__icon {
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
  color: #fff;
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 16px rgba(29,66,120,0.26);
}
.shortcut-tile__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.shortcut-tile__sub {
  font-size: 0.66rem;
  color: var(--color-text-light);
  font-family: var(--font-sans);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color var(--t-fast);
}
.shortcut-tile:hover .shortcut-tile__sub { color: var(--color-navy-light); }

/* Wide tile — horizontal, full row */
.shortcut-tile--wide {
  flex-direction: row;
  text-align: left;
  grid-column: 1 / -1;
  min-height: auto;
  padding: 0.95rem 1.2rem;
  gap: 1rem;
  justify-content: flex-start;
  background: linear-gradient(135deg, var(--color-navy-50) 0%, #fff 60%);
}
.shortcut-tile--wide::before { height: 100%; width: 3px; top: 0; right: auto; bottom: 0; transform: scaleX(1); opacity: 1; }
.shortcut-tile--wide:hover { background: var(--color-navy-50); }
.shortcut-tile--wide .shortcut-tile__icon {
  margin: 0;
  width: 44px;
  height: 44px;
}
.shortcut-tile--wide .shortcut-tile__title { font-size: 0.93rem; }
.shortcut-tile--wide .shortcut-tile__body { flex: 1; min-width: 0; }
.shortcut-tile__arrow {
  color: var(--color-maroon);
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--t-fast), color var(--t-fast);
}
.shortcut-tile--wide:hover .shortcut-tile__arrow {
  transform: translateX(5px);
  color: var(--color-navy);
}

@media (max-width: 420px) {
  .shortcut-tiles { grid-template-columns: 1fr; }
  .shortcut-tile--wide { grid-column: span 1; flex-direction: column; text-align: center; }
  .shortcut-tile--wide .shortcut-tile__icon { margin: 0 auto 0.75rem; }
  .shortcut-tile--wide .shortcut-tile__arrow { display: none; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light);
  font-family: var(--font-serif);
  font-style: italic;
}
.empty-state__icon {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 600;
  opacity: 0.25;
  margin-bottom: 0.5rem;
  color: var(--color-navy);
  line-height: 1;
}

/* ---------- Modal (News) ---------- */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 45, 0.58);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  width: min(720px, 96vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px -14px rgba(15, 23, 42, 0.55);
  animation: modal-pop 180ms ease-out;
}

@keyframes modal-pop {
  from {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-dialog__header {
  padding: 1rem 1.2rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-navy-50), #fff);
  position: relative;
}

.modal-dialog__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.73rem;
  color: var(--color-maroon);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.modal-dialog__title {
  margin: 0;
  padding-right: 2rem;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  line-height: 1.35;
}

.modal-dialog__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #eef1f7;
  color: var(--color-navy);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-dialog__close:hover {
  background: var(--color-navy);
  color: #fff;
}

.modal-dialog__meta {
  padding: 0.75rem 1.2rem 0;
  color: var(--color-text-light);
  font-size: 0.86rem;
  font-style: italic;
}

.modal-dialog__body {
  padding: 0.8rem 1.2rem 1rem;
}

.modal-dialog__body p {
  margin: 0;
  white-space: pre-line;
  color: var(--color-text);
  line-height: 1.75;
}

.modal-dialog__footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem 1.1rem;
  border-top: 1px solid var(--color-border);
  background: #fcfcfb;
}

.modal-activity__media {
  margin: 0 0 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-navy-50);
  aspect-ratio: 16 / 9;
}

.modal-activity__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-activity__gallery {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.55rem;
}

.modal-activity__thumb {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  background: #fff;
  aspect-ratio: 4 / 3;
}

.modal-activity__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-fast);
}

.modal-activity__thumb:hover img {
  transform: scale(1.05);
}
