:root {
  --red: #81273e;
  --red-dark: #641d30;
  --green: #166534;
  --sidebar-width: 284px;
  --sidebar-closed-width: 76px;
  --ink: #202428;
  --muted: #6c727a;
  --line: #dedfe3;
  --paper: #ffffff;
  --soft: #f5f6f8;
  --field: #e7efe8;
  --shadow: 0 18px 45px rgba(18, 24, 32, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  background: var(--soft);
}

a {
  color: var(--red);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--red-dark);
  text-decoration: underline;
}

button,
input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.has-sidebar .site-header {
  margin-left: var(--sidebar-width);
  transition: margin-left 160ms ease;
}

.top-bar {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 16px;
  color: #ffffff;
  font-size: 14px;
  background: var(--red);
}

.main-nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand:hover,
.brand:focus {
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-actions form {
  margin: 0;
}

.app-frame {
  min-height: calc(100vh - 109px);
  margin-left: var(--sidebar-width);
  display: block;
  background: var(--soft);
  transition: margin-left 160ms ease;
}

.app-main {
  min-width: 0;
}

.app-sidebar {
  width: var(--sidebar-width);
  min-width: 0;
  height: 100vh;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #ffffff;
  background: #202428;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 160ms ease, padding-inline 160ms ease;
}

.sidebar-tools {
  display: flex;
  justify-content: flex-end;
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.sidebar-toggle span {
  width: 20px;
  height: 2px;
  display: block;
  margin: 2px 0;
  background: #ffffff;
  border-radius: 2px;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  background: rgba(255, 255, 255, 0.14);
  outline: 0;
}

.mobile-menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  padding: 10px;
  border: 1px solid rgba(129, 39, 62, 0.24);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 21px;
  height: 2px;
  display: block;
  margin: 2px 0;
  background: var(--red);
  border-radius: 2px;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  outline: 3px solid rgba(129, 39, 62, 0.14);
}

.sidebar-user {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 4px 8px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

.sidebar-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(129, 39, 62, 0.9);
}

.sidebar-avatar.has-image {
  overflow: hidden;
  background: #ffffff;
}

.sidebar-avatar-image,
.profile-image-avatar img,
.member-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sidebar-user strong {
  max-width: 100%;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-link,
.sidebar-group-toggle {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.sidebar-link:hover,
.sidebar-link:focus,
.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus,
.sidebar-link.is-active {
  color: #ffffff;
  background: rgba(129, 39, 62, 0.78);
  text-decoration: none;
  outline: 0;
}

.sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-group {
  display: grid;
  gap: 4px;
}

.sidebar-caret {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.sidebar-group.is-open .sidebar-caret {
  transform: rotate(225deg);
}

.sidebar-submenu {
  display: none;
  padding-left: 46px;
}

.sidebar-group.is-open .sidebar-submenu {
  display: grid;
  gap: 4px;
}

.sidebar-sublink {
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  border-radius: 6px;
}

.sidebar-sublink:hover,
.sidebar-sublink:focus,
.sidebar-sublink.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.sidebar-logout {
  margin: auto 0 0;
}

.sidebar-logout .sidebar-link {
  color: rgba(255, 255, 255, 0.78);
}

.sidebar-backdrop {
  display: none;
}

.nav-icon {
  width: 22px;
  height: 22px;
  position: relative;
  flex: 0 0 22px;
  color: currentColor;
}

.nav-icon-dashboard::before,
.nav-icon-dashboard::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-icon-dashboard::before {
  inset: 3px 12px 12px 3px;
}

.nav-icon-dashboard::after {
  inset: 3px 3px 3px 12px;
}

.nav-icon-settings::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-settings::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: currentColor;
}

.nav-icon-profile::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-profile::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 4px 4px;
}

.nav-icon-members::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 9px 0 0 -1px currentColor;
}

.nav-icon-members::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 4px 4px;
}

