:root {
  --green-dark: #17324f;
  --green: #2f66a6;
  --green-light: #dce7f4;
  --green-pale: #f6f9fe;
  --green-very-pale: #fbfdff;
  --olive: #5e7590;
  --gold: #c8952f;
  --ink: #1d2733;
  --muted: #526171;
  --line: #9caec0;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 4px 14px rgba(20, 34, 51, 0.16);
  --danger: #9b3c2d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, #ffffff 0%, #eef4fa 28%, #d8e4f1 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.2;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.7rem;
  font-family: "Trebuchet MS", Tahoma, Verdana, Arial, sans-serif;
  color: var(--green-dark);
  line-height: 1.15;
}

p {
  margin: 0 0 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.site-header {
  position: relative;
  z-index: 1;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #f4f8fd 0%, #eaf1f8 100%);
  border-bottom: 1px solid #bfd0e4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(29, 69, 114, 0.08);
}

.site-header-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.header-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0.55rem 0.9rem;
  border: 1px solid #23496f;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #dce8f6 100%);
  color: #1c3d62;
  font-weight: 700;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 149, 175, 0.45) inset,
    0 1px 2px rgba(20, 34, 51, 0.18);
}

.header-action-link:hover {
  background: linear-gradient(180deg, #ffffff 0%, #cfdff1 100%);
  transform: translateY(-1px);
}

.header-auth-dropdown {
  position: relative;
}

.header-auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 0.55rem 0.9rem;
  border: 1px solid #23496f;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #dce8f6 100%);
  color: #1c3d62;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 149, 175, 0.45) inset,
    0 1px 2px rgba(20, 34, 51, 0.18);
}

.header-auth-button::after {
  content: " \25BE";
  font-size: 0.8em;
}

.header-auth-button:hover {
  background: linear-gradient(180deg, #ffffff 0%, #cfdff1 100%);
  transform: translateY(-1px);
}

.header-auth-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  padding: 0.35rem;
  border: 1px solid #96a9bd;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
  box-shadow: 0 6px 16px rgba(20, 34, 51, 0.18);
  z-index: 20;
}

.header-auth-menu-item {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 3px;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 700;
}

.header-auth-menu-item:hover {
  background: #d7e4f2;
}

.site-header-logo {
  display: block;
  width: min(130px, 34vw);
  margin: 0 auto 0.85rem;
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25));
}

.site-header h1,
.site-header p {
  color: #1d2733;
}

.site-header .eyebrow {
  color: #183452;
  background: linear-gradient(180deg, #ffffff 0%, #dfeaf6 100%);
}

.site-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  text-shadow: none;
}

