html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
  background-color: #ffffff;
  color: #171717;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}

button,
[role='button'],
.app-sidebar-link,
.app-mobile-nav-link {
  -webkit-tap-highlight-color: transparent;
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}

.login-center {
  width: 100%;
  max-width: 24rem;
  text-align: center;
}

.login-brand {
  margin-bottom: 2.5rem;
}

.login-brand-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #171717;
}

.login-brand-subtitle {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: #737373;
}

.login-form {
  width: 100%;
  text-align: left;
}

.login-form h1 {
  margin: 0 0 1.5rem;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #171717;
}

.login-field {
  margin-bottom: 1.25rem;
}

.login-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #404040;
}

.login-field input:not(.otp-input-cell) {
  box-sizing: border-box;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.625rem;
  background: #ffffff;
  color: #171717;
  font-family: inherit;
  font-size: 1rem;
}

.login-field input:not(.otp-input-cell):focus {
  outline: 2px solid #f5f5f5;
  border-color: #a3a3a3;
}

.login-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 0.625rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.login-submit:hover {
  background: #262626;
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.login-hint {
  margin: -0.75rem 0 1.25rem;
  font-size: 0.8125rem;
  color: #737373;
  line-height: 1.5;
}

.login-hint strong {
  color: #404040;
  font-weight: 600;
}

.login-hint--secondary {
  margin-top: -0.5rem;
  font-size: 0.75rem;
  color: #a3a3a3;
}

.login-form--status {
  text-align: center;
}

.login-back--block {
  display: inline-block;
  margin-top: 0.5rem;
}

.auth-confirm-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0 0.25rem;
  animation: auth-confirm-success-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.auth-confirm-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
}

.auth-confirm-success-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #171717;
}

.auth-confirm-success-message {
  margin: 0;
  max-width: 18rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #737373;
}

.login-email-confirmed-banner {
  margin: 0 0 1.15rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.5rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  color: #166534;
  text-align: center;
}

.setup-review-title {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #171717;
}

.setup-review {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #fafafa;
}

.vbs-mail-brand {
  display: inline-block;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #171717;
}

.setup-review-label-muted {
  font-weight: 500;
  color: #a3a3a3;
}

.ansatte-table thead .vbs-mail-brand {
  font-size: 0.8125rem;
}

.setup-review-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0;
}

.setup-review-row + .setup-review-row {
  border-top: 1px solid #ebebeb;
}

.setup-review-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.setup-review-value {
  font-size: 0.9375rem;
  color: #171717;
  word-break: break-word;
}

.login-page--setup-flow {
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 42%, #ffffff 100%);
}

.login-center--wide {
  max-width: 28rem;
}

.login-center--approve {
  text-align: left;
}

.login-page--setup-flow .login-brand {
  margin-bottom: 1.75rem;
  text-align: center;
}

.setup-approve {
  width: 100%;
}

.setup-approve--enter {
  animation: setup-approve-fade-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes setup-approve-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.setup-approve-card {
  overflow: hidden;
  border: 1px solid #e8e8e8;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Horisontalt trin-forløb */
.setup-steps {
  position: relative;
  padding: 1.35rem 1.25rem 1.1rem;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.setup-steps-rail {
  position: absolute;
  left: 1.65rem;
  right: 1.65rem;
  top: 1.72rem;
  height: 3px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.setup-steps-rail-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fb923c 0%, #ea580c 100%);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.setup-steps-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  opacity: 0.4;
  transition: opacity 0.45s ease;
}

.setup-step--active,
.setup-step--done {
  opacity: 1;
}

.setup-step-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  box-sizing: border-box;
}

.setup-step-node--pending {
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  background: #ffffff;
}

.setup-step-node--active {
  border-radius: 50%;
}

.setup-step-node-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.2);
  animation: setup-step-ring 1.5s ease-out infinite;
}

@keyframes setup-step-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.setup-step-node-dot {
  position: relative;
  z-index: 1;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: #ea580c;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.12);
}

.setup-step-node--done {
  border-radius: 50%;
  background: #ea580c;
  color: #ffffff;
  animation: setup-node-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.setup-step-node--done svg {
  width: 0.875rem;
  height: 0.875rem;
}

@keyframes setup-node-pop {
  from {
    transform: scale(0.55);
  }
  to {
    transform: scale(1);
  }
}

.setup-step-title {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.35;
  color: #a3a3a3;
  transition: color 0.35s ease;
}

.setup-step-short {
  display: none;
}

.setup-step--active .setup-step-title {
  color: #c2410c;
}

.setup-step--done .setup-step-title {
  color: #171717;
}

.setup-approve-divider {
  height: 1px;
  background: #f0f0f0;
}

.setup-approve-body {
  padding: 1.5rem 1.35rem 1.6rem;
}

.setup-approve-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 14.5rem;
  justify-content: center;
}

