:root {
  --page-bg: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #fafafa;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.13);
  --accent: #0a84ff;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-bs-theme="dark"] {
  --page-bg: #000000;
  --surface: #1c1c1e;
  --surface-subtle: #242426;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #0a84ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

button,
a,
input,
select,
textarea {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.login-card {
  width: min(100%, 430px);
  padding: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.brand-mark,
.sidebar-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  background: #111;
  user-select: none;
  -webkit-user-drag: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 28px;
  border-radius: 13px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1,
.content-header h1 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.login-card h1 {
  font-size: clamp(2.1rem, 7vw, 3rem);
}

.login-intro {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.provider-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  opacity: 1;
}

.provider-button:not(:disabled):hover {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--text);
}

.provider-button:disabled {
  opacity: 0.48;
}

.provider-icon {
  display: inline-grid;
  width: 24px;
  margin-right: 12px;
  place-items: center;
  font-weight: 700;
}

.google-icon {
  font-family: Arial, sans-serif;
  font-size: 1.02rem;
}

.apple-icon {
  font-size: 0.75rem;
}

.local-login-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.local-login-panel summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  text-align: center;
}

.local-login-panel[open] summary {
  color: var(--text);
}

.dev-login-button,
.action-button {
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.login-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: center;
}

.clean-alert {
  margin-top: 20px;
  border: 0;
  border-radius: var(--radius-sm);
}

.login-form .form-control {
  min-height: 48px;
  background: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.login-form .form-control:focus {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

/* =========================================================
   APP LAYOUT
   ========================================================= */

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 26px 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  min-height: 0;
  margin-top: 42px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 0.94rem;
  font-weight: 530;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: var(--page-bg);
  color: var(--text);
}

.nav-item.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  background: var(--text);
  color: var(--surface);
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1;
}

.sidebar-user {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-settings-link {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-top: 9px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
}

.sidebar-settings-link:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.sidebar-settings-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-user strong {
  font-size: 0.9rem;
}

.sidebar-user span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-actions {
  display: grid;
  align-items: start;
  gap: 4px;
}

.sidebar-actions form {
  margin: 0;
}

.sidebar-theme-section {
  width: 100%;
}

.native-mobile-theme-section {
  display: none;
}

.sidebar-theme-section summary {
  padding: 10px 0 0;
  color: var(--muted);
  cursor: pointer;
  font-size: .82rem;
  list-style: none;
}

.sidebar-theme-section summary::-webkit-details-marker {
  display: none;
}

.sidebar-theme-section summary::after {
  float: right;
  content: "+";
}

.sidebar-theme-section[open] summary::after {
  content: "−";
}

.sidebar-theme-options {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.sidebar-theme-options button {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: .78rem;
  text-align: left;
}

.sidebar-theme-options button small {
  color: var(--muted);
  font-size: .68rem;
}

.sidebar-theme-options button.is-selected {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px var(--text);
}

.btn-link-clean {
  padding: 10px 0 0;
  background: none;
  color: var(--muted);
  border: 0;
  font-size: 0.82rem;
}

.btn-link-clean:hover {
  color: var(--text);
}

.content-area {
  min-width: 0;
  padding: 54px clamp(24px, 5vw, 76px);
}

.content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.content-header h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.content-header p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

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

.action-button {
  min-width: 130px;
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 42px;
}

.stat-card,
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.stat-card {
  padding: 24px;
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
}

.stat-card span {
  font-size: 0.84rem;
  font-weight: 560;
}

.stat-card strong {
  display: block;
  margin: 20px 0 10px;
  font-size: 2.4rem;
  letter-spacing: -0.04em;
}

.stat-card small {
  line-height: 1.35;
}

.content-card {
  padding: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.setup-list {
  display: grid;
  gap: 0;
  margin-top: 24px;
}

.setup-list > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.setup-list span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: var(--page-bg);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 650;
}

.setup-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.setup-list strong {
  color: var(--text);
}

/* =========================================================
   FORMS / MODALS
   ========================================================= */

.clean-modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.clean-modal .modal-header,
.clean-modal .modal-footer {
  border-color: var(--line);
}

/* Forms are often the direct child of .modal-content. Keep that wrapper in
   Bootstrap's flex layout so the modal body can become the scroll container. */
.clean-modal > form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.modal-dialog-scrollable .clean-modal > form {
  max-height: 100%;
  overflow: hidden;
}

.clean-modal > form > .modal-body {
  min-height: 0;
}

@media (max-width: 767.98px) {
  /* Use the visible mobile viewport and scroll only the modal body. This keeps
     the close/save buttons available in PWA mode and when the keyboard opens. */
  .modal {
    overflow: hidden;
  }

  .modal-content.clean-modal {
    max-height: calc(100vh - 1rem);
    max-height: calc(
      100dvh - max(0.5rem, env(safe-area-inset-top)) -
        max(0.5rem, env(safe-area-inset-bottom))
    );
    overflow: hidden;
  }

  .clean-modal > form {
    max-height: 100%;
    overflow: hidden;
  }

  .clean-modal > .modal-header,
  .clean-modal > .modal-footer,
  .clean-modal > form > .modal-header,
  .clean-modal > form > .modal-footer {
    flex: 0 0 auto;
  }

  .clean-modal > .modal-body,
  .clean-modal > form > .modal-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
}

.form-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.form-control,
.form-select {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
  border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--surface);
  color: var(--text);
  border-color: #7b7b80;
  box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.12);
}

[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%);
}