.lead {
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.22rem 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #183452;
  background: linear-gradient(180deg, #fdfefe 0%, #dbe7f4 100%);
  border: 1px solid #93a6bb;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.brand-mark {
  display: block;
  width: min(140px, 42vw);
  margin: 1rem auto 0;
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(180deg, #dbe7f3 0%, #c2d5e8 100%);
  border-bottom: 1px solid #93a6bb;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 6px rgba(20, 34, 51, 0.1);
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.55rem 0.95rem;
  border: 1px solid #8fa3b8;
  border-bottom-color: #6d8093;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #e3edf8 100%);
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(130, 151, 173, 0.5) inset,
    0 1px 2px rgba(20, 34, 51, 0.14);
}

.main-nav a:hover,
.main-nav a.active {
  background: linear-gradient(180deg, #ffffff 0%, #cdddf0 100%);
  color: #102b45;
  transform: translateY(-1px);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

section,
.page-card,
.card,
.blog-post,
.blog-item,
.blog-comment,
.message-card,
.message-reader,
.recipient-option,
.schedule-day-card,
.schedule-entry,
.stat-card,
.empty-state,
.blog-post-button {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

section {
  padding: clamp(1rem, 2.4vw, 1.6rem);
  margin: 1rem auto;
}

.page-card {
  border-radius: 18px;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  border: 1px solid #c7d7ea;
  box-shadow: 0 10px 28px rgba(16, 43, 69, 0.08);
}

.card,
.blog-post,
.blog-item,
.blog-comment,
.message-card,
.message-reader,
.recipient-option,
.schedule-day-card,
.schedule-entry,
.stat-card,
.empty-state,
.blog-post-button {
  border-radius: 8px;
}

.card,
.blog-post,
.blog-item {
  padding: 1rem;
  margin: 0.9rem 0;
}

.card.highlight {
  background: linear-gradient(180deg, #fdfefe 0%, #e1ecf7 100%);
  border-color: #8ba3bc;
}

.card.compact {
  padding: 0.95rem;
}

.blog-image {
  width: 100%;
  border-radius: 6px;
  margin-top: 0.5rem;
  object-fit: cover;
}

.hero-grid,
.two-column,
.list-grid,
.stats-grid,
.form-grid,
.portal-layout,
.schedule-download-grid {
  display: grid;
  gap: 1rem;
}

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

.two-column {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

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

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

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

.portal-layout {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 76px;
}

.stack {
  display: grid;
  gap: 1rem;
}

.center-stack {
  display: grid;
  place-items: center;
  text-align: center;
}

.circle,
.avatar,
.avatar-preview {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  overflow: hidden;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(180deg, #5d8fc0 0%, #2f5f93 100%);
  border: 1px solid #254b74;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

/* First-visit modal */
.fv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 29, 0.45);
  display: grid;
  place-items: center;
  z-index: 9999;
}
.fv-modal {
  width: min(520px, calc(100% - 48px));
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 12px 40px rgba(10, 20, 32, 0.45);
  text-align: center;
  border: 1px solid var(--line);
}
.fv-modal h3 {
  margin-top: 0;
  color: var(--green-dark);
}
.fv-modal p { color: var(--muted); }
.fv-modal .fv-actions { margin-top: 1rem; display: flex; justify-content: center; gap: 0.5rem; }
.fv-modal .btn { padding: 0.5rem 0.9rem; border-radius: 6px; font-weight: 700; cursor: pointer; }
.fv-modal .btn-primary { background: var(--green); color: #fff; border: none; }
.fv-modal .btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--green-dark); }

.avatar img,
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-row,
.inline-list,
.badge-row,
.menu-strip,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.badge-row {
  margin: 0.8rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
  background: linear-gradient(180deg, #fdfefe 0%, #dbe7f4 100%);
  border: 1px solid #9ab0c3;
  color: #24415f;
  font-weight: 700;
  font-size: 0.88rem;
}

.muted-note {
  color: var(--muted);
  font-size: 0.93rem;
}

.menu-strip {
  margin-bottom: 1rem;
  padding: 0.4rem;
  border: 1px solid #9caec0;
  border-radius: 4px;
  background: linear-gradient(180deg, #f8fbfd 0%, #e4edf7 100%);
}

.menu-strip button,
.menu-strip a {
  border-radius: 3px;
  border: 1px solid #8fa3b8;
  background: linear-gradient(180deg, #ffffff 0%, #e8eff7 100%);
  color: var(--green-dark);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(130, 151, 173, 0.45) inset;
}

.menu-strip button.active {
  background: linear-gradient(180deg, #5f92c6 0%, #346897 100%);
  color: #fff;
  border-color: #2e5a82;
}

.btn-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.72rem 1rem;
  border-radius: 3px;
  border: 1px solid #244c77;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #4d88c2 0%, #2a5f97 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 -1px 0 rgba(25, 59, 93, 0.45) inset,
    0 2px 4px rgba(20, 34, 51, 0.18);
}

.btn-link:hover,
button:hover {
  background: linear-gradient(180deg, #5d96cd 0%, #336ba5 100%);
  transform: translateY(-1px);
}

.btn-link:active,
button:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 -1px 0 rgba(28, 69, 31, 0.35) inset;
}

.btn-link.secondary,
button.secondary,
button.blog-post-button {
  color: var(--green-dark);
  background: linear-gradient(180deg, #ffffff 0%, #e7eef7 100%);
  border-color: #9aaec1;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 -1px 0 rgba(149, 166, 186, 0.5) inset,
    0 1px 3px rgba(20, 34, 51, 0.12);
}

.btn-link.secondary:hover,
button.secondary:hover,
button.blog-post-button:hover {
  background: linear-gradient(180deg, #fff 0%, #d7e3f0 100%);
}

button.blog-post-button {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 1rem 1.05rem;
}

button.blog-post-button.active {
  border-color: #4b7ab6;
  background: linear-gradient(180deg, #edf5ff 0%, #d7e9fb 100%);
  box-shadow: 0 0 0 2px rgba(75, 122, 182, 0.12), var(--shadow);
}

.sp-portal-shell {
  display: grid;
  gap: 1.25rem;
}

.sp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.35rem 1rem;
  border-bottom: 1px solid #d6e2ee;
}

.sp-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #c9d9ee;
  color: #1f3d5f;
  font-size: 0.84rem;
  font-weight: 700;
}

.sp-breadcrumb-label {
  color: #436b9d;
}

.sp-breadcrumb-separator {
  color: #8aa3bf;
}

.sp-logout {
  min-width: 120px;
}

.sp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid #c8d9ea;
  background: linear-gradient(135deg, #edf4fc 0%, #e7f1fa 50%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sp-hero-copy {
  flex: 1;
}

.sp-hero-copy h2 {
  font-size: clamp(1.75rem, 2vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.sp-hero-actions {
  display: flex;
  justify-content: flex-end;
}

.sp-overview {
  margin-top: -0.2rem;
}

.sp-content-grid {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.sp-news-panel,
.sp-news-detail {
  min-height: 100%;
}

.sp-news-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid #d4e0ee;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4fb 100%);
}

.sp-panel-header {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #d0dfea;
}

.sp-panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.sp-news-list {
  gap: 0.6rem;
}

.sp-news-list .blog-post-button {
  padding: 0.9rem 0.95rem;
}

.sp-news-detail {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid #d4e0ee;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.sp-news-detail > .card {
  margin: 0;
  border-color: #d7e3f0;
  background: #fff;
}

button.danger {
  background: linear-gradient(180deg, #d96b58 0%, #a84534 100%);
  border-color: #94382a;
}

button.danger:hover {
  background: linear-gradient(180deg, #e07461 0%, #b85240 100%);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 3px;
  border: 1px solid #9eb0c1;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  color: var(--ink);
  font: inherit;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(181, 196, 211, 0.55) inset;
}

input.compact-input {
  width: min(100%, 220px);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(59, 110, 168, 0.28);
  outline-offset: 1px;
  border-color: #5c84b5;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: #17324f;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 0.35rem;
}

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

.checkbox-item,
.recipient-option {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  border: 1px solid #b1c1d3;
}

.checkbox-item input,
.recipient-option input {
  width: auto;
  margin-top: 0.2rem;
}

.stat-card {
  padding: 1rem;
  background: linear-gradient(180deg, #fdfefe 0%, #e4edf7 100%);
}

.stat-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.8rem;
  color: var(--green-dark);
  font-family: "Trebuchet MS", Tahoma, Verdana, Arial, sans-serif;
}

.message {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  border: 1px solid #a5b6c8;
  background: #edf3f9;
  color: #23425f;
}

.message.error {
  border-color: #d39b92;
  background: #f8e9e6;
  color: var(--danger);
}

.message:empty {
  display: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 0.78rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #d7e3d3;
}

th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #244561;
  background: #e7eef7;
}

.schedule-download-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 1rem;
}

.schedule-grid {
  min-width: 860px;
  table-layout: fixed;
}

.schedule-grid th,
.schedule-grid td {
  vertical-align: top;
}

.schedule-grid thead th {
  background: #dce8f5;
}

.schedule-slot-number {
  width: 78px;
  text-align: center;
  background: #edf3f9;
}

.schedule-slot-cell {
  min-width: 140px;
}

.schedule-entry {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
}

.schedule-entry + .schedule-entry {
  margin-top: 0.7rem;
}

.schedule-entry-title,
.key-value strong {
  color: var(--green-dark);
}

.schedule-entry-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.schedule-entry-empty {
  display: inline-block;
  min-height: 1.25rem;
  color: var(--muted);
}

.schedule-day-selector {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.schedule-day-selector button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.schedule-day-panel {
  display: grid;
  gap: 0.9rem;
}

.schedule-day-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.schedule-day-header h3 {
  margin-bottom: 0;
}

.schedule-day-list {
  display: grid;
  gap: 0.9rem;
}

.schedule-day-time {
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: #17324f;
}

.portal-panel {
  display: none;
}

.portal-panel.active,
.login-panel.active {
  display: block;
}

.auth-card {
  max-width: 480px;
  margin: 0 auto;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.login-page::before {
  display: none;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

.login-card {
  position: relative;
  padding: 40px 32px 32px;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.login-header {
  margin-bottom: 26px;
  text-align: center;
}

.login-logo {
  display: block;
  width: min(96px, 34vw);
  margin: 0 auto 16px;
}

.login-header h1 {
  margin-bottom: 6px;
  color: #1e293b;
  font-family: inherit;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0;
}

.login-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.login-role-tabs button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.login-role-tabs button:hover,
.login-role-tabs button.active {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4f46e5;
  transform: translateY(-1px);
}

.login-panel {
  display: none;
}

.login-panel.active {
  display: block;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-form .field {
  gap: 6px;
}

.login-form label {
  margin: 0;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #1e293b;
  font-size: 15px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.login-form input:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form input::placeholder {
  color: #94a3b8;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: #17c900;
  box-shadow: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.login-submit:hover {
  background: #29f700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.login-card .message {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
}

.login-card .message.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.login-footer {
  margin-top: 18px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.hidden {
  display: none !important;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 1rem 2rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(140, 158, 177, 0.55);
}

.blog-card-meta,
.blog-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.key-value {
  display: grid;
  gap: 0.4rem;
}

.mini-divider {
  height: 1px;
  margin: 0.5rem 0;
  background: #d7e3d3;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed #9eb0c1;
  text-align: center;
  color: var(--muted);
  background: #f7fbff;
  border-radius: 4px;
}

.subject-details > summary {
  cursor: pointer;
  list-style: none;
}

.subject-details > summary::-webkit-details-marker {
  display: none;
}

.subject-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.subject-average {
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.subject-details[open] > summary {
  margin-bottom: 0.75rem;
}

.messages-layout,
.mailbox-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.message-toolbar {
  margin-bottom: 1rem;
}

.message-toolbar button.active {
  background: linear-gradient(180deg, #5f92c6 0%, #346897 100%);
  color: #fff;
  border-color: #2e5a82;
}

.message-list {
  display: grid;
  gap: 0.75rem;
}

.message-list-item {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #f5f9fd 100%);
  box-shadow: none;
}

.message-list-item p:last-child,
.message-reader p:last-child {
  margin-bottom: 0;
}

.message-list-item.active {
  background: linear-gradient(180deg, #e8f0f8 0%, #d4e1ef 100%);
  border-color: #8fa4ba;
}

.message-reader {
  display: grid;
  gap: 1rem;
}

.recipient-list {
  display: grid;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.recipient-option p:last-child {
  margin-bottom: 0;
}

.message-section-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.message-card {
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
}

.message-card + .message-card {
  margin-top: 0.85rem;
}

.message-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.attachment-list {
  display: grid;
  gap: 0.55rem;
}

.attachment-link {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: 4px;
  border: 1px solid #b1c1d3;
  background: linear-gradient(180deg, #fff 0%, #edf3f9 100%);
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 700;
}

.attachment-link:hover {
  background: linear-gradient(180deg, #fff 0%, #dce7f4 100%);
}

@media (max-width: 860px) {
  .site-header {
    padding: 1.6rem 1rem 1.2rem;
  }

  .site-header-actions {
    top: 0.75rem;
    right: 0.75rem;
  }

  .page-shell {
    padding: 1rem 0.75rem 2rem;
  }

  .portal-layout,
  .messages-layout,
  .mailbox-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  table {
    min-width: 100%;
  }

  .schedule-day-selector {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
}

@media (max-width: 560px) {
  .site-header-actions {
    position: static;
    margin: 0 0 0.85rem auto;
    width: fit-content;
  }

  .main-nav a,
  .btn-link,
  button {
    width: 100%;
  }

  .menu-strip button {
    flex: 1 1 140px;
  }

  .action-row,
  .form-actions,
  .message-section-head {
    align-items: stretch;
  }

  .action-row > h3 {
    flex-basis: 100%;
  }

  .action-row button,
  .form-actions button,
  .action-row .btn-link,
  .form-actions .btn-link {
    width: 100%;
  }

  .stats-grid,
  .form-grid,
  .list-grid,
  .schedule-download-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipient-option,
  .attachment-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .attachment-link {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .message-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}