.setup-approve-phase--loading {
  animation: setup-phase-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.setup-approve-phase--ready {
  min-height: 10rem;
  animation: setup-phase-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes setup-phase-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.setup-approve-loader {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.15rem;
}

.setup-approve-loader-orbit {
  position: absolute;
  inset: 0;
  border: 2px solid #f0f0f0;
  border-top-color: #ea580c;
  border-radius: 50%;
  animation: setup-spin 0.85s linear infinite;
}

.setup-approve-loader-icon {
  position: absolute;
  inset: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ea580c;
}

.setup-approve-loader-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

@keyframes setup-spin {
  to {
    transform: rotate(360deg);
  }
}

.setup-approve-ready-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: #ecfdf3;
  color: #16a34a;
  animation: setup-ready-badge 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.setup-approve-ready-badge svg {
  width: 1.35rem;
  height: 1.35rem;
}

@keyframes setup-ready-badge {
  from {
    opacity: 0;
    transform: scale(0.65);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.setup-approve-title {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: #171717;
}

.setup-approve-lead {
  margin: 0;
  max-width: 19rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #737373;
}

.setup-approve-error {
  margin: 1rem 0 0;
  width: 100%;
  text-align: left;
}

.setup-approve-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  max-width: 19rem;
  margin-top: 1.35rem;
  animation: setup-actions-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

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

.setup-approve-actions .login-submit {
  margin-top: 0;
}

.setup-approve-cancel {
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #737373;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.setup-approve-cancel:hover:not(:disabled) {
  color: #171717;
  background: #f5f5f5;
}

.setup-approve-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .login-center--wide {
    max-width: 100%;
  }

  .setup-steps {
    padding: 1.15rem 0.85rem 0.95rem;
  }

  .setup-steps-rail {
    left: 1.15rem;
    right: 1.15rem;
  }

  .setup-step-title {
    display: none;
  }

  .setup-step-short {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.3;
    color: #a3a3a3;
  }

  .setup-step--active .setup-step-short {
    color: #c2410c;
  }

  .setup-step--done .setup-step-short {
    color: #171717;
  }

  .setup-approve-body {
    padding: 1.25rem 1rem 1.35rem;
  }

  .setup-approve-phase {
    min-height: 12.5rem;
  }
}

.login-mock-badge {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

.login-back {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: #737373;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.login-back:hover {
  color: #171717;
}

.login-field--otp {
  margin-bottom: 1.5rem;
}

.login-field-label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #404040;
}

.otp-input {
  width: 100%;
}

.otp-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.otp-input-cell {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 2.5rem;
  height: 3rem;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #fafafa;
  color: #171717;
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 1.375rem;
  font-weight: 600;
  text-align: center;
  line-height: 3rem;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.otp-input-cell:focus {
  outline: none;
  border-color: #171717;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08);
}

.otp-input-cell--filled {
  background: #ffffff;
  border-color: #d4d4d4;
}

.otp-input-cell:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.otp-input-sep {
  flex-shrink: 0;
  margin: 0 0.15rem;
  font-size: 1.125rem;
  font-weight: 300;
  color: #d4d4d4;
  user-select: none;
}

@media (max-width: 380px) {
  .otp-input-row {
    gap: 0.2rem;
  }

  .otp-input-cell {
    width: 2.15rem;
    height: 2.75rem;
    font-size: 1.25rem;
    line-height: 2.75rem;
  }

  .otp-input-sep {
    margin: 0 0.05rem;
    font-size: 1rem;
  }
}

/* App shell (sidebar + main) */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: #ffffff;
}

.app-sidebar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  width: 16rem;
  min-height: 100vh;
  padding: 1.85rem 1.2rem 1.35rem;
  border-right: 1px solid #ebebeb;
  box-sizing: border-box;
  background: #ffffff;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

.app-sidebar-top {
  flex: 1;
  min-height: 0;
}

.app-sidebar-brand {
  padding: 0 0.5rem;
}

.app-sidebar-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #171717;
  line-height: 1.2;
}

.app-sidebar-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #737373;
  line-height: 1.3;
}

.app-sidebar-divider {
  margin: 1.35rem 0.5rem 1.1rem;
  height: 1px;
  background: #e5e5e5;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.25rem;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #525252;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-sidebar-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #737373;
}

.app-sidebar-link-label {
  line-height: 1.2;
}

.app-sidebar-link:hover {
  background: #f5f5f5;
  color: #171717;
}

.app-sidebar-link:hover .app-sidebar-link-icon {
  color: #171717;
}

.app-sidebar-link--active {
  background: #f5f5f5;
  color: #171717;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #e5e5e5;
}

.app-sidebar-link--active .app-sidebar-link-icon {
  color: #171717;
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 1.15rem 0.35rem 0;
  border-top: 1px solid #e5e5e5;
}

.app-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
  min-width: 0;
}

.app-sidebar-user-text {
  flex: 1;
  min-width: 0;
}

.app-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #171717;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-avatar--md {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.75rem;
}

.app-avatar--lg {
  width: 3rem;
  height: 3rem;
  font-size: 0.875rem;
}

.app-avatar--img {
  object-fit: cover;
  background: #f5f5f5;
}

.app-sidebar-user-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-user-email {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #737373;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-logout {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #dc2626;
  border-radius: 0.5rem;
  background: #dc2626;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.app-sidebar-logout:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.app-sidebar-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-main {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  background: #ffffff;
}

.app-main > .messages-page {
  flex: 1;
  min-height: 0;
}

.app-page {
  padding: 2rem 2.5rem;
  max-width: 48rem;
}

.app-page-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #171717;
}

.app-page-welcome {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #171717;
  line-height: 1.25;
}

.app-page-welcome-name {
  font-weight: 700;
}

.app-page-lead {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
  line-height: 1.5;
}

/* Home */
.app-page.home-page {
  max-width: none;
  width: 100%;
}

