:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #556272;
  --line: #d9e0e8;
  --brand: #004f9f;
  --brand2: #00a693;
  --accent: #1d2733;
  --danger: #b3261e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, #f4f8fc 0%, #f9fbff 45%, #f7fcfb 100%);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background-color: var(--header-bg, #fff);
  background-image: var(--header-bg-image, none);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-wrap { display: flex; gap: 0.75rem; align-items: center; }
.site-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; }
.brand { font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.subtitle { font-size: 0.84rem; color: var(--muted); }
.site-header .brand,
.site-header .subtitle,
.site-header .menu-item > a {
  color: var(--header-text, var(--accent));
}

.auth-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.avatar-round {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.menu-item { position: relative; }
.menu-item > a {
  display: inline-block;
  padding: 0.42rem 0.62rem;
  border-radius: 8px;
  color: var(--accent);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(17, 24, 39, 0.12);
}
.menu-item > a:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 24, 39, 0.2);
  text-decoration: none;
}

.menu-item .menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(24, 39, 75, 0.1);
  padding: 0.4rem;
  z-index: 30;
}

.menu-item:hover > .menu {
  display: block;
}

.menu-item .menu .menu-item > a {
  display: block;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.92rem;
  cursor: pointer;
}

.site-header .btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(17, 24, 39, 0.16);
  color: var(--header-text, var(--text));
}

.site-header .btn:hover {
  background: rgba(255, 255, 255, 1);
}

.btn-primary {
  background: linear-gradient(120deg, var(--brand), #1b74c7);
  border-color: transparent;
  color: #fff;
}

.btn-secondary {
  background: linear-gradient(120deg, var(--brand2), #00bfaa);
  border-color: transparent;
  color: #fff;
}

main {
  max-width: 1160px;
  margin: 1.2rem auto 2rem;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

h1, h2, h3 { margin-top: 0.2rem; }
small, .muted { color: var(--muted); }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font: inherit;
}

textarea { min-height: 170px; }
label { display: block; margin: 0.55rem 0 0.2rem; }

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

.list {
  display: grid;
  gap: 0.7rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 0.55rem; text-align: left; }

.notice {
  border-left: 4px solid var(--danger);
  background: #fdecea;
  padding: 0.7rem;
  border-radius: 8px;
}

iframe.pdf {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

.collapsible-heading {
  cursor: pointer;
  position: relative;
  padding-right: 1.2rem;
  user-select: none;
}

.collapsible-heading::after {
  content: "-";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--muted);
}

.collapsible-heading.collapsed::after {
  content: "+";
}

@media (max-width: 768px) {
  .menu-item .menu {
    position: static;
    display: block;
    border: 0;
    box-shadow: none;
    padding-left: 1rem;
  }
}