.nav-icon-calendar::before {
  content: "";
  position: absolute;
  inset: 4px 3px 3px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-icon-calendar::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 9px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.nav-icon-schedule::before {
  content: "";
  position: absolute;
  inset: 4px 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-schedule::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 10px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -4px 0 -1px currentColor, 0 4px 0 -1px currentColor;
}

.nav-icon-documents::before {
  content: "";
  position: absolute;
  inset: 4px 4px 3px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-icon-documents::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 9px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.nav-icon-wawi::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-icon-wawi::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 4px;
  height: 9px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.nav-icon-logout::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 10px;
  height: 14px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.nav-icon-logout::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 10px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -4px 0 -2px currentColor, 4px 4px 0 -2px currentColor;
}

html[data-sidebar="closed"] .app-frame {
  margin-left: var(--sidebar-closed-width);
}

html[data-sidebar="closed"] .has-sidebar .site-header {
  margin-left: var(--sidebar-closed-width);
}

html[data-sidebar="closed"] .app-sidebar {
  width: var(--sidebar-closed-width);
  padding-inline: 10px;
}

html[data-sidebar="closed"] .sidebar-tools {
  justify-content: center;
}

html[data-sidebar="closed"] .sidebar-user {
  padding-inline: 0;
}

html[data-sidebar="closed"] .sidebar-avatar {
  width: 46px;
  height: 46px;
  font-size: 15px;
}

html[data-sidebar="closed"] .sidebar-user strong {
  display: none;
}

html[data-sidebar="closed"] .sidebar-link,
html[data-sidebar="closed"] .sidebar-group-toggle {
  justify-content: center;
  padding-inline: 10px;
}

html[data-sidebar="closed"] .sidebar-label,
html[data-sidebar="closed"] .sidebar-caret,
html[data-sidebar="closed"] .sidebar-submenu,
html[data-sidebar="closed"] .sidebar-group.is-open .sidebar-submenu {
  display: none;
}

.text-button {
  padding: 8px 0;
  color: var(--red);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.text-button:hover,
.text-button:focus {
  color: var(--red-dark);
  text-decoration: underline;
}

.flash {
  width: min(360px, calc(100vw - 32px));
  min-height: 54px;
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  padding: 13px 16px;
  color: var(--ink);
  font-weight: 700;
  border: 1px solid rgba(32, 36, 40, 0.1);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 40px rgba(18, 24, 32, 0.18);
  animation: toast-in 180ms ease-out;
}

.flash.is-hiding {
  pointer-events: none;
  animation: toast-out 180ms ease-in forwards;
}

.flash-success {
  color: #14532d;
  border-color: #b9dfc5;
  background: #edf8f0;
}

.flash-info {
  color: #28456f;
  border-color: #c8d9ef;
  background: #f0f5fb;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.auth-page {
  background:
    linear-gradient(90deg, rgba(129, 39, 62, 0.08), rgba(22, 101, 52, 0.07)),
    var(--field);
}

.auth-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 168px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 440px);
  align-items: center;
  gap: 34px;
  padding: 42px 0;
}

.application-shell {
  grid-template-columns: minmax(260px, 0.7fr) minmax(420px, 620px);
}

.auth-intro {
  color: var(--ink);
}

.auth-intro img {
  width: min(180px, 42vw);
  height: auto;
  margin-bottom: 24px;
}

.auth-intro p,
.section-heading p,
.dashboard-hero p,
.info-card p {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-intro h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-card {
  width: 100%;
  padding: 30px;
  border: 1px solid rgba(32, 36, 40, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.application-card {
  max-height: none;
}

.public-application-page {
  background: #ffffff;
}

.public-application-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 58px;
}

.public-application-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--line);
}

.public-application-hero p {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.public-application-hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
}

.public-application-panel {
  padding: 28px 0 0;
}

.public-application-heading {
  max-width: 680px;
}

.public-application-panel .form-stack {
  width: min(860px, 100%);
}

.public-application-submit {
  display: flex;
  justify-content: flex-start;
  padding-top: 6px;
}