.home-page {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.home-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 901px) {
  .app-page.home-page {
    padding: 2.25rem 3.5rem 3rem;
    max-width: none;
  }

  .home-head {
    margin-bottom: 2rem;
  }

  .home-head-meta {
    font-size: 0.9375rem;
  }

  .home-head-title {
    font-size: 2rem;
  }

  .home-profile-card {
    margin-bottom: 2.5rem;
  }

  .home-profile-avatar {
    width: 15rem;
    min-height: 12.5rem;
    padding: 2rem 1.5rem;
  }

  .home-profile-body {
    padding: 2rem 2.5rem 2.25rem;
  }

  .home-profile-name {
    font-size: 1.625rem;
  }

  .home-profile-org {
    margin-bottom: 1.75rem;
    font-size: 1rem;
  }

  .home-profile-fields {
    gap: 1.25rem 3rem;
  }

  .home-profile-field dt {
    font-size: 0.875rem;
  }

  .home-profile-field dd {
    font-size: 1.0625rem;
  }

  .home-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    grid-template-rows: auto auto;
    gap: 2rem 2.5rem;
    align-items: stretch;
  }

  .home-block--messages {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  .home-block--shortcuts {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
  }

  .home-block--events {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .home-block--events .home-events-list,
  .home-block--events .home-panel--tall {
    flex: 1;
    min-height: 12rem;
  }

  .home-block-title {
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
  }

  .home-panel--tall {
    min-height: 7rem;
    padding: 1.25rem 1.35rem;
  }

  .home-panel--tall p {
    font-size: 1rem;
  }

  .home-quick-grid {
    gap: 1rem;
  }

  .home-quick-link {
    min-height: 6.25rem;
    padding: 1.15rem;
  }

  .home-quick-link-label {
    font-size: 1rem;
  }

  .home-events-list--tall {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .home-event-row {
    padding: 1.05rem 1.35rem;
  }

  .home-event-row-title {
    font-size: 1rem;
  }

  .home-event-row-meta {
    font-size: 0.875rem;
  }
}

@media (min-width: 1200px) {
  .app-page.home-page {
    padding: 2.5rem 4rem 3.5rem;
  }

  .home-profile-avatar {
    width: 17rem;
    min-height: 13.5rem;
  }

  .home-body {
    gap: 2.25rem 3rem;
  }
}

.home-head {
  margin-bottom: 1.5rem;
}

.home-head-meta {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #737373;
}

.home-head-title {
  margin: 0;
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #171717;
  line-height: 1.25;
}

.home-head-divider {
  margin: 1rem 0 0;
  border: none;
  border-top: 1px solid #e5e5e5;
}

.home-profile-card {
  display: flex;
  align-items: stretch;
  margin-bottom: 2rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.home-profile-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 11rem;
  min-height: 10rem;
  padding: 1.5rem 1.25rem;
  background: #f3f3f3;
  box-sizing: border-box;
}

.home-profile-body {
  flex: 1;
  min-width: 0;
  padding: 1.35rem 1.75rem 1.5rem;
}

.home-profile-name {
  margin: 0 0 0.2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #171717;
  line-height: 1.3;
}

.home-profile-org {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #525252;
}

.home-profile-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.5rem;
  margin: 0;
}

.home-profile-field {
  margin: 0;
  min-width: 0;
}

.home-profile-field dt {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #737373;
}

.home-profile-field dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
  line-height: 1.35;
  word-break: break-word;
}

.home-block {
  margin-bottom: 2rem;
}

.home-block-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.home-block-title {
  margin: 0 0 0.65rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #171717;
}

.home-block-row .home-block-title {
  margin-bottom: 0;
}

.home-block-link {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #525252;
  text-decoration: none;
}

.home-block-link:hover {
  color: #171717;
  text-decoration: underline;
}

.home-panel {
  padding: 1rem 1.15rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.home-panel--empty p {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
}

.home-muted {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
}

.home-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.home-messages-link {
  display: block;
  padding: 1rem 1.15rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: #525252;
  font-size: 0.9375rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.home-messages-link:hover {
  border-color: #d4d4d4;
  background: #fafafa;
}

.home-messages-link p {
  margin: 0;
}

.home-messages-link strong {
  color: #171717;
}

.home-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 5.5rem;
  padding: 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: #171717;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.home-quick-link:hover {
  border-color: #d4d4d4;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
}

.home-quick-link-icon {
  display: flex;
  color: #525252;
}

.home-quick-link-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.home-events-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.home-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid #ebebeb;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.home-events-list li:last-child .home-event-row {
  border-bottom: none;
}

.home-event-row:hover {
  background: #fafafa;
}

.home-event-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  text-align: left;
}

.home-event-row-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
}

.home-event-row-meta {
  font-size: 0.8125rem;
  color: #737373;
}

.home-event-status {
  font-weight: 600;
}

.home-event-status--joined {
  color: #525252;
}

.home-event-status--at {
  color: #166534;
}

.home-event-row-arrow {
  flex-shrink: 0;
  color: #a3a3a3;
  font-weight: 600;
}

.app-page--fill {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  width: 100%;
  padding: 1.25rem 1.5rem 1.5rem;
  box-sizing: border-box;
}

.events-page {
  max-width: 72rem;
}

.app-page.fravaer-page {
  max-width: none;
  width: 100%;
}

.fravaer-page {
  max-width: none;
  width: 100%;
}

/* Fravær */
.fravaer-page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fravaer-page-header-text .app-page-title {
  margin: 0 0 0.25rem;
}

.fravaer-page-header-text .app-page-lead {
  margin: 0;
}

.fravaer-add-btn {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 0.5rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.fravaer-add-btn:hover {
  background: #404040;
}

.fravaer-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #404040;
}

.fravaer-field--wide {
  margin-bottom: 1rem;
}

.fravaer-field input,
.fravaer-field select,
.fravaer-field textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
}

.fravaer-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.fravaer-field textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.fravaer-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.fravaer-submit {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #16a34a;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.fravaer-submit:hover:not(:disabled) {
  background: #15803d;
}

.fravaer-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fravaer-loading,
.fravaer-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
}

.fravaer-total {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: #171717;
}

.fravaer-total strong {
  font-weight: 700;
}

.fravaer-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.fravaer-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fravaer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: #171717;
}

.fravaer-table thead th {
  padding: 0.65rem 1rem 0.65rem 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  color: #171717;
  border-bottom: 1px solid #e5e5e5;
  white-space: nowrap;
}

.fravaer-table tbody td {
  padding: 0.85rem 1rem 0.85rem 0;
  vertical-align: middle;
  border-bottom: 1px solid #ebebeb;
}

.fravaer-table tbody tr:last-child td {
  border-bottom: none;
}