[data-bs-theme="dark"] .btn-dark {
  background: #f5f5f7;
  color: #111;
  border-color: #f5f5f7;
}

[data-bs-theme="dark"] .btn-light {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--line);
}

.form-error {
  min-height: 20px;
  margin-top: 12px;
  color: #d70015;
  font-size: 0.82rem;
}

.empty-state {
  max-width: 620px;
  margin-top: 40px;
}

.empty-state h2 {
  margin: 0 0 10px;
}

.empty-state > p:not(.eyebrow) {
  color: var(--muted);
}

/* =========================================================
   WORKFLOW
   ========================================================= */

.workflow-content {
  min-width: 0;
  overflow: hidden;
}

.workflow-header {
  align-items: center;
}

.board-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 34px 0 18px;
}

.board-toolbar label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.board-toolbar .form-select {
  width: auto;
  min-width: 230px;
  border-radius: var(--radius-sm);
}

.board-toolbar > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(285px, 320px);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 22px;
  scrollbar-width: thin;
}

.kanban-column {
  min-height: 220px;
  align-self: start;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 12px;
}

.kanban-column-header > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.kanban-column-header h2 {
  overflow: hidden;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-count {
  color: var(--muted);
  font-size: 0.76rem;
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
}

.icon-button:hover {
  background: var(--surface);
  color: var(--text);
}

.kanban-list {
  display: grid;
  min-height: 120px;
  align-content: start;
  gap: 9px;
}

.task-card {
  position: relative;
  width: 100%;
  padding: 15px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
}

.task-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.task-card strong {
  display: block;
  padding-right: 12px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.task-description {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.42;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.71rem;
}

.priority-dot {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 7px;
  height: 7px;
  background: #8e8e93;
  border-radius: 50%;
}

.priority-low {
  background: #8e8e93;
}

.priority-normal {
  background: #0a84ff;
}

.priority-high {
  background: #ff9f0a;
}

.priority-urgent {
  background: #ff453a;
}

.task-card-ghost {
  opacity: 0.35;
}

.task-card-chosen {
  border-color: var(--line-strong);
}

.task-card-drag {
  transform: rotate(1deg);
}

/* =========================================================
   NOTIFICATION BUTTON
   ========================================================= */

.notification-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 50%;
  text-decoration: none;
}

.notification-button:hover,
.notification-button:focus-visible {
  background: var(--surface-subtle);
  color: var(--text);
}

.notification-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.notification-button-icon {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.notification-button-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ff3b30;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-sizing: content-box;
}

/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

.mobile-header {
  display: none;
}

.event-mobile-back {
  display: none;
}

.event-mobile-back-space {
  display: none;
}

.mobile-menu-toggle,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px), (display-mode: standalone) and (pointer: coarse) {
  .app-shell {
    display: block;
    padding-top: 68px;
  }

  .mobile-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 68px;
    padding: 0 14px 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-menu-toggle {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 14px;
    padding: 0;
    background: transparent;
    color: var(--text);
    border: 0;
    text-align: left;
  }

  .mobile-menu-icon {
    display: grid;
    width: 22px;
    flex: 0 0 22px;
    gap: 4px;
  }

  .mobile-menu-icon span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    border-radius: 999px;
  }

  .mobile-menu-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    font-weight: 650;
  }

  .mobile-menu-brand .sidebar-logo {
    width: 32px;
    height: 32px;
  }

  .mobile-header .notification-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 1050;
    width: min(86vw, 330px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 24px 20px;
    padding:
      max(24px, env(safe-area-inset-top))
      20px
      max(20px, env(safe-area-inset-bottom));
    overflow: hidden;
    overscroll-behavior: contain;
    background: var(--surface);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.14);
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-header .notification-button {
    display: none;
  }

  .sidebar-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    background: var(--page-bg);
    color: var(--text);
    border: 0;
    border-radius: 50%;
    font-size: 1.65rem;
    font-weight: 300;
    line-height: 1;
  }

  .sidebar-close:hover {
    background: var(--surface-subtle);
  }

  .sidebar-nav {
    min-height: 0;
    flex: 1 1 auto;
    align-content: start;
    grid-template-columns: 1fr;
    margin-top: 38px;
    padding-bottom: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-user {
    display: block;
    min-width: 0;
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 18px;
    background: var(--surface);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1045;
    display: block;
    background: rgba(0, 0, 0, 0.32);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 220ms ease,
      visibility 220ms ease;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .content-area {
    padding: 36px 20px;
  }

  .content-header {
    align-items: flex-start;
  }

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

  .workflow-content {
    padding-right: 20px;
    padding-left: 20px;
  }

  .sidebar-actions {
    max-width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
    column-gap: 14px;
    row-gap: 0;
  }
}

@media (max-width: 650px) {
  .content-header,
  .workflow-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .action-button {
    display: inline-flex;
    min-width: 0;
    flex: 1;
    justify-content: center;
  }

  .board-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .board-toolbar .form-select {
    width: 100%;
  }

  .board-toolbar > span {
    white-space: normal;
  }

  .kanban-board {
    grid-auto-columns: minmax(275px, 88vw);
  }

  .content-card {
    padding: 23px;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 30px 24px;
    border-radius: 18px;
  }

  .action-button {
    display: none;
  }

  .header-actions .action-button {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   ARRANGEMENTSSENTER
   ========================================================= */
.event-switcher {
  display: grid;
  gap: 7px;
  margin-top: 28px;
  padding: 13px;
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 13px;
  text-decoration: none;
}

.event-switcher label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.event-switcher select {
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  border: 0;
  outline: 0;
  font-size: 0.91rem;
  font-weight: 650;
  text-overflow: ellipsis;
}

.event-switcher-status {
  color: var(--muted);
  font-size: 0.74rem;
}

.event-switcher-empty {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
}

.event-switcher + .sidebar-nav {
  margin-top: 22px;
}
.active-event-context {
  margin: 7px 0 0 !important;
  color: var(--accent) !important;
  font-size: 0.86rem;
}

/* =========================================================
   ENDRINGSLOGG (popup + side)
   ========================================================= */
.changelog-intro { margin: 0 0 16px; color: var(--muted); }
.changelog-section + .changelog-section { margin-top: 18px; }
.changelog-section h3 { margin: 0 0 8px; color: var(--muted); font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.changelog-section ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.changelog-section li { line-height: 1.45; }
.changelog-modal .modal-footer { gap: 8px; }
.changelog-modal .modal-footer .btn { flex: 1; }
.changelog-version { max-width: 760px; margin-top: 22px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.changelog-version > header { margin-bottom: 14px; }
.changelog-version > header h2 { margin: 0 0 4px; font-size: 1.3rem; }
.changelog-version > header span { color: var(--muted); font-size: .85rem; }
@media (max-width: 575.98px) {
  .changelog-modal .modal-header { padding-top: calc(16px + env(safe-area-inset-top)); }
  .changelog-modal .modal-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .changelog-version { padding: 18px; }
}

/* =========================================================
   MELD FRA OM FEIL
   ========================================================= */
.bug-report-files { display: flex; align-items: center; gap: 10px; margin-top: 14px; cursor: pointer; }
.bug-report-files small { color: var(--muted); font-size: .8rem; }
.bug-report-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bug-report-preview { position: relative; width: 84px; height: 84px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.bug-report-preview img { width: 100%; height: 100%; object-fit: cover; }
.bug-report-preview button { position: absolute; top: 4px; right: 4px; display: grid; width: 24px; height: 24px; place-items: center; padding: 0; color: #fff; background: rgba(0, 0, 0, .6); border: 0; border-radius: 50%; line-height: 1; }
.bug-report-note { margin: 14px 0 0; color: var(--muted); font-size: .82rem; }
.bug-report-done { padding: 40px 20px; text-align: center; }
.bug-report-done strong { display: block; margin-bottom: 6px; font-size: 1.3rem; }
.bug-report-done p { margin: 0; color: var(--muted); }
@media (max-width: 575.98px) {
  .bug-report-modal .modal-header { padding-top: calc(16px + env(safe-area-inset-top)); }
  .bug-report-modal .modal-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
.changelog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
/* Tekstknapp (ikke tannhjul – tannhjulet øverst er Innstillinger). Viser om varsel er på. */
.changelog-settings-button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; color: var(--text); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 650; white-space: nowrap; }
.changelog-subscribe-status { min-height: 1.2em; margin: 12px 0 0; color: var(--muted); font-size: .84rem; }

/* Innstillinger-popup (views/partials/settings-modal.ejs), brukes på alle sider. */
.client-settings-modal .modal-content { color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:20px; }
.client-settings-modal .modal-header { align-items:flex-start; padding:20px; border-color:var(--line); }
.client-settings-modal .modal-title { font-size:1.45rem; }
.client-settings-modal .modal-body { padding:20px; }
.client-settings-section summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:2px; cursor:pointer; list-style:none; }
.client-settings-section summary::-webkit-details-marker { display:none; }
.client-settings-section-copy strong,.client-settings-section-copy small { display:block; }
.client-settings-section-copy strong { font-size:1rem; }
.client-settings-section-copy small { margin-top:4px; color:var(--muted); font-size:.75rem; font-weight:500; }
.client-settings-chevron { width:9px; height:9px; flex:0 0 9px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transition:transform 160ms ease; }
.client-settings-section[open] .client-settings-chevron { transform:rotate(225deg); }
.client-settings-section { padding:13px 14px; background:var(--surface-subtle); border:1px solid var(--line); border-radius:12px; }
.client-settings-section-content { padding-top:12px; margin-top:12px; border-top:1px solid var(--line); }
.client-settings-section-content > p { margin:0 0 10px; color:var(--muted); font-size:.75rem; }
.client-settings-notification-group { margin-top:8px; }
.client-settings-admin { margin-top:18px; padding-top:18px; border-top:1px solid var(--line); }
.client-settings-admin a { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:13px 14px; color:var(--text); background:var(--surface-subtle); border:1px solid var(--line); border-radius:12px; text-decoration:none; }
.client-settings-admin strong,.client-settings-admin small { display:block; }
.client-settings-admin small { margin-top:3px; color:var(--muted); font-size:.72rem; }
.client-settings-admin a > span:last-child { color:var(--muted); font-size:1.5rem; line-height:1; }
.client-settings-toggle { position:relative; display:flex; align-items:center; justify-content:space-between; gap:16px; cursor:pointer; }
.client-settings-toggle > span:first-child strong,.client-settings-toggle > span:first-child small { display:block; }
.client-settings-toggle > span:first-child strong { font-size:.88rem; }
.client-settings-toggle > span:first-child small { margin-top:3px; color:var(--muted); font-size:.72rem; font-weight:500; }
.client-settings-toggle input { position:absolute; opacity:0; pointer-events:none; }
.client-settings-toggle-track { position:relative; width:48px; height:28px; flex:0 0 48px; background:var(--line); border-radius:999px; transition:background-color 160ms ease; }
.client-settings-toggle-track::after { content:""; position:absolute; top:3px; left:3px; width:22px; height:22px; background:#fff; border-radius:50%; box-shadow:0 1px 4px rgba(0,0,0,.2); transition:transform 160ms ease; }
.client-settings-toggle input:checked + .client-settings-toggle-track { background:#34c759; }
.client-settings-toggle input:checked + .client-settings-toggle-track::after { transform:translateX(20px); }
.client-settings-toggle input:focus-visible + .client-settings-toggle-track { outline:2px solid var(--text); outline-offset:3px; }
.client-theme-options { display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; padding:4px; background:var(--surface); border:1px solid var(--line); border-radius:10px; }
.client-theme-options button { padding:8px 4px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:.82rem; font-weight:600; }
.client-theme-options button.is-selected { color:var(--text); background:var(--surface-subtle); box-shadow:0 0 0 1px var(--line), 0 1px 3px rgba(0,0,0,.15); }
.client-settings-logout { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); }
.client-settings-logout button { width:100%; padding:12px; border:0; background:transparent; color:#d70015; font-weight:700; text-align:center; }
.client-settings-logout button:active { border-radius:10px; background:rgba(215,0,21,.08); }
@media (prefers-reduced-motion: reduce) { .client-settings-chevron,.client-settings-toggle-track,.client-settings-toggle-track::after { transition:none; } }
.client-settings-links { display:grid; gap:8px; margin-top:0; padding-top:0; border-top:0; }
.client-settings-device-group { margin-top:22px; }

/* Status på egen feilmelding (footer → #issueStatusModal) */
.issue-status-chip { display: inline-block; padding: 4px 10px; color: var(--muted); background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 650; }
.issue-status-chip[data-status="resolved"] { color: #248a3d; border-color: rgba(52, 199, 89, .4); }
.issue-status-chip[data-status="in_progress"] { color: #b06a00; border-color: rgba(255, 159, 10, .4); }
.issue-status-note { margin-top: 14px; }
.issue-status-note strong { display: block; margin-bottom: 4px; font-size: .9rem; }
.issue-status-note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Nyhet fra admin (footer → #announcementModal) */
.announcement-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Daglig gjennomgang av egne oppgaver (task-review.js) */
.task-review-modal .modal-title { overflow-wrap: anywhere; }
.task-review-lead { margin: 0; font-size: 1.02rem; }
.task-review-due { margin: 0 0 10px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.task-review-due.is-overdue { color: #d93025; }
.task-review-description { margin: 0 0 12px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-subtle); border-radius: 12px; font-size: .92rem; }
.task-review-warning { margin: 0 0 12px; padding: 10px 12px; color: #8a5300; background: rgba(255, 159, 10, .14); border-radius: 12px; font-size: .86rem; }
.task-review-note { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.task-review-note textarea { resize: vertical; }
.task-review-modal .form-error:empty { display: none; }
@media (max-width: 575.98px) {
  .task-review-modal .modal-header { padding-top: calc(16px + env(safe-area-inset-top)); }
}

/* Aktivitetsprikk på avatarer (partials/activity-dot.ejs): sist aktiv ≤7 d / 8–30 d / >30 d */
/* Midten av prikken på kanten av en rund avatar (45° på sirkelen ≈ 14,6 % inn fra hjørnet): halvparten utenfor. */
.activity-dot { position: absolute; top: calc(14.6% - 6px); right: calc(14.6% - 6px); width: 8px; height: 8px; background: #8e8e93; border: 2px solid var(--surface); border-radius: 50%; box-sizing: content-box; }
.activity-dot.is-available { background: #34c759; }
.activity-dot.is-limited { background: #ffcc00; }
.activity-dot.is-unavailable { background: #ff3b30; }
/* Avatarer som får aktivitetsprikk fra JS (CrewActivityDot) eller partialen. */
.mention-avatar, .chat-member-avatar, .chat-avatar { position: relative; }
/* Små avatarer (workflow-kort, 25 px): mindre prikk, midten fortsatt på kanten. */
.task-assignee { position: relative; }
.task-assignee .activity-dot { top: calc(14.6% - 4.5px); right: calc(14.6% - 4.5px); width: 5px; height: 5px; }
/* «X har ikke aktivert varsler» når man tagger noen uten pushvarsler (mentions.js). */
.mention-push-warning { display: inline-block; min-width: 0; max-width: 100%; overflow: hidden; padding: 4px 12px; color: #8a5300; background: rgba(255, 159, 10, .18); border: 1px solid rgba(255, 159, 10, .35); border-radius: 999px; font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mention-push-warning[hidden] { display: none; }
[data-bs-theme="dark"] .mention-push-warning { color: #ffd38a; background: rgba(255, 159, 10, .22); }