.application-success {
  width: min(860px, 100%);
  margin-bottom: 18px;
  padding: 14px 16px;
  color: #14532d;
  font-weight: 700;
  border: 1px solid #b9dfc5;
  border-radius: 8px;
  background: #edf8f0;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: #30343a;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #cfd2d7;
  border-radius: 6px;
  background: #ffffff;
}

input:focus {
  outline: 3px solid rgba(129, 39, 62, 0.18);
  border-color: var(--red);
}

select:focus,
textarea:focus {
  outline: 3px solid rgba(129, 39, 62, 0.18);
  border-color: var(--red);
}

textarea {
  resize: vertical;
  overflow-wrap: anywhere;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--red);
}

.primary-button {
  min-height: 48px;
  padding: 12px 16px;
  color: #ffffff;
  font-weight: 700;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus {
  background: var(--red-dark);
}

.form-switch {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.error-list {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 12px 14px;
  color: #831c1c;
  border: 1px solid #efb5b5;
  border-radius: 8px;
  background: #fff0f0;
}

.error-list p {
  margin: 0;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 168px);
  margin: 0 auto;
  padding: 34px 0 54px;
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.role-pill {
  max-width: 100%;
  padding: 8px 12px;
  color: #ffffff;
  font-weight: 700;
  border-radius: 6px;
  background: var(--green);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.dashboard-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.dashboard-sections {
  display: grid;
  gap: 28px;
  margin-top: 24px;
}

.dashboard-tile-section {
  display: grid;
  gap: 14px;
}

.dashboard-tile-section .section-heading {
  margin-bottom: 0;
}

.dashboard-tile-section .section-heading h2 {
  font-size: 24px;
}

.dashboard-tile {
  min-height: 168px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 20px;
  color: #ffffff;
  font: inherit;
  text-align: left;
  border-radius: 8px;
  border: 0;
  background: var(--red);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(25, 30, 36, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-tile:hover,
.dashboard-tile:focus {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(25, 30, 36, 0.18);
  outline: 0;
}

.dashboard-tile-eyebrow {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.82;
}

.dashboard-tile strong {
  font-size: 24px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.dashboard-tile-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.dashboard-tile-count small,
.dashboard-tile-count.is-empty {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.86;
}

.dashboard-tile-profile,
.dashboard-tile-users {
  background: #81273e;
}

.dashboard-tile-members,
.dashboard-tile-requests {
  background: #1f7a5a;
}

.dashboard-tile-calendar,
.dashboard-tile-events,
.dashboard-tile-schedule {
  background: #245b8f;
}

.dashboard-tile-documents,
.dashboard-tile-resources {
  background: #6f4f1f;
}

.dashboard-tile-inventory,
.dashboard-tile-categories {
  background: #7a4f9f;
}

.dashboard-tile-groups,
.dashboard-tile-bugs {
  background: #4f5d75;
}

.dashboard-tile-install {
  background: #7a4f9f;
}

.dashboard-tile-notifications {
  background: #245b8f;
}

.install-help {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.install-help p {
  margin: 0;
}

.install-help strong {
  color: var(--ink);
}

.info-card {
  min-height: 156px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.info-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.info-card span {
  color: var(--muted);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
  align-items: start;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.panel-wide {
  min-width: 0;
}

.groups-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.groups-toolbar .section-heading {
  margin-bottom: 0;
}

.compact-action {
  min-width: 150px;
  width: auto;
}

.groups-panel {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.breadcrumb span {
  color: #a4a8ae;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(150px, 190px) auto;
  align-items: end;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-filter-summary {
  display: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.groups-list {
  display: grid;
}

.group-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.group-row:last-child {
  border-bottom: 0;
}

.group-row-main {
  min-width: 0;
}

.group-row-main h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.group-row-members {
  display: grid;
  justify-items: start;
  gap: 0;
}

.group-row-members strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.group-row-members span {
  color: var(--muted);
  font-size: 13px;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) 120px auto;
}

.member-row {
  grid-template-columns: 52px minmax(0, 1fr) minmax(180px, 260px) 120px 130px auto;
}

.member-avatar,
.profile-image-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  font-weight: 800;
  border-radius: 50%;
  background: var(--accent);
}

.profile-image-avatar {
  width: 78px;
  height: 78px;
  font-size: 24px;
}

.profile-image-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}

.profile-image-preview strong,
.profile-image-preview span {
  display: block;
}

.profile-image-preview strong {
  color: var(--ink);
}

.profile-image-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.resource-list-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px) 110px 130px auto;
}

.document-row {
  grid-template-columns: 44px minmax(0, 1fr) 150px auto;
}

.article-row {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) 120px 130px 120px auto;
}

.category-row {
  grid-template-columns: minmax(0, 1fr) 120px 120px auto;
}

.application-row {
  grid-template-columns: minmax(0, 1fr) 120px 120px 150px auto;
}

.event-row {
  grid-template-columns: minmax(0, 1fr) 120px 240px 120px auto;
}

.event-registration-row {
  grid-template-columns: minmax(0, 1fr) 120px auto;
}

.bug-row {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) 120px 150px auto;
}

.document-icon {
  width: 44px;
  height: 44px;
  position: relative;
  border: 1px solid rgba(129, 39, 62, 0.22);
  border-radius: 8px;
  background: rgba(129, 39, 62, 0.08);
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  width: 14px;
  height: 7px;
  border-radius: 4px 4px 0 0;
  background: var(--red);
}

.folder-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 19px;
  border-radius: 5px;
  background: var(--red);
}

.file-icon::before {
  content: "";
  position: absolute;
  inset: 8px 11px 7px;
  border: 2px solid var(--red);
  border-radius: 4px;
  background: #ffffff;
}

.file-icon::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 18px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 6px 0 var(--red);
}

.resource-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resource-row-color {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(32, 36, 40, 0.14);
  border-radius: 8px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.group-row-main span,
.user-row-groups {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.user-row-groups {
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  margin-top: 24px;
}

.profile-overview {
  margin-top: 24px;
}

.profile-panel {
  display: grid;
  gap: 26px;
  padding: 28px;
  border: 0;
  background:
    linear-gradient(135deg, rgba(129, 39, 62, 0.08), rgba(255, 255, 255, 0) 42%),
    #ffffff;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-identity p,
.profile-identity h2,
.profile-identity span {
  margin: 0;
}

.profile-identity p {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-identity h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.1;
}

.profile-identity span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-hero-avatar {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  font-size: 30px;
  font-weight: 800;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 16px 28px rgba(25, 30, 36, 0.16);
}

.profile-hero-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.profile-detail-item {
  min-width: 0;
  padding: 15px;
  border-radius: 8px;
  background: #f7f7f8;
}

.profile-detail-item.is-wide {
  grid-column: span 2;
}

.profile-detail-item dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-detail-item dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-modal-panel {
  width: 100%;
}

.member-profile-form {
  gap: 14px;
}

.member-modal-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(129, 39, 62, 0.08), rgba(255, 255, 255, 0) 48%),
    #ffffff;
}

.member-modal-identity p,
.member-modal-identity h2,
.member-modal-identity span {
  margin: 0;
}

.member-modal-identity p {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.member-modal-identity h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.member-modal-identity span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.member-modal-avatar {
  width: 76px;
  height: 76px;
  flex-basis: 76px;
  font-size: 24px;
  box-shadow: 0 12px 24px rgba(25, 30, 36, 0.14);
}

.member-profile-form label:not(.checkbox-field) {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  background: #f7f7f8;
}

.member-profile-form label:not(.checkbox-field) input,
.member-profile-form label:not(.checkbox-field) select {
  background: #ffffff;
}

.member-profile-form .checkbox-field {
  border: 0;
  border-radius: 8px;
  background: #f7f7f8;
}

.member-profile-form .field-help {
  margin: -4px 0 0;
}

.member-profile-form .modal-actions {
  padding-top: 0;
  border-top: 0;
}

.profile-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
}

.profile-data-section {
  min-width: 0;
}

.profile-data-section .section-heading h2 {
  font-size: 22px;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.profile-permissions {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.profile-permissions span {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.profile-actions {
  display: none;
}

.application-status-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.member-profile-form.application-status-form {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.event-registration-section {
  display: grid;
  gap: 14px;
}

.modal-tabs {
  display: grid;
  gap: 16px;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
  background: #f7f7f8;
}

.tab-button {
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  font-weight: 800;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.tab-button.is-active {
  color: #ffffff;
  background: var(--red);
}

.tab-panel {
  min-width: 0;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
}

.calendar-filter {
  grid-template-columns: minmax(180px, 220px) minmax(220px, 1fr) auto;
}

.resources-filter {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.calendar-nav .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.mobile-month-calendar {
  display: none;
}

.calendar-weekday {
  min-height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background: #ffffff;
}

.calendar-day {
  min-height: 132px;
  padding: 10px;
  background: #ffffff;
}

.calendar-day.is-muted {
  background: #f7f7f8;
}

.calendar-day.is-muted .calendar-day-number {
  color: #a4a8ae;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(129, 39, 62, 0.35);
}

.calendar-day-number {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.calendar-events {
  display: grid;
  gap: 6px;
}

.calendar-event {
  width: 100%;
  display: block;
  padding: 7px 8px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 0;
  border-left: 4px solid var(--red);
  border-radius: 6px;
  background: #f6f6f8;
}

.calendar-event-button {
  cursor: pointer;
}

.calendar-event-button:hover,
.calendar-event-button:focus {
  background: rgba(129, 39, 62, 0.08);
  outline: 2px solid rgba(129, 39, 62, 0.2);
  outline-offset: 1px;
}

.calendar-event strong,
.calendar-event span {
  display: block;
  overflow-wrap: anywhere;
}

.calendar-event strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.calendar-event span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-list-panel {
  margin-top: 18px;
}

.booking-row {
  grid-template-columns: minmax(0, 1fr) 160px auto;
}

.booking-time {
  display: grid;
  justify-items: start;
}

.booking-time strong {
  color: var(--ink);
}

.booking-time span {
  color: var(--muted);
}

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

.request-section {
  margin-top: 24px;
}

.request-section .section-heading {
  margin-bottom: 12px;
}

.resource-request-panel {
  margin-top: 0;
}

.request-filter {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 0;
}

.request-filter label {
  min-width: 210px;
}

.resource-request-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) minmax(112px, auto);
}

.resource-request-manage-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) minmax(112px, auto) auto;
}

.request-period {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.request-period strong,
.request-period span {
  overflow-wrap: anywhere;
}

.request-period strong {
  color: var(--ink);
}

.request-period span {
  color: var(--muted);
  font-size: 13px;
}

.request-status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: #5b3b12;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid rgba(194, 126, 31, 0.28);
  border-radius: 999px;
  background: #fff4df;
}

.request-status-accepted {
  color: #1f5b34;
  border-color: rgba(38, 131, 73, 0.28);
  background: #e8f7ee;
}

.request-status-rejected {
  color: #8a2733;
  border-color: rgba(138, 39, 51, 0.24);
  background: #fdecef;
}

.schedule-panel {
  margin-top: 14px;
}

.schedule-row {
  grid-template-columns: 120px minmax(0, 1fr) 100px;
}

.schedule-date {
  display: grid;
  gap: 2px;
}

.schedule-date strong {
  color: var(--ink);
  font-size: 16px;
}

.schedule-date span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.schedule-result {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  color: var(--red);
  font-weight: 800;
  border: 1px solid rgba(129, 39, 62, 0.22);
  border-radius: 6px;
  background: #ffffff;
}

.import-status {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: var(--paper);
}

.import-status strong {
  color: var(--ink);
}

.import-status span,
.import-status small {
  color: var(--muted);
}

.import-status.is-error {
  border-left-color: #b42318;
}

.modal-wide {
  width: min(920px, calc(100% - 28px));
}

.modal-confirm {
  width: min(520px, calc(100% - 28px));
}

.resource-form {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.resource-form-grid {
  grid-template-columns: minmax(0, 1fr) 120px 140px;
}

.resource-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 120px minmax(150px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

input[type="color"] {
  min-height: 46px;
  padding: 4px;
}

.modal {
  width: min(680px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  margin: auto;
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: var(--shadow);
}

.modal.member-modal {
  width: min(1240px, calc(100% - 28px));
}

.modal::backdrop {
  background: rgba(20, 24, 29, 0.55);
}

.modal-panel {
  width: 100%;
  min-width: 0;
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 26px;
  border: 1px solid rgba(32, 36, 40, 0.12);
  border-radius: 8px;
  background: var(--paper);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.modal-header .section-heading {
  min-width: 0;
  margin-bottom: 0;
}

.modal-close {
  width: 38px;
  height: 38px;
  position: relative;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 18px;
  height: 2px;
  background: var(--ink);
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.modal-close:hover,
.modal-close:focus {
  border-color: rgba(129, 39, 62, 0.35);
  outline: 3px solid rgba(129, 39, 62, 0.15);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.confirm-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-details {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.confirm-details strong,
.confirm-details span {
  display: block;
  overflow-wrap: anywhere;
}

.confirm-details strong {
  color: var(--ink);
  font-size: 17px;
}

.confirm-details span {
  color: var(--muted);
  font-size: 13px;
}

.confirm-actions {
  justify-content: flex-end;
}

.member-summary {
  color: var(--muted);
  font-weight: 700;
}

.field-help {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #30343a;
  font-size: 14px;
  font-weight: 700;
}

.permission-list {
  display: grid;
  gap: 8px;
}

.checkbox-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.checkbox-field span,
.checkbox-field strong,
.checkbox-field small {
  display: block;
}

.checkbox-field strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.checkbox-field small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.single-checkbox {
  grid-template-columns: 18px minmax(0, 1fr);
}

.secondary-button {
  min-height: 42px;
  padding: 9px 13px;
  color: var(--red);
  font-weight: 700;
  border: 1px solid rgba(129, 39, 62, 0.28);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.secondary-button:hover,
.secondary-button:focus {
  color: #ffffff;
  background: var(--red);
  text-decoration: none;
}

.danger-button {
  min-height: 42px;
  padding: 9px 13px;
  color: #ffffff;
  font-weight: 700;
  border: 1px solid var(--red-dark);
  border-radius: 6px;
  background: var(--red);
  cursor: pointer;
}

.danger-button:hover,
.danger-button:focus {
  background: var(--red-dark);
  outline: 3px solid rgba(129, 39, 62, 0.16);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table th {
  padding: 0 10px 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.table-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 0.85fr) minmax(220px, 1.2fr) 76px minmax(160px, auto);
  gap: 12px;
  align-items: end;
}

.compact-field {
  min-width: 0;
}

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

.compact-field input[readonly] {
  color: var(--muted);
  background: #f6f6f6;
}

.table-meta {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.permission-cell {
  align-self: stretch;
}

.permission-cell .checkbox-field {
  min-height: 42px;
  padding: 8px 10px;
}

.permission-cell .checkbox-field small {
  display: none;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  color: #14532d;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background: #edf8f0;
  white-space: nowrap;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  .auth-shell,
  .dashboard-grid,
  .admin-layout,
  .profile-grid,
  .profile-data-grid,
  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-detail-item.is-wide {
    grid-column: auto;
  }

  .has-sidebar .site-header,
  html[data-sidebar="closed"] .has-sidebar .site-header,
  html[data-sidebar="open"] .has-sidebar .site-header,
  .app-frame,
  html[data-sidebar="closed"] .app-frame,
  html[data-sidebar="open"] .app-frame {
    margin-left: 0;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 18;
  }

  .mobile-menu-toggle {
    display: inline-grid;
  }

  .app-sidebar,
  html[data-sidebar="closed"] .app-sidebar,
  html[data-sidebar="open"] .app-sidebar {
    width: min(320px, 86vw);
    padding: 16px 14px;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  html[data-sidebar="open"] .app-sidebar {
    transform: translateX(0);
    box-shadow: 18px 0 40px rgba(18, 24, 32, 0.24);
  }

  html[data-sidebar="closed"] .sidebar-tools,
  html[data-sidebar="closed"] .sidebar-link,
  html[data-sidebar="closed"] .sidebar-group-toggle {
    justify-content: initial;
  }

  html[data-sidebar="closed"] .sidebar-avatar {
    width: 72px;
    height: 72px;
    font-size: 22px;
  }

  html[data-sidebar="closed"] .sidebar-user strong,
  html[data-sidebar="closed"] .sidebar-label,
  html[data-sidebar="closed"] .sidebar-caret {
    display: initial;
  }

  html[data-sidebar="closed"] .sidebar-submenu {
    display: none;
  }

  html[data-sidebar="open"] .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    border: 0;
    background: rgba(20, 24, 29, 0.42);
  }

  .app-sidebar {
    z-index: 21;
  }

  html[data-sidebar="open"] body.has-sidebar {
    overflow: hidden;
  }

  .auth-shell {
    align-items: start;
    gap: 22px;
    padding-top: 28px;
  }

  .auth-intro {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 16px;
  }

  .auth-intro img {
    width: 96px;
    margin: 0;
  }

  .auth-intro p {
    grid-column: 2;
  }

  .auth-intro h1 {
    grid-column: 2;
    font-size: 34px;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .page-shell,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .page-shell {
    padding-top: 22px;
  }

  .dashboard-hero {
    padding: 22px 0;
  }

  .dashboard-hero h1 {
    font-size: 34px;
  }

  .dashboard-tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .groups-toolbar,
  .modal-actions,
  .delete-form,
  .row-actions,
  .filter-actions,
  .action-buttons,
  .request-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .mobile-filter-shell {
    margin-top: 12px;
  }

  .mobile-filter-summary {
    display: grid;
    gap: 2px;
    padding: 14px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    cursor: pointer;
  }

  .mobile-filter-summary::marker {
    color: var(--red);
  }

  .mobile-filter-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-filter-summary strong {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .mobile-filter-shell .filter-panel {
    margin-top: 8px;
  }

  .compact-action {
    width: 100%;
  }

  .request-filter,
  .request-filter label {
    width: 100%;
  }

  .group-row,
  .user-row,
  .member-row,
  .resource-list-row,
  .document-row,
  .article-row,
  .category-row,
  .application-row,
  .event-row,
  .event-registration-row,
  .bug-row,
  .schedule-row,
  .booking-row,
  .resource-request-row,
  .resource-request-manage-row,
  .resource-row,
  .resource-form-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  .booking-actions,
  .booking-actions .secondary-button,
  .row-actions,
  .row-actions .secondary-button,
  .row-actions .danger-button,
  .delete-form .danger-button {
    width: 100%;
  }

  .calendar-grid {
    display: none;
  }

  .mobile-month-calendar {
    display: grid;
    gap: 14px;
    margin-top: 14px;
  }

  .mobile-month-weekdays,
  .mobile-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-month-weekdays span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
  }

  .mobile-month-day {
    position: relative;
    min-height: 44px;
    display: grid;
    place-items: center;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    text-decoration: none;
  }

  .mobile-month-day:hover,
  .mobile-month-day:focus {
    color: var(--ink);
    text-decoration: none;
    outline: 3px solid rgba(129, 39, 62, 0.16);
  }

  .mobile-month-day.is-muted {
    color: #a4a8ae;
    background: #f7f7f8;
  }

  .mobile-month-day.is-today {
    border-color: rgba(129, 39, 62, 0.5);
  }

  .mobile-month-day.is-selected {
    color: #ffffff;
    border-color: var(--red);
    background: var(--red);
  }

  .mobile-month-day span {
    font-weight: 800;
  }

  .mobile-month-day small {
    position: absolute;
    right: 5px;
    bottom: 4px;
    min-width: 17px;
    min-height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    border-radius: 999px;
    background: var(--green);
  }

  .mobile-month-day.is-selected small {
    color: var(--red);
    background: #ffffff;
  }

  .mobile-day-agenda {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
  }

  .mobile-day-agenda .section-heading {
    margin: 0;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-day-agenda .section-heading h2 {
    font-size: 20px;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table td {
    padding: 14px 0;
  }

  .data-table tr {
    padding: 10px 0;
    border-top: 1px solid var(--line);
  }

  .data-table tr:first-child {
    border-top: 0;
  }

  .table-form {
    grid-template-columns: 1fr;
  }

  .compact-field span {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .table-actions {
    justify-content: flex-start;
  }

  .modal-panel {
    padding: 22px;
  }

  .modal,
  .modal.member-modal,
  .modal-wide,
  .modal-confirm {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  .modal-panel,
  .modal .form-stack,
  .modal .form-grid,
  .modal label,
  .modal input,
  .modal select,
  .modal textarea {
    min-width: 0;
    max-width: 100%;
  }

  .modal input,
  .modal select,
  .modal textarea {
    font-size: 16px;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .top-bar {
    flex-direction: column;
    gap: 2px;
    text-align: center;
  }

  .main-nav {
    min-height: 70px;
    width: min(100% - 24px, 1120px);
  }

  .top-bar {
    display: none;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    font-size: 12px;
  }

  .nav-actions {
    gap: 10px;
    font-size: 14px;
  }

  .auth-card {
    padding: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: calc(100% - 20px);
    min-height: calc(100vh - 118px);
    padding: 18px 0 38px;
  }

  .dashboard-hero h1 {
    font-size: 30px;
  }

  .dashboard-tile-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-tile {
    min-height: 132px;
    padding: 18px;
  }

  .dashboard-tile strong {
    font-size: 21px;
  }

  .dashboard-tile-count {
    font-size: 28px;
  }

  .groups-toolbar,
  .filter-panel,
  .panel {
    margin-top: 12px;
  }

  .filter-panel,
  .panel,
  .group-row {
    padding: 14px;
  }

  .group-row {
    min-height: auto;
  }

  .group-row-main h2 {
    font-size: 18px;
  }

  .view-switch {
    flex-direction: column;
  }

  .view-switch a,
  .view-switch button {
    width: 100%;
  }

  .calendar-day {
    padding: 12px;
  }

  .modal,
  .modal.member-modal,
  .modal-wide,
  .modal-confirm {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .modal-panel {
    max-height: calc(100dvh - 12px);
    padding: 16px;
  }

  .modal-header {
    gap: 12px;
  }

  .modal-header .section-heading {
    margin-bottom: 0;
  }

  .modal-header .section-heading h2 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .modal-actions,
  .confirm-actions {
    align-items: stretch;
  }

  .modal-actions .primary-button,
  .modal-actions .secondary-button,
  .modal-actions .danger-button,
  .confirm-actions .primary-button,
  .confirm-actions .secondary-button,
  .confirm-actions .danger-button {
    width: 100%;
  }

  .profile-panel {
    padding: 22px;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .profile-hero-avatar {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    font-size: 22px;
  }

  .profile-identity h2 {
    font-size: 26px;
  }

  .profile-inline-actions .secondary-button,
  .profile-inline-actions .primary-button {
    width: 100%;
  }

  .member-modal-identity {
    align-items: flex-start;
    gap: 12px;
  }

  .member-modal-avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    font-size: 20px;
  }

  .member-modal-identity h2 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .member-modal-identity,
  .member-modal-identity div,
  .profile-detail-item,
  .profile-detail-item dd {
    min-width: 0;
  }

  .profile-detail-item dd {
    overflow-wrap: anywhere;
  }
}