.fravaer-table-actions-head,
.fravaer-table-actions {
  width: 1%;
  padding-right: 0 !important;
  text-align: right;
  white-space: nowrap;
}

.fravaer-table-delete {
  padding: 0.35rem 0.5rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: #737373;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.fravaer-table-delete:hover:not(:disabled) {
  color: #b91c1c;
  background: #fef2f2;
}

.fravaer-table-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

/* Fravær popup */
.fravaer-modal .calendar-modal-panel {
  width: min(40rem, calc(100vw - 2rem));
  max-width: 40rem;
}

.fravaer-modal-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: #525252;
  line-height: 1.5;
}

.fravaer-modal-form .fravaer-field:last-of-type {
  margin-bottom: 0.25rem;
}

.fravaer-modal-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.fravaer-modal-cancel {
  flex: 1;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #404040;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.fravaer-modal-cancel:hover:not(:disabled) {
  background: #fafafa;
}

.fravaer-modal-actions .fravaer-submit {
  flex: 1.4;
  width: auto;
}

@media (min-width: 901px) {
  .app-page.fravaer-page {
    padding: 2.25rem 3.5rem 3rem;
  }

  .fravaer-table {
    font-size: 1rem;
  }

  .fravaer-table thead th {
    font-size: 0.9375rem;
    padding-bottom: 0.75rem;
  }

  .fravaer-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* Beskeder */
.app-page.messages-page {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding-bottom: 1.5rem;
}

.messages-page-header {
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.messages-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.messages-muted {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #737373;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 28rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.messages-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #ebebeb;
  background: #fafafa;
  padding: 1rem;
  overflow: hidden;
}

.messages-search {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 0.85rem;
}

.messages-search-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #404040;
}

.messages-search-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
}

.messages-search-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}

.messages-search-dropdown {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  max-height: 14rem;
  overflow-y: auto;
}

.messages-search-item {
  width: 100%;
  display: block;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #171717;
  text-align: left;
  cursor: pointer;
}

.messages-search-item:hover,
.messages-search-item--active {
  background: #f5f5f5;
}

.messages-thread-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.messages-thread-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.65rem;
  margin-bottom: 0.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.messages-thread-item:hover {
  background: #f0f0f0;
}

.messages-thread-item--active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.messages-thread-item-top,
.messages-thread-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.messages-thread-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-thread-time {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: #a3a3a3;
}

.messages-thread-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: #737373;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-thread-badge {
  flex-shrink: 0;
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #171717;
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
}

.messages-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #ffffff;
}

.messages-chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.messages-chat-empty p {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
  max-width: 20rem;
}

.messages-chat-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid #ebebeb;
}

.messages-chat-back {
  display: none;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.messages-chat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #171717;
}

.messages-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.15rem;
}

.messages-chat-placeholder {
  text-align: center;
}

