:root {
  color-scheme: light;
  --bg-0: #e8f0f4;
  --bg-1: #d7e5ec;
  --panel: #ffffff;
  --ink: #12253a;
  --muted: #4b6072;
  --line: #c0d2de;
  --brand: #0d5b66;
  --brand-strong: #123a5c;
  --alert: #a32323;
  --shadow: 0 22px 42px rgba(16, 42, 66, 0.14);
  --radius-lg: 22px;
  --radius-md: 14px;
  --font-sans: "Manrope", "Segoe UI", sans-serif;
  --font-serif: "Merriweather", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, #f3f9fc 0%, rgba(243, 249, 252, 0) 32%),
    radial-gradient(circle at 90% 15%, #d5e8f2 0%, rgba(213, 232, 242, 0) 38%),
    linear-gradient(90deg, rgba(18, 58, 92, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 58, 92, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-size: auto, auto, 40px 40px, 40px 40px, auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  margin: 0;
}

p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.landing-screen,
.app-shell {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.landing-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.landing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2.2rem);
  width: min(660px, 100%);
  display: grid;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.landing-centered {
  max-width: 820px;
  margin: 0 auto;
}

.landing-main {
  display: grid;
  gap: 0.8rem;
}

.landing-main-center {
  justify-items: center;
  text-align: center;
}

.landing-main-center form {
  width: min(460px, 100%);
  text-align: left;
}

.landing-side {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(165deg, #f2f9fc, #eef6fa);
  padding: 0.95rem;
  display: grid;
  gap: 0.65rem;
}

.landing-side ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  display: grid;
  gap: 0.45rem;
}

.landing-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -55px;
  top: -55px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(13, 91, 102, 0.16), rgba(13, 91, 102, 0));
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dept-logo {
  width: min(220px, 100%);
  height: auto;
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: transparent;
}

.site-header .dept-logo {
  width: clamp(92px, 10vw, 140px);
}

.landing-card .dept-logo {
  width: clamp(160px, 28vw, 220px);
}

.logo-title {
  font-weight: 800;
  color: var(--brand-strong);
}

.logo-sub {
  color: var(--muted);
  font-size: 0.88rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.form-stack,
.form-grid {
  display: grid;
  gap: 0.85rem;
}

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

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

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem 0.82rem;
  font: inherit;
  color: var(--ink);
  background: #fbfefb;
}

textarea {
  resize: vertical;
}

.btn-primary,
.btn-ghost,
.banner-btn {
  border-radius: 12px;
  padding: 0.72rem 1rem;
  font-weight: 700;
  font: inherit;
  cursor: pointer;
}

.btn-primary {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 14px 30px rgba(22, 82, 56, 0.28);
}

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

.feedback {
  color: var(--alert);
  min-height: 1.2rem;
}

.inline-link {
  color: var(--brand-strong);
  font-weight: 700;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.3rem 0;
}

.home-hero {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  background: linear-gradient(128deg, #f8fcff 0%, #e9f3f9 72%);
  box-shadow: var(--shadow);
  margin-bottom: 0.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  gap: 0.95rem;
}

.home-hero h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin: 0.2rem 0 0.45rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.hero-stats div {
  border: 1px solid #b5ceda;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.7rem;
  display: grid;
  gap: 0.2rem;
}

.hero-stats p {
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-stats strong {
  font-size: 1.35rem;
  color: var(--brand-strong);
}

.brand {
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--brand-strong);
}

.brand-sub {
  margin-top: 0.25rem;
  color: var(--muted);
}

.viewer-name {
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.banner-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0.55rem;
  z-index: 9;
}

.banner-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.banner-btn.active,
.banner-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.banner-btn.top-active {
  background: linear-gradient(135deg, #e8f4f8, #d3e9f0);
  box-shadow: inset 0 0 0 1px #85b5c5;
}

.admin-link {
  background: #f3faf5;
}

.content-area {
  display: grid;
}

.section-page,
.admin-layout {
  display: grid;
  gap: 1rem;
}

.section-head,
.content-block,
.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-head {
  padding: clamp(1rem, 3vw, 1.7rem);
  display: grid;
  gap: 0.6rem;
}

.content-block {
  padding: clamp(1rem, 3vw, 1.4rem);
  display: grid;
  gap: 0.9rem;
}

.section-head h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
}

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

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.crumb {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.72rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.crumb.current {
  border-color: #85b5c5;
  color: var(--brand-strong);
}

.crumb-sep {
  color: #7a8e80;
}

.subsection-grid,
.item-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
}

.subsection-card,
.item-card,
.post-card,
.list-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefb;
  padding: 0.85rem;
}

.item-card {
  box-shadow: 0 12px 26px rgba(13, 46, 76, 0.07);
}

.post-body {
  white-space: pre-wrap;
  tab-size: 4;
  overflow-wrap: anywhere;
}

.post-attachment-image {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7fbff;
}

.file-preview {
  width: 100%;
  min-height: 320px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7fbff;
}

.subsection-link {
  text-align: left;
  cursor: pointer;
}

.subsection-link:hover {
  border-color: #85b5c5;
}

.subsection-card,
.item-card,
.post-card {
  display: grid;
  gap: 0.45rem;
}

.item-type {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.type-document {
  border-left: 5px solid #0d5b66;
}

.type-image {
  border-left: 5px solid #1f7986;
}

.type-link {
  border-left: 5px solid #4f6d97;
}

.type-post {
  border-left: 5px solid #7f4f6d;
}

.tag-row {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tag-chip {
  display: inline-block;
  border: 1px solid #cae2d2;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.item-link {
  justify-self: flex-start;
  font-weight: 700;
  color: var(--brand-strong);
  text-decoration: none;
}

.item-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.item-link-btn {
  border: none;
  background: transparent;
  padding: 0;
}

.item-link.disabled {
  color: var(--muted);
}

.meta,
.muted {
  color: var(--muted);
}

.site-footer {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.empty-state {
  border: 1px dashed #9ebccc;
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  background: #f6fbfd;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 12, 0.44);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}

.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.modal-wide {
  width: min(1000px, 96vw);
}

.attachment-viewer {
  display: grid;
  gap: 0.7rem;
}

.attachment-image {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7fbff;
}

.attachment-frame {
  width: 100%;
  min-height: 74vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbff;
}

.close-btn {
  justify-self: end;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  background: #eef5ef;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

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

.checkbox-line input {
  width: auto;
}

.bulk-bar {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: #f2f8fb;
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

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

.admin-card {
  padding: 1rem;
}

.span-2 {
  grid-column: span 2;
}

.list-stack {
  display: grid;
  gap: 0.6rem;
}

.list-row {
  display: grid;
  gap: 0.2rem;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.btn-small {
  padding: 0.38rem 0.65rem;
  font-size: 0.86rem;
}

.nested-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.nested-row {
  background: #f1f7fa;
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.45rem;
  z-index: 60;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 0.65rem 0.9rem;
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

.toast.info {
  background: #3a5e4a;
}

.toast.success {
  background: #1f6f4a;
}

.toast.error {
  background: #a32323;
}

.toast-out {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.22s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