.messages-bubble-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.messages-bubble {
  max-width: min(28rem, 85%);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.messages-bubble--mine {
  align-self: flex-end;
  align-items: flex-end;
}

.messages-bubble--theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.messages-bubble-text {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  word-break: break-word;
}

.messages-bubble--mine .messages-bubble-text {
  background: #171717;
  color: #ffffff;
  border-bottom-right-radius: 0.2rem;
}

.messages-bubble--theirs .messages-bubble-text {
  background: #f5f5f5;
  color: #171717;
  border-bottom-left-radius: 0.2rem;
}

.messages-bubble-time {
  font-size: 0.6875rem;
  color: #a3a3a3;
}

.messages-compose {
  flex-shrink: 0;
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
  padding: 0.85rem 1rem;
  border-top: 1px solid #ebebeb;
  background: #fafafa;
}

.messages-compose-input {
  flex: 1;
  min-height: 2.75rem;
  max-height: 8rem;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
  resize: vertical;
}

.messages-compose-send {
  flex-shrink: 0;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 0.5rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.messages-compose-send:hover:not(:disabled) {
  background: #404040;
}

.messages-compose-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (min-width: 901px) {
  .app-page.messages-page {
    padding: 2.25rem 3.5rem 2rem;
    height: calc(100vh - 0px);
    max-height: 100%;
    box-sizing: border-box;
  }

  .app-main:has(.messages-page) {
    min-height: 0;
  }

  .messages-layout {
    min-height: 0;
    flex: 1;
  }
}

/* Ansatte */
.app-page.ansatte-page {
  flex: 1 1 auto;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 901px) {
  .app-page.ansatte-page {
    padding: 2rem 2rem 2.5rem;
  }
}

@media (min-width: 1200px) {
  .app-page.ansatte-page {
    padding: 2.25rem 2.5rem 3rem;
  }
}

.ansatte-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 1.5rem;
}

.ansatte-header .app-page-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.ansatte-hire-btn {
  flex-shrink: 0;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 0.5rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.ansatte-hire-btn:hover {
  background: #404040;
}

.ansatte-modal .calendar-modal-panel {
  width: min(26rem, calc(100vw - 2rem));
  max-width: 26rem;
}

.ansatte-modal .calendar-modal-header {
  padding: 0.85rem 1rem;
}

.ansatte-modal-body {
  padding: 0.85rem 1rem 1rem;
}

.ansatte-modal-form {
  max-width: none;
}

.ansatte-modal-form .ansatte-field {
  margin-bottom: 0.85rem;
}

.ansatte-modal-form .ansatte-field:last-of-type {
  margin-bottom: 0.15rem;
}

.ansatte-modal .fravaer-modal-actions .ansatte-submit {
  flex: 1.4;
  width: auto;
  margin-top: 0;
}

.ansatte-forbidden {
  margin: 0;
  font-size: 0.9375rem;
  color: #525252;
  line-height: 1.5;
  max-width: 32rem;
}

.ansatte-muted {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
}

.ansatte-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.ansatte-success {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #f0fdf4;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  color: #166534;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ansatte-form-card,
.ansatte-list-section {
  margin-bottom: 2rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.ansatte-section-title {
  margin: 0 0 1.15rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #171717;
}

.ansatte-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 28rem;
}

.ansatte-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #404040;
}

.ansatte-field input {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
}

.ansatte-email-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ansatte-email-row input {
  flex: 1;
  min-width: 0;
}

.ansatte-email-domain {
  flex-shrink: 0;
  font-size: 0.9375rem;
  color: #525252;
}

.ansatte-field-hint {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: #737373;
  line-height: 1.4;
}

.ansatte-field-hint strong {
  color: #171717;
}

.ansatte-submit {
  margin-top: 0.25rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  border: none;
  border-radius: 0.5rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.ansatte-submit:hover:not(:disabled) {
  background: #404040;
}

.ansatte-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ansatte-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-right: -0.25rem;
  padding-bottom: 0.35rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.ansatte-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.ansatte-table thead th {
  padding: 0.55rem 0.75rem 0.55rem 0;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
}

.ansatte-table tbody td {
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid #ebebeb;
  vertical-align: middle;
  background: #ffffff;
}

.ansatte-table-col-name {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 7rem;
  max-width: 10rem;
  background: #ffffff;
}

.ansatte-table thead .ansatte-table-col-name {
  z-index: 3;
}

.ansatte-table-col-nr {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ansatte-table-col-email,
.ansatte-table-col-login {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ansatte-table-col-stilling {
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ansatte-table-col-days {
  white-space: nowrap;
}

.ansatte-table-col-status {
  white-space: nowrap;
}

.ansatte-table-col-created {
  white-space: nowrap;
}

.ansatte-table tbody tr:last-child td {
  border-bottom: none;
}

.ansatte-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.ansatte-status--ok {
  background: #dcfce7;
  color: #166534;
}

.ansatte-status--pending {
  background: #fff7ed;
  color: #c2410c;
}

.ansatte-table-actions-head,
.ansatte-table-actions {
  width: 1%;
  min-width: 10.5rem;
  padding-left: 0.75rem;
  padding-right: 0.25rem;
  text-align: right;
  white-space: nowrap;
}

.ansatte-table tbody tr:hover td {
  background: #fafafa;
}

.ansatte-table tbody tr:hover .ansatte-table-col-name {
  background: #fafafa;
}

@media (max-width: 1100px) {
  .ansatte-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ansatte-hire-btn {
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 1400px) {
  .admin-ansatte-section .ansatte-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-ansatte-section .ansatte-hire-btn {
    align-self: flex-start;
    width: auto;
    max-width: 100%;
  }
}

.ansatte-terminate-btn {
  padding: 0.4rem 0.65rem;
  border: 1px solid #fecaca;
  border-radius: 0.35rem;
  background: #ffffff;
  color: #b91c1c;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.ansatte-terminate-btn:hover:not(:disabled) {
  background: #fef2f2;
}

.ansatte-terminate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ansatte-field select {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
}

/* Administration */
.app-page.admin-page {
  flex: 1 1 auto;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

@media (min-width: 901px) {
  .app-page.admin-page {
    padding: 2.25rem 3.5rem 3rem;
  }
}

.admin-page-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e5e5e5;
}

.admin-tab {
  margin-bottom: -1px;
  padding: 0.55rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #737373;
  cursor: pointer;
}

.admin-tab--active {
  color: #171717;
  border-bottom-color: #171717;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.admin-section-header {
  margin-bottom: 1rem;
}

.admin-section-header .ansatte-section-title {
  margin: 0;
}

.admin-list-section {
  max-width: 52rem;
}

.admin-ansatte-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-ansatte-section .ansatte-header {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-ansatte-section .ansatte-hire-btn {
  max-width: 100%;
}

.admin-ansatte-section .ansatte-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-right: 0;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  overflow-y: visible;
}

.admin-ansatte-section .ansatte-table {
  width: max-content;
  min-width: 100%;
}

.admin-modal-body {
  max-height: min(70vh, 32rem);
  overflow-y: auto;
}

.admin-modal-form {
  max-width: none;
}

.admin-modal-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #737373;
  line-height: 1.45;
}

.admin-form-card {
  margin-bottom: 0;
}

.admin-form {
  max-width: none;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.875rem;
  color: #404040;
  cursor: pointer;
}

.admin-rank-fieldset {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}

.admin-rank-fieldset legend {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #404040;
}

.admin-rank-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #ebebeb;
}

.admin-list-item:last-child {
  border-bottom: none;
}

.admin-list-item-title {
  margin: 0 0 0.2rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
}

.admin-list-item-badge {
  margin-left: 0.45rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #f5f5f5;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #737373;
  vertical-align: middle;
}

.admin-list-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.admin-edit-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #404040;
  cursor: pointer;
}

.admin-edit-btn:hover:not(:disabled) {
  background: #fafafa;
  border-color: #a3a3a3;
}

.admin-edit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-list-item-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: #737373;
  line-height: 1.4;
}

.admin-mobile-block {
  display: none;
}

.admin-desktop-only {
  display: block;
}

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

@media (max-width: 768px) {
  .admin-mobile-block {
    display: block;
  }

  .admin-desktop-only {
    display: none;
  }
}

.events-page-header {
  margin-bottom: 1.5rem;
}

.events-loading,
.events-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
}

.events-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.events-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.events-card {
  display: flex;
  flex-direction: column;
  min-height: 14rem;
  padding: 1.5rem 1.6rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.events-card-badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
  background: #dcfce7;
  border: 1px solid #86efac;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #166534;
}

.events-card-name {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #737373;
}

.events-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #171717;
  line-height: 1.3;
}

.events-card-location {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: #404040;
}

.events-card-desc {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  color: #525252;
  line-height: 1.5;
  flex: 1;
}

.events-card-meta {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: #737373;
}

.events-card-join,
.events-card-leave {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem 1.1rem;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.events-card-join {
  border: none;
  background: #16a34a;
  color: #ffffff;
}

.events-card-join:hover:not(:disabled) {
  background: #15803d;
}

.events-card-leave {
  border: none;
  background: #dc2626;
  color: #ffffff;
}

.events-card-leave:hover:not(:disabled) {
  background: #b91c1c;
}

.events-card-join:disabled,
.events-card-leave:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.events-card-register-fravaer {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid #171717;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
}

.events-card-register-fravaer:hover {
  background: #171717;
  color: #ffffff;
}

/* Event fraværregister */
.event-attendance-page {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.event-attendance-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 1.15rem;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #525252;
  text-decoration: none;
  text-align: left;
}

.event-attendance-back:hover {
  color: #171717;
}

.event-attendance-inner {
  width: 100%;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.event-attendance-page-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.event-attendance-page-title {
  margin: 0;
  color: #171717;
}

.event-attendance-event-ref {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #525252;
  line-height: 1.4;
}

.event-attendance-event-ref-label {
  font-weight: 600;
  color: #737373;
}

.event-attendance-loading,
.event-attendance-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: #737373;
}

.event-attendance-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  border-radius: 0.4375rem;
  font-size: 0.875rem;
  color: #b91c1c;
  text-align: center;
}

.event-attendance-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.event-attendance-row {
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: 1rem;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.event-attendance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
}

.event-attendance-strip-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.event-attendance-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-attendance-owner {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.3rem;
  background: #f5f5f5;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #525252;
  vertical-align: middle;
}

.event-attendance-note {
  display: block;
  padding: 0 0.85rem 0.55rem;
  text-align: left;
}

.event-attendance-note-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #737373;
}

.event-attendance-note-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  font-family: inherit;
  font-size: 16px;
  color: #171717;
  line-height: 1.4;
  resize: vertical;
  min-height: 2.25rem;
}

.event-attendance-note-input:focus {
  outline: none;
  border-color: #a3a3a3;
}

.event-attendance-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 2px solid #e5e5e5;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.event-attendance-ring--empty {
  border-style: dashed;
  background: #fafafa;
}

.event-attendance-ring--empty .event-attendance-ring-letter {
  color: #c4c4c4;
}

.event-attendance-ring-letter {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: #525252;
}

.event-attendance-ring:hover:not(:disabled):not(.event-attendance-ring--active) {
  border-color: #a3a3a3;
}

.event-attendance-ring:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.event-attendance-ring--active.event-attendance-ring--ankommet {
  border-color: #16a34a;
  background: #16a34a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.event-attendance-ring--active.event-attendance-ring--fravaerende {
  border-color: #dc2626;
  background: #dc2626;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.event-attendance-ring--active.event-attendance-ring--sygdom {
  border-color: #ea580c;
  background: #ea580c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.event-attendance-ring--active.event-attendance-ring--andet {
  border-color: #525252;
  background: #525252;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.event-attendance-ring--active .event-attendance-ring-letter {
  color: #ffffff;
}

.calendar-page-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-page-toolbar-text .app-page-title {
  margin: 0 0 0.25rem;
}

.calendar-page-toolbar-text .app-page-lead {
  margin: 0;
}

.calendar-toolbar-add {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 0.5rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.calendar-toolbar-add:hover {
  background: #404040;
}

.calendar-event-page {
  max-width: 720px;
}

.calendar-event-page-header {
  margin-bottom: 1.25rem;
}

.calendar-event-page-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #525252;
  text-decoration: none;
}

.calendar-event-page-back:hover {
  color: #171717;
}

.calendar-event-page-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.calendar-event-page-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calendar-event-page-error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  border-radius: 0.4375rem;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.calendar-event-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.calendar-form-field--wide {
  grid-column: 1 / -1;
}

.calendar-event-page-time {
  margin: 0;
  padding: 1rem 1rem 0.25rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
}

.calendar-event-page-legend {
  padding: 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #404040;
}

.calendar-datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  margin-top: 0.85rem;
}

.calendar-event-page-actions {
  display: flex;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

.calendar-event-page-actions .calendar-form-cancel,
.calendar-event-page-actions .calendar-form-submit {
  flex: 1;
  max-width: 12rem;
}

.calendar-event-page-actions .calendar-form-submit {
  max-width: none;
  flex: 1.5;
}

.calendar-event-name {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-event-location {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #404040;
}

.calendar-add-btn--aside {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: auto;
  border-style: solid;
  background: #171717;
  color: #ffffff;
  border-color: #171717;
}

.calendar-add-btn--aside:hover {
  background: #404040;
  border-color: #404040;
}

.calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.calendar-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.calendar-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.calendar-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e5e5;
}

.calendar-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #171717;
}

.calendar-modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.375rem;
  background: #f5f5f5;
  color: #525252;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-modal-close:hover {
  background: #e5e5e5;
  color: #171717;
}

.calendar-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
}

.calendar-member-search {
  position: relative;
}

.calendar-member-search-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}

.calendar-member-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 10;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.calendar-member-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
  color: #171717;
  cursor: pointer;
}

.calendar-member-dropdown-item:hover,
.calendar-member-dropdown-item--active {
  background: #f5f5f5;
}

@media (max-width: 640px) {
  .calendar-page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-toolbar-add {
    justify-content: center;
  }

  .calendar-event-page-grid,
  .calendar-datetime-row {
    grid-template-columns: 1fr;
  }

  .calendar-event-page-actions {
    flex-direction: column;
  }

  .calendar-event-page-actions .calendar-form-cancel,
  .calendar-event-page-actions .calendar-form-submit {
    max-width: none;
  }
}

.calendar {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 300px);
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .calendar {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .calendar-aside {
    flex-shrink: 0;
  }
}

.calendar-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.calendar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.calendar-header {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-month {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #171717;
  text-transform: capitalize;
}

.calendar-selected {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #737373;
  text-transform: capitalize;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.calendar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #525252;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-nav-btn:hover {
  background: #f5f5f5;
  color: #171717;
  border-color: #d4d4d4;
}

.calendar-today-btn {
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: 0.5rem;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.calendar-today-btn:hover {
  background: #262626;
}

.calendar-weekdays {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a3a3a3;
  padding: 0.25rem 0;
}

.calendar-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0.35rem;
}

.calendar-day {
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.calendar-day-num {
  font-size: clamp(0.8125rem, 1.1vw, 1rem);
  font-weight: 500;
  color: #171717;
  line-height: 1;
}

.calendar-day:hover:not(.calendar-day--selected) {
  background: #f5f5f5;
}

.calendar-day--muted .calendar-day-num {
  color: #c4c4c4;
  font-weight: 400;
}

.calendar-day--today:not(.calendar-day--selected) {
  background: #fafafa;
  box-shadow: inset 0 0 0 1px #d4d4d4;
}

.calendar-day--today:not(.calendar-day--selected) .calendar-day-num {
  font-weight: 700;
  color: #171717;
}

.calendar-day--selected {
  background: #171717;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.calendar-day--selected .calendar-day-num {
  color: #ffffff;
  font-weight: 600;
}

.calendar-day--selected.calendar-day--today {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.calendar-aside {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0.85rem 0.75rem;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.calendar-aside-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a3a3a3;
}

.calendar-aside-date {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #171717;
  line-height: 1.3;
  text-transform: capitalize;
}

.calendar-aside-hint {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: #737373;
  line-height: 1.5;
}

.calendar-aside-hint--footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.75rem;
}

.calendar-aside-body {
  flex: 1;
  min-height: 0;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-day-timeline {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: 0.25rem;
}

.calendar-day-timeline-axis {
  position: relative;
  height: 100%;
  min-height: 0;
}

.calendar-day-timeline-tick {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font-size: 0.5rem;
  font-weight: 500;
  color: #a3a3a3;
  white-space: nowrap;
  line-height: 1;
}

.calendar-day-timeline-track {
  position: relative;
  height: 100%;
  min-height: 0;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0.375rem;
  overflow: hidden;
}

.calendar-day-timeline-gridline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #f0f0f0;
  pointer-events: none;
}

.calendar-day-timeline-event {
  position: absolute;
  left: 0.2rem;
  right: 0.2rem;
  box-sizing: border-box;
  min-height: 1.1rem;
  padding: 0.12rem 0.28rem;
  background: #171717;
  color: #ffffff;
  border-radius: 0.25rem;
  overflow: hidden;
  z-index: 1;
}

.calendar-day-timeline-event--allday {
  background: #404040;
  border: 1px dashed #737373;
}

.calendar-day-timeline-event-title {
  margin: 0;
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-day-timeline-event-meta {
  margin: 0.05rem 0 0;
  font-size: 0.5rem;
  opacity: 0.88;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-day-timeline-event-delete {
  margin: 0.1rem 0 0;
  padding: 0;
  border: none;
  background: none;
  color: #fca5a5;
  font-family: inherit;
  font-size: 0.45rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.calendar-day-timeline-event-delete:hover {
  color: #ffffff;
  text-decoration: underline;
}

.calendar-loading {
  flex-shrink: 0;
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: #737373;
}

.calendar-aside-error {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.calendar-day--has-events:not(.calendar-day--selected) {
  background: #dcfce7;
  box-shadow: inset 0 0 0 1px #86efac;
}

.calendar-day--has-events:not(.calendar-day--selected) .calendar-day-num {
  font-weight: 600;
  color: #166534;
}

.calendar-day--has-events.calendar-day--today:not(.calendar-day--selected) {
  background: #bbf7d0;
  box-shadow: inset 0 0 0 1px #4ade80;
}

.calendar-day--has-events:hover:not(.calendar-day--selected) {
  background: #bbf7d0;
}

.calendar-day--muted.calendar-day--has-events:not(.calendar-day--selected) {
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}

.calendar-day--muted.calendar-day--has-events:not(.calendar-day--selected) .calendar-day-num {
  color: #15803d;
}

.calendar-day-dot {
  display: none;
}

.calendar-aside-events {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.calendar-aside-body .calendar-aside-hint {
  margin-top: 0;
}

.calendar-event-card {
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
}

.calendar-event-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
}

.calendar-event-desc {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #525252;
  line-height: 1.4;
}

.calendar-event-meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}

.calendar-event-delete {
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  color: #b91c1c;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.calendar-add-btn {
  width: 100%;
  margin-top: auto;
  padding: 0.65rem 1rem;
  border: 1px dashed #d4d4d4;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #171717;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.calendar-add-btn:hover {
  background: #f5f5f5;
  border-color: #a3a3a3;
}

.calendar-event-form {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.calendar-form-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.calendar-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #404040;
}

.calendar-form-field input,
.calendar-form-field textarea {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.4375rem;
}

.calendar-form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #525252;
}

.calendar-member-row {
  display: flex;
  gap: 0.35rem;
}

.calendar-member-row input {
  flex: 1;
}

.calendar-member-row button {
  padding: 0 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.4375rem;
  background: #f5f5f5;
  font-size: 1rem;
  cursor: pointer;
}

.calendar-member-list {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.calendar-member-list li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  background: #f5f5f5;
  border-radius: 0.35rem;
  font-size: 0.75rem;
}

.calendar-member-list button {
  border: none;
  background: none;
  cursor: pointer;
  color: #737373;
  font-size: 1rem;
  line-height: 1;
}

.calendar-form-actions {
  display: flex;
  gap: 0.5rem;
}

.calendar-form-cancel,
.calendar-form-submit {
  flex: 1;
  padding: 0.55rem;
  border-radius: 0.4375rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.calendar-form-cancel {
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #525252;
}

.calendar-form-submit {
  border: none;
  background: #171717;
  color: #fff;
}

.calendar-form-submit:disabled {
  opacity: 0.6;
}

/* —— Mobile chrome (header + bottom nav) —— */
.app-mobile-chrome {
  display: none;
}

.app-mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
  border-bottom: 1px solid #ebebeb;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.app-mobile-header-brand {
  min-width: 0;
}

.app-mobile-header-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #171717;
  line-height: 1.2;
}

.app-mobile-header-sub {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #737373;
}

.app-mobile-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.app-mobile-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.app-mobile-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 50;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.85rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.app-mobile-menu-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #171717;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-mobile-menu-email {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.8125rem;
  color: #737373;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-mobile-menu-logout {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #dc2626;
  border-radius: 0.5rem;
  background: #dc2626;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.app-mobile-menu-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  min-height: 3.5rem;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #ebebeb;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.app-mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.35rem;
  border-radius: 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #737373;
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}

.app-mobile-nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-mobile-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a3a3a3;
}

.app-mobile-nav-link--active {
  color: #171717;
  background: #f5f5f5;
}

.app-mobile-nav-link--active .app-mobile-nav-icon {
  color: #171717;
}

/* —— Phone / small tablet —— */
@media (max-width: 768px) {
  .app-mobile-chrome {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .app-shell {
    flex-direction: column;
  }

  .app-main {
    flex: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(3.25rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .app-page {
    padding: 1.25rem 1rem 1.5rem;
    max-width: none;
  }

  .app-page--fill {
    padding: 0.85rem 0.75rem 1rem;
  }

  .app-page-title {
    font-size: 1.3125rem;
  }

  .app-page-welcome {
    font-size: 1.4375rem;
  }

  .login-page {
    min-height: 100dvh;
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .login-brand-title {
    font-size: 1.75rem;
  }

  .login-brand-subtitle {
    font-size: 1rem;
  }

  .login-field input:not(.otp-input-cell) {
    font-size: 16px;
    min-height: 2.75rem;
  }

  .login-submit,
  .login-back {
    min-height: 2.75rem;
  }

  .events-page-header {
    margin-bottom: 1rem;
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .fravaer-table thead th,
  .fravaer-table tbody td {
    padding-right: 0.75rem;
  }

  .fravaer-add-btn {
    width: 100%;
    min-height: 2.75rem;
  }

  .ansatte-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ansatte-hire-btn {
    width: 100%;
    min-height: 2.75rem;
  }

  .fravaer-date-row {
    grid-template-columns: 1fr;
  }

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

  .home-profile-card {
    flex-direction: column;
  }

  .home-profile-avatar {
    width: 100%;
    min-height: 0;
    padding: 1.25rem;
  }

  .home-profile-body {
    padding: 1.15rem 1rem 1.25rem;
  }

  .home-profile-fields {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .home-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .messages-layout {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 8.5rem);
  }

  .messages-layout--chat-open .messages-sidebar {
    display: none;
  }

  .messages-layout:not(.messages-layout--chat-open) .messages-chat {
    display: none;
  }

  .messages-chat-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .messages-page {
    padding-bottom: 5rem;
  }

  .events-card {
    min-height: 0;
    padding: 1.25rem 1.15rem;
  }

  .events-card-join,
  .events-card-leave {
    min-height: 2.75rem;
  }

  .calendar-page-toolbar {
    margin-bottom: 0.75rem;
  }

  .calendar-toolbar-add {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
  }

  .calendar {
    gap: 0.75rem;
  }

  .calendar-card {
    padding: 0.85rem 0.65rem 0.75rem;
    border-radius: 0.75rem;
  }

  .calendar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
  }

  .calendar-nav {
    justify-content: space-between;
    width: 100%;
  }

  .calendar-nav-btn {
    width: 2.75rem;
    height: 2.75rem;
  }

  .calendar-today-btn {
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .calendar-month {
    font-size: 1.2rem;
  }

  .calendar-weekdays {
    gap: 0.2rem;
  }

  .calendar-weekday {
    font-size: 0.625rem;
    padding: 0.15rem 0;
  }

  .calendar-grid {
    gap: 0.2rem;
    grid-template-rows: repeat(6, minmax(2.35rem, 1fr));
  }

  .calendar-day {
    border-radius: 0.5rem;
    min-height: 2.35rem;
  }

  .calendar-day-num {
    font-size: 0.8125rem;
  }

  .calendar-aside {
    max-height: min(52vh, 22rem);
    padding: 0.75rem 0.65rem;
    border-radius: 0.75rem;
  }

  .calendar-day-timeline {
    min-height: 12rem;
  }

  .calendar-event-page {
    max-width: none;
  }

  .calendar-event-page-card {
    padding: 1rem;
  }

  .calendar-form-field input,
  .calendar-form-field textarea,
  .calendar-member-row input {
    font-size: 16px;
    min-height: 2.75rem;
  }

  .calendar-member-row button {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .calendar-form-cancel,
  .calendar-form-submit,
  .calendar-modal-close {
    min-height: 2.75rem;
  }

  .calendar-modal {
    align-items: flex-end;
    padding: 0;
  }

  .calendar-modal-panel {
    width: 100%;
    max-width: none;
    max-height: min(94dvh, 100%);
    border-radius: 1rem 1rem 0 0;
  }

  .calendar-modal-header {
    padding: 1rem 1rem 0.85rem;
  }

  .calendar-modal-body {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .calendar-member-dropdown {
    max-height: min(40vh, 280px);
  }
}

@media (max-width: 380px) {
  .calendar-weekday:nth-child(6),
  .calendar-weekday:nth-child(7) {
    font-size: 0.5625rem;
  }
}
