:root {
  --ft-primary: #007bff;
  --ft-primary-rgb: 0, 123, 255;
  --ft-secondary: #6c757d;

  --app-bg: #edf2f7;
  --app-surface: rgba(255, 255, 255, 0.92);
  --app-surface-solid: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-border: rgba(15, 23, 42, 0.08);
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-shadow: 0 30px 70px rgba(15, 23, 42, 0.12);
  --app-shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.08);
  --app-radius-xl: var(--boows-default-border-container, 14px);
  --app-radius-lg: var(--boows-default-border-container, 14px);
  --app-radius-md: var(--boows-border-radius-button, 14px);
  --app-radius-sm: var(--boows-border-radius-button, 10px);
  --app-sidebar-width: 280px;
  --app-sidebar-collapsed-width: 88px;
  --app-header-height: 72px;

  --app-danger: #ef4444;

  /* Avatar online-status dot. Binary live presence: online or offline. */
  --app-presence-online: #22c55e;
  --app-presence-offline: var(--app-danger);

  /* Boows color overrides only */
  --boows-col-primary: var(--ft-primary);
  --boows-col-primary-rgb: var(--ft-primary-rgb);
  --boows-col-secondary: var(--ft-secondary);
  --boows-col-accent: color-mix(in srgb, var(--ft-primary) 18%, #ffffff);
  --boows-col-text: var(--app-text);
  --boows-col-text-rgb: 15, 23, 42;
  --boows-col-text-80: #1f2937;
  --boows-col-text-60: #64748b;
  --boows-col-text-40: #94a3b8;
  --boows-col-text-20: #e2e8f0;
  --boows-col-text-10: #f1f5f9;
  --boows-col-text-5: #f8fafc;
  --boows-col-bg: #f8fafc;
  --boows-col-border: #e2e8f0;
  --boows-col-primary-10: color-mix(in srgb, var(--boows-col-primary) 12%, #ffffff);
  --boows-col-primary-20: color-mix(in srgb, var(--boows-col-primary) 18%, #ffffff);
  --boows-col-primary-40: color-mix(in srgb, var(--boows-col-primary) 35%, #ffffff);
  --boows-col-primary-60: color-mix(in srgb, var(--boows-col-primary) 55%, #ffffff);
  --boows-col-primary-80: color-mix(in srgb, var(--boows-col-primary) 75%, #ffffff);
}

/* Ensure Outfit is always locally available, independent from Google Fonts API. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/outfit-v11-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/outfit-v11-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/outfit-v11-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/outfit-v11-latin-700.woff2') format('woff2');
}

* {
  box-sizing: border-box;
}

/* Font inheritance reset – native form elements ignore body font-family by default */
button,
input,
select,
textarea,
optgroup {
  font-family: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--app-font-family, 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 999px;
  filter: blur(0);
  z-index: -2;
  opacity: 0.6;
}

body::before {
  width: 52vw;
  height: 52vw;
  top: -18vw;
  left: -12vw;
  background: radial-gradient(circle at 30% 30%, rgba(var(--ft-primary-rgb), 0.2), rgba(255, 255, 255, 0));
}

body::after {
  width: 46vw;
  height: 46vw;
  bottom: -20vw;
  right: -10vw;
  background: radial-gradient(circle at 40% 40%, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0));
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* View Transitions */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: appFadeOut 0.25s ease both;
}

::view-transition-new(root) {
  animation: appFadeIn 0.35s ease both;
}

/* Keep the main chrome stable during transitions (reduces flicker, esp. mobile) */
::view-transition-old(app-header),
::view-transition-new(app-header),
::view-transition-old(app-sidebar),
::view-transition-new(app-sidebar),
::view-transition-old(app-bottom-nav),
::view-transition-new(app-bottom-nav) {
  animation: none;
}

/* Mobile layout breakpoint: keep desktop/tablet (>=901px) as true two-column layout */
@media (max-width: 900px) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

.app-wrapper {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  gap: 0;
  view-transition-name: app-shell;
  width: 100%;
  max-width: 100%;
}

/* Auth pages don't render a sidebar, so don't reserve the sidebar column */
body.auth-page .app-wrapper {
  grid-template-columns: 1fr;
}

body.auth-page.sidebar-collapsed .app-wrapper {
  grid-template-columns: 1fr;
}

/* Auth pages have no sidebar; keep content in the first (and only) grid column. */
body.auth-page .app-content {
  grid-column: 1;
}

/* Hide optional markers globally (requested: use hide_optional everywhere) */
.boows-form-optional {
  display: none !important;
}

/* Reduce the large card header feel – reference layouts use a simple title row */
body.app-auth .page-header {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

body.app-auth .page-title h1,
body.app-auth .app-content h1 {
  font-size: 1.7rem;
}

body.sidebar-collapsed .app-wrapper {
  grid-template-columns: var(--app-sidebar-collapsed-width) minmax(0, 1fr);
}

.app-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 1400;
  height: var(--app-header-height);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  backdrop-filter: blur(14px);
  view-transition-name: app-header;
}

/* Header toggle inherits sidebar-toggle base class but needs app-header styling */
.app-header .sidebar-toggle-header {
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-text);
  border: 1px solid var(--app-border);
}

html[data-theme="dark"] .app-header .sidebar-toggle-header {
  background: rgba(241, 245, 249, 0.06);
}

.app-header .sidebar-toggle-header:hover {
  transform: translateY(-1px);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-toggle-mobile {
  display: none;
}

/* Ensure the mobile sidebar toggle never appears in desktop mode (safety override). */
@media (min-width: 901px) {
  .sidebar-toggle-mobile {
    display: none !important;
  }
}

/* Flag helper used by the language switcher (independent of Boows phone field wrappers). */
.phone_flag {
  width: 20px;
  height: 15px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-color: transparent;
}

.phone_flag.phone-flag-svg {
  background-image: var(--flag-url);
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.header-logo {
  height: 30px;
  width: auto;
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-search-toggle {
  display: none;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--app-muted);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html[data-theme="dark"] .header-search-toggle {
  background: rgba(241, 245, 249, 0.06);
}

.header-search-field {
  position: relative;
  flex: 1;
}

.header-search-close {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--app-muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.header-search-input {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.65);
  color: var(--app-text);
  outline: none;
  transition: border-color var(--app-transition), box-shadow var(--app-transition), background var(--app-transition);
}

.header-search-input:focus {
  border-color: rgba(var(--ft-primary-rgb), 0.55);
  box-shadow: 0 0 0 4px rgba(var(--ft-primary-rgb), 0.18);
  background: rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] .header-search-input {
  background: rgba(241, 245, 249, 0.06);
}

html[data-theme="dark"] .header-search-input:focus {
  background: rgba(241, 245, 249, 0.10);
}

.header-search-results {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
  z-index: 350;
}

html[data-theme="dark"] .header-search-results {
  background: var(--app-surface-solid);
}

.header-search-group {
  padding: 0.35rem 0.35rem 0.55rem;
}

.header-search-group-title {
  padding: 0.55rem 0.75rem 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.header-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--app-radius-md);
  text-decoration: none;
  color: var(--app-text);
}

.header-search-item:hover,
.header-search-item.is-active {
  background: var(--app-surface-muted);
}

.header-search-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.header-search-item-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-search-item-subtitle {
  font-size: 0.85rem;
  color: var(--app-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-search-empty {
  padding: 0.85rem 0.9rem;
  color: var(--app-muted);
}

.header-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  line-height: 1.1;
  padding-right: 0.1rem;
}

.header-user-name {
  font-weight: 650;
  color: var(--app-text);
  font-size: 0.95rem;
}

.header-user-position {
  font-size: 0.78rem;
  color: var(--app-muted);
}

.header-user-caret {
  opacity: 0.7;
}

@media (max-width: 560px) {
  .header-user-meta,
  .header-user-caret {
    display: none;
  }
  .header-left {
    gap: 0.5rem;
  }
}

@media (max-width: 720px) {
  .header-search {
    flex: 0 0 auto;
    max-width: none;
  }

  .header-search-toggle {
    display: inline-flex;
  }

  .header-search-field {
    display: none;
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: calc(var(--app-header-height) + 0.5rem);
    z-index: 1200;
  }

  body.search-open .header-search-field {
    display: block;
  }

  body.search-open .header-search-close {
    display: inline-flex;
  }

  body.search-open .header-search-results {
    position: static;
    margin-top: 0.5rem;
    max-height: 60vh;
    overflow: auto;
  }

  .header-search-input {
    padding-right: 3rem;
  }
}

.mobile-profile-menu {
  position: relative;
  display: block;
}

.mobile-profile-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.mobile-profile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--app-border);
  background: rgba(148, 163, 184, 0.18);
  display: grid;
  place-items: center;
}

.mobile-profile-avatar--empty {
  color: var(--app-muted);
}

.mobile-profile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 220px;
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
  padding: 0.85rem;
  z-index: 260;
  display: flex;
  gap: 0.6rem;
  flex-direction: column;
}

.mobile-profile-links {
  display: grid;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .mobile-profile-panel {
    position: fixed;
    top: var(--app-header-height);
    right: 0;
    bottom: 0;
    left: auto;
    width: min(85vw, 320px);
    transform: translateX(100%);
    opacity: 1;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--app-border);
    padding: 1.5rem 1.25rem;
    max-height: calc(100vh - var(--app-header-height));
    overflow: auto;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1300;
    height: 100vh;
  }

  .mobile-profile-menu[open] .mobile-profile-panel {
    transform: translateX(0);
  }

  .mobile-profile-backdrop {
    display: none;
    position: fixed;
    inset: var(--app-header-height) 0 0 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1250;
  }

  .mobile-profile-menu[open] .mobile-profile-backdrop {
    display: block;
    height: 100vh;
  }
}

.mobile-profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--app-text);
}

.mobile-profile-position {
  font-size: 0.82rem;
  color: var(--app-muted);
  margin-top: -0.35rem;
}

.mobile-profile-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--app-radius-md);
  text-decoration: none;
  color: var(--app-text);
  background: rgba(15, 23, 42, 0.04);
  font-weight: 600;
}

.mobile-profile-link span {
  display: inline-flex;
  align-items: center;
}

.mobile-profile-badge,
.header-avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  background: var(--app-danger);
  color: #fff;
  margin-left: auto;
}

.mobile-profile-badge[hidden],
.header-avatar-badge[hidden] {
  display: none !important;
}

.header-avatar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  margin-left: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.68rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.nav-badge {
  margin-left: auto;
}

.mobile-profile-link .material-icons {
  font-size: 1.1rem;
  color: var(--app-muted);
}

.mobile-profile-link:hover {
  background: rgba(15, 23, 42, 0.07);
}

.notification-list,
.message-thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notification-card,
.message-thread-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: var(--app-radius-md);
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
  text-decoration: none;
  color: inherit;
}

.notification-card.is-unread {
  border-color: rgba(var(--ft-primary-rgb), 0.4);
  background: rgba(var(--ft-primary-rgb), 0.08);
}

.notification-card.is-clickable {
  cursor: pointer;
}

.notification-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.notification-group {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.notification-body {
  font-size: 0.92rem;
  color: var(--app-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.message-thread-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--app-border);
  text-align: left;
  cursor: pointer;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  min-height: 72px;
  border-radius: var(--app-radius-md);
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.message-thread-card:hover {
  border-color: rgba(var(--ft-primary-rgb), 0.3);
  box-shadow: 0 10px 24px rgba(var(--ft-primary-rgb), 0.12);
}

.message-thread-card.is-active {
  border-color: rgba(var(--ft-primary-rgb), 0.42);
  background: rgba(var(--ft-primary-rgb), 0.08);
}

.message-thread-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 44px;
  background: rgba(var(--ft-primary-rgb), 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-thread-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-thread-avatar-placeholder {
  color: var(--ft-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-thread-avatar-placeholder .material-icons {
  font-size: 1.2rem;
}

.message-thread-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.message-thread-main--expanded {
  min-width: 0;
  flex: 1 1 auto;
}

.message-thread-topline {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.message-thread-title {
  font-weight: 700;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-thread-preview {
  font-size: 0.82rem;
  color: var(--app-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-thread-meta {
  font-size: 0.8rem;
  color: var(--app-muted);
  flex-shrink: 0;
}

.message-thread-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  overflow: hidden;
  border-radius: var(--app-radius-lg);
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
}

.message-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1rem;
}

.message-sidebar-pane {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 74vh;
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
}

.message-main-pane {
  display: flex;
  flex-direction: column;
  min-height: 74vh;
}

.message-empty-state {
  min-height: 58vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  color: var(--app-muted);
}

.message-empty-state[hidden] {
  display: none !important;
}

.message-empty-state .material-icons {
  font-size: 2.2rem;
  color: rgba(var(--ft-primary-rgb), 0.8);
}

.message-thread-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  flex: 1 1 auto;
}

.message-thread-area[hidden] {
  display: none !important;
}

.message-thread-header-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.45rem;
  border-radius: 12px;
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
}

.message-thread-back {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.message-thread-topbar .message-thread-call {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: var(--ft-primary);
  text-decoration: none;
}

.message-thread-topbar .message-thread-call[hidden] {
  display: none !important;
}

.message-thread-header-bar h2 {
  margin: 0;
  font-size: 1.05rem;
}

.message-start-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.message-thread-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.message-thread-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(var(--ft-primary-rgb), 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-thread-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-thread-header-avatar span {
  color: var(--ft-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-thread-header-text {
  min-width: 0;
  flex: 1 1 auto;
}

.message-thread-header-text h1 {
  margin: 0;
}

.message-thread-header-text h2 {
  color: var(--app-text);
}

.message-thread-header-text .page-subtitle {
  color: var(--app-muted);
}

.message-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 60vh;
  min-height: 42vh;
  overflow-y: auto;
  padding: 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0) 34%),
    radial-gradient(circle at 78% 72%, rgba(var(--ft-primary-rgb), 0.1) 0, rgba(var(--ft-primary-rgb), 0) 30%);
}

.message-row {
  display: flex;
}

.message-row.is-own {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(78%, 560px);
  padding: 0.62rem 0.8rem 0.5rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--app-border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: var(--app-text);
}

.message-row.is-own .message-bubble {
  background: rgba(var(--ft-primary-rgb), 0.12);
  border-color: rgba(var(--ft-primary-rgb), 0.3);
}

.message-sender {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.22rem;
  color: rgba(15, 23, 42, 0.82);
  letter-spacing: 0.01em;
}

.message-row.is-own .message-sender {
  color: rgba(15, 23, 42, 0.82);
}

.message-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.message-meta-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  width: 100%;
  margin-top: 0.2rem;
}

.message-time {
  font-size: 0.72rem;
  color: var(--app-muted);
  margin-top: 0;
}

.message-read-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-muted);
}

.message-read-state .material-icons {
  font-size: 0.9rem;
}

.message-read-state.is-read {
  color: #38bdf8;
}

.message-thread-load {
  align-self: center;
  margin: 0.1rem auto 0.25rem;
  border-radius: 999px;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.message-thread-composer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.38rem;
  position: sticky;
  bottom: 0;
  z-index: 2;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  margin: 0;
  padding: 0;
}

.message-thread-composer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.38rem;
  width: 100%;
}

.message-thread-composer-main[hidden] {
  display: none !important;
}

.message-thread-composer-input {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
}

.message-composer-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.message-composer-tools .boows-submit,
.message-composer-tools .boows-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  border: 0;
  background: #d43b3b;
  color: #ffffff;
}

.message-composer-tools .boows-submit[hidden] {
  display: none !important;
}

.message-composer-tools [data-media-clear] {
  min-width: 32px;
  width: 32px;
  height: 32px;
}

.message-thread-composer .boows-container,
.message-thread-composer .boows-input-field,
.message-thread-composer .boows-input {
  flex: 1 1 auto;
  margin: 0;
}

.message-composer-input-field,
.message-thread-composer-input .boows-input-inner-box,
.message-thread-composer-input .boows-input-wrapper {
  width: 100%;
  max-width: none;
}

.message-thread-composer .boows-input-wrapper input {
  min-height: var(--boows-input-height, 44px);
  height: var(--boows-input-height, 44px);
  max-height: var(--boows-input-height, 44px);
  padding-right: 2.35rem;
}

.message-thread-composer .message-send-btn,
.message-thread-composer .boows-submit,
.message-thread-composer .boows-btn {
  min-width: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 auto;
}

.message-thread-composer-input .boows-input-wrapper .field-suffix {
  min-width: 2rem;
  max-width: 2rem;
  width: 2rem;
  top: 0;
  bottom: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  background: transparent;
  color: var(--app-muted);
  padding: 0;
}

.message-input-suffix-btn {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-input-suffix-btn .material-icons {
  font-size: 1rem;
}

.message-primary-action {
  background: #d43b3b;
  border-color: transparent;
  color: #fff;
}

.message-voice-send {
  background: var(--ft-primary);
  border-color: transparent;
  color: #fff;
}

.message-primary-action .material-icons,
.message-voice-send .material-icons {
  font-size: 1.1rem;
}

.message-voice-capture {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.message-voice-capture[hidden] {
  display: none !important;
}

.message-voice-status {
  flex: 1 1 auto;
  min-height: 40px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.65rem;
}

.message-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e53935;
  animation: message-recording-pulse 1s ease-in-out infinite;
}

.message-voice-duration {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--app-text);
}

.message-voice-toggle.is-recording .material-icons {
  animation: message-recording-pulse 1s ease-in-out infinite;
}

.message-pending-media {
  border: 1px dashed rgba(var(--ft-primary-rgb), 0.4);
  background: rgba(var(--ft-primary-rgb), 0.08);
  border-radius: var(--app-radius-sm);
  padding: 0.32rem;
  color: var(--app-text);
  font-size: 0.85rem;
}

.message-pending-media.is-image {
  display: block;
}

.message-pending-media-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
}

.message-pending-media-thumb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.62);
}

.message-pending-media-thumb-icon .material-icons {
  font-size: 1.15rem;
}

.message-pending-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 64px));
  gap: 0.35rem;
}

.message-pending-media-count {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--app-muted);
  text-align: right;
}

.message-pending-media-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.message-pending-media-head span {
  font-size: 0.8rem;
  opacity: 0.82;
}

.message-pending-media-preview {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
}

.message-pending-media-preview-image,
.message-pending-media-preview-video {
  max-width: min(320px, 60vw);
  height: auto;
}

.message-pending-media-thumb .message-pending-media-preview-image {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.message-pending-media-thumb .message-pending-media-preview-video {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.message-pending-media-preview-audio {
  max-width: min(320px, 60vw);
}

.message-empty-list {
  color: var(--app-muted);
  margin: 0.5rem 0;
  text-align: center;
}

.message-media {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  margin-bottom: 0.35rem;
}

.message-media-image,
.message-media-video {
  max-width: min(320px, 60vw);
  height: auto;
}

.message-media-image {
  cursor: zoom-in;
}

.message-media-audio {
  width: min(220px, 58vw);
  max-width: min(220px, 58vw);
  height: 34px;
  border-radius: 999px;
}

.message-media-file {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
  background: #ffffff;
}

.message-media-file .material-icons {
  font-size: 1rem;
}

.message-media-file span {
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: none;
}

.message-attachment-overlay.is-open {
  display: block;
}

.message-attachment-overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  background: rgba(2, 8, 23, 0.56);
}

.message-attachment-sheet {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(var(--app-header-height) * 0 + 0.8rem);
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  padding: 0.85rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.message-attachment-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.message-attachment-item {
  border: 1px solid var(--app-border);
  background: #f8fafc;
  color: var(--app-text);
  border-radius: 14px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
}

.message-attachment-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--ft-primary-rgb), 0.2);
}

.message-attachment-item .material-icons {
  font-size: 1.05rem;
}

body.message-attachment-open {
  overflow: hidden;
}

@keyframes message-recording-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.message-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(2, 8, 23, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.message-media-viewer.is-open {
  display: flex;
}

.message-media-viewer[hidden] {
  display: none !important;
}

.message-media-viewer-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
}

.message-media-viewer-image {
  max-width: min(94vw, 1300px);
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 20px 80px rgba(2, 6, 23, 0.55);
}

body.message-viewer-open {
  overflow: hidden;
}

html[data-theme="dark"] .message-thread-panel {
  background: #0b121a;
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .message-sidebar-pane {
  background: #0d141d;
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .message-thread-header-bar {
  background: #0d141d;
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .message-thread-title {
  color: #e2e8f0;
}

html[data-theme="dark"] .message-thread-preview,
html[data-theme="dark"] .message-thread-meta,
html[data-theme="dark"] .message-thread-header-text .page-subtitle {
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme="dark"] .message-thread-header-text h2 {
  color: #e2e8f0;
}

html[data-theme="dark"] .message-thread-messages {
  background-color: #0f1720;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(148, 163, 184, 0.09) 0, rgba(148, 163, 184, 0) 34%),
    radial-gradient(circle at 78% 72%, rgba(var(--ft-primary-rgb), 0.12) 0, rgba(var(--ft-primary-rgb), 0) 30%);
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .message-bubble {
  background: #1b2733;
  border-color: rgba(148, 163, 184, 0.26);
}

html[data-theme="dark"] .message-row.is-own .message-bubble {
  background: rgba(var(--ft-primary-rgb), 0.26);
  border-color: rgba(var(--ft-primary-rgb), 0.52);
}

html[data-theme="dark"] .message-thread-composer {
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .message-composer-tools .boows-submit,
html[data-theme="dark"] .message-composer-tools .boows-btn {
  border-color: transparent;
  background: #d43b3b;
  color: #ffffff;
}

html[data-theme="dark"] .message-thread-composer textarea,
html[data-theme="dark"] .message-thread-composer .boows-form-control,
html[data-theme="dark"] .message-voice-status {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
}

html[data-theme="dark"] .message-thread-composer .boows-input-wrapper input {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
}

html[data-theme="dark"] .message-thread-composer-input .boows-input-wrapper .field-suffix,
html[data-theme="dark"] .message-input-suffix-btn {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .message-thread-card {
  background: #121b26;
}

html[data-theme="dark"] .message-thread-card.is-active {
  background: rgba(var(--ft-primary-rgb), 0.22);
}

html[data-theme="dark"] .message-pending-media {
  background: rgba(var(--ft-primary-rgb), 0.16);
}

html[data-theme="dark"] .message-pending-media-thumb {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.85);
}

html[data-theme="dark"] .message-pending-media-thumb-icon {
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme="dark"] .message-media {
  border-color: rgba(148, 163, 184, 0.26);
}

html[data-theme="dark"] .message-sender {
  color: rgba(226, 232, 240, 0.84);
}

html[data-theme="dark"] .message-time,
html[data-theme="dark"] .message-read-state {
  color: rgba(203, 213, 225, 0.78);
}

html[data-theme="dark"] .message-media-file {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.38);
}

html[data-theme="dark"] .message-attachment-sheet {
  background: #0f1720;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 24px 48px rgba(2, 8, 23, 0.38);
}

html[data-theme="dark"] .message-attachment-item {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.68);
  color: #e2e8f0;
}

body.layout-chat-fullscreen .app-wrapper {
  grid-template-columns: 1fr;
}

body.layout-chat-fullscreen .app-sidebar,
body.layout-chat-fullscreen .sidebar-overlay {
  display: none !important;
}

body.layout-chat-fullscreen .app-content {
  padding: 0;
  gap: 0;
  min-height: 100vh;
}

body.layout-chat-fullscreen .message-workspace {
  grid-template-columns: 1fr;
  gap: 0;
}

body.layout-chat-fullscreen .message-main-pane {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  min-height: 100vh;
}

body.layout-chat-fullscreen .message-thread-area {
  gap: 0;
  min-height: 100vh;
}

body.layout-chat-fullscreen .message-thread-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

body.layout-chat-fullscreen .message-thread-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

body.layout-chat-fullscreen .message-thread-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
}

body.layout-chat-fullscreen .message-thread-composer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

body.layout-chat-fullscreen .bottom-tabbar {
  display: none !important;
}

@media (min-width: 901px) {
  body.layout-chat-fullscreen .message-thread-back-link {
    display: none;
  }
}

@media (max-width: 1024px) {
  .message-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-sidebar-pane,
  .message-main-pane {
    min-height: 0;
  }

  body.layout-chat-fullscreen .message-sidebar-pane {
    display: none !important;
  }

  .message-workspace:not(.has-active-thread) .message-main-pane {
    display: none;
  }

  .message-workspace.has-active-thread .message-sidebar-pane {
    display: none;
  }

  .message-workspace.has-active-thread .message-main-pane {
    display: flex;
  }

  .message-main-pane {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .message-thread-area {
    gap: 0;
    min-height: calc(100vh - var(--app-header-height) - 1.25rem);
  }

  .message-thread-header-bar {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-solid);
    backdrop-filter: blur(8px);
  }

  .message-thread-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .message-thread-header-text h2 {
    font-size: 0.98rem;
    line-height: 1.2;
    margin: 0;
  }

  .message-thread-header-text .page-subtitle {
    margin-top: 0.1rem;
    font-size: 0.76rem;
    line-height: 1.2;
  }

  .message-thread-header-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .message-thread-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 0.65rem;
    background-color: #f8fafc;
    background-image:
      radial-gradient(circle at 24% 18%, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0) 34%),
      radial-gradient(circle at 80% 72%, rgba(var(--ft-primary-rgb), 0.14) 0, rgba(var(--ft-primary-rgb), 0) 32%);
  }

  .message-bubble {
    max-width: min(86%, 520px);
    padding: 0.56rem 0.72rem;
  }

  .message-thread-composer {
    position: sticky;
    bottom: 0;
    z-index: 12;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    gap: 0.28rem;
  }

  .message-thread-composer-input {
    flex: 1 1 0%;
    min-width: 0;
  }

  .message-thread-composer-main {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .message-composer-tools {
    gap: 0.16rem;
  }

  .message-composer-tools .boows-submit,
  .message-composer-tools .boows-btn,
  .message-thread-composer .boows-submit,
  .message-thread-composer .boows-btn {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    padding: 0;
  }

  .message-composer-tools [data-media-clear] {
    min-width: 28px;
    width: 28px;
    height: 28px;
  }

  .message-composer-tools .boows-submit .material-icons,
  .message-composer-tools .boows-btn .material-icons,
  .message-thread-composer .boows-submit .material-icons,
  .message-thread-composer .boows-btn .material-icons {
    font-size: 1.05rem;
  }

  .message-thread-composer .boows-input-wrapper input {
    min-height: var(--boows-input-height, 42px);
    height: var(--boows-input-height, 42px);
    max-height: var(--boows-input-height, 42px);
    padding-right: 2.2rem;
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .message-thread-composer-input .boows-input-wrapper .field-suffix {
    min-width: 1.8rem;
    max-width: 1.8rem;
    width: 1.8rem;
  }

  .message-voice-capture {
    gap: 0.28rem;
  }

  .message-voice-status {
    min-height: 34px;
  }

  .message-pending-media {
    margin: 0.15rem 0.35rem;
  }

  .message-pending-media-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .message-pending-media-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 52px));
  }

  .message-attachment-sheet {
    left: 0.5rem;
    right: 0.5rem;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    padding: 0.72rem;
  }

  .message-attachment-sheet-grid {
    gap: 0.5rem;
  }

  html[data-theme="dark"] .message-thread-header-bar {
    background: #0d141d;
    border-color: rgba(148, 163, 184, 0.24);
  }

  html[data-theme="dark"] .message-thread-messages {
    background-color: #0f1720;
    background-image:
      radial-gradient(circle at 24% 18%, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0) 34%),
      radial-gradient(circle at 80% 72%, rgba(var(--ft-primary-rgb), 0.14) 0, rgba(var(--ft-primary-rgb), 0) 32%);
  }

  html[data-theme="dark"] .message-thread-composer {
    background: transparent;
    border-color: transparent;
  }
}

.mobile-profile-install {
  background: linear-gradient(135deg, rgba(var(--ft-primary-rgb), 0.15), rgba(var(--ft-primary-rgb), 0.05));
  border: 1px solid rgba(var(--ft-primary-rgb), 0.25);
}

.mobile-profile-logout {
  margin: 0;
}

.app-sidebar {
  position: sticky;
  top: var(--app-header-height);
  height: calc(100vh - var(--app-header-height));
  padding: 1.5rem 1.25rem;
  background: linear-gradient(180deg, #0f2438 0%, #0b1622 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  view-transition-name: app-sidebar;
}

body.sidebar-collapsed .app-sidebar {
  padding: 1.5rem 0.75rem;
}

.app-sidebar { grid-column: 1; }
.app-content { grid-column: 2; min-width: 0; }

.sidebar-overlay {
  display: none;
}

@media (max-width: 900px) {
  .app-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(90vw, 340px);
    transform: translateX(-110%);
    transition: transform var(--app-transition);
    z-index: 1200;
    padding-top: 1rem;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1100;
    display: none;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .sidebar-toggle-desktop {
    display: none !important;
  }

  .sidebar-toggle-mobile {
    display: inline-flex;
  }

  .app-content {
    grid-column: 1;
    padding: 1rem 0.75rem 1.5rem;
  }
}

.app-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.12), transparent 55%);
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 1rem;
  position: relative;
  z-index: 1;
}

.sidebar-brand-text {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sidebar-collapsed .sidebar-brand-text {
  display: none;
}

/* Compact UI tools when we use Boows Select */
.ui-tools .boows-input-field {
  margin: 0;
}

.ui-tools .boows-input-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--app-muted);
  margin-bottom: 0.25rem;
}

.ui-tools .boows-container {
  width: 100%;
}

/* Phone DC select: allow wrapping and ensure flag/prefix render nicely */
.use-native-on-mobile-alternative .boows-select-list .boows-select-item .item-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  white-space: normal;
}

.use-native-on-mobile-alternative .phone_flag {
  flex: 0 0 auto;
}

/* PWA install banner */
.pwa-install-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(92vw, 560px);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-xl);
  box-shadow: var(--app-shadow-soft);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 1200;
  backdrop-filter: blur(14px);
}

.pwa-install-text {
  font-weight: 700;
  color: var(--app-text);
  font-size: 0.92rem;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pwa-install-btn {
  border: 1px solid rgba(var(--ft-primary-rgb), 0.35);
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: var(--app-text);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.pwa-install-dismiss {
  border: none;
  background: transparent;
  color: var(--app-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* PWA update banner */
.pwa-update-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(92vw, 480px);
  background: linear-gradient(135deg, var(--ft-primary) 0%, color-mix(in srgb, var(--ft-primary) 80%, #000) 100%);
  border-radius: var(--app-radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 1500;
  animation: pwa-update-slide-in 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes pwa-update-slide-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.pwa-update-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-update-icon .material-icons {
  color: #fff;
  font-size: 1.3rem;
}

.pwa-update-text {
  flex: 1;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.pwa-update-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pwa-update-btn {
  border: none;
  background: #fff;
  color: var(--ft-primary);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pwa-update-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-update-dismiss {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.pwa-update-dismiss:hover {
  color: #fff;
}

.sidebar-logo {
  height: auto;
}

.sidebar-logo--full {
  max-width: 160px;
  display: block;
}

.sidebar-logo--icon {
  display: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: var(--boows-radius-card, 24px);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem;
}

body.sidebar-collapsed .sidebar-logo--full {
  display: none;
}

body.sidebar-collapsed .sidebar-logo--icon {
  display: block;
}

.sidebar-toggle {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--boows-radius-button, 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.25rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--app-radius-md);
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.nav-icon {
  font-size: 1.2rem;
  opacity: 0.8;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0.7rem;
}

body.sidebar-collapsed .nav-item .nav-text,
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .sidebar-version {
  display: none;
}

body.sidebar-collapsed .nav-item .nav-badge {
  display: none;
}

body.sidebar-collapsed .nav-item .nav-icon {
  font-size: 1.35rem;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(var(--ft-primary-rgb), 0.4) 0%, rgba(var(--ft-primary-rgb), 0.15) 100%);
  box-shadow: 0 12px 24px rgba(var(--ft-primary-rgb), 0.2);
}

/* Settings submenu (no bullet marks) */
.nav-submenu {
  display: grid;
  gap: 0.35rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding-left: 0;
  border-left: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
}

.nav-submenu.is-open {
  max-height: 1000px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  margin: 0.25rem 0 0.75rem;
  padding-left: 0.85rem;
  padding-right: 0.35rem;
  margin-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: visible;
}

.nav-subitem {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.nav-submenu-nested {
  display: grid;
  gap: 0.3rem;
}

.nav-submenu-nested.is-open {
  margin: 0.15rem 0 0.35rem;
  margin-left: 0.45rem;
  padding-left: 0.7rem;
  max-height: min(36vh, 240px);
}

.nav-subitem-level2 {
  font-size: 0.84rem;
  padding-left: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

body.sidebar-collapsed .nav-submenu.is-open {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

body.sidebar-collapsed .nav-submenu-nested.is-open {
  margin-left: 0;
  padding-left: 0;
}

.contact-channels-builder {
  display: grid;
  gap: 1rem;
}

.contact-channels-rows {
  display: grid;
  gap: 0.85rem;
}

.contact-channel-row.is-hidden {
  display: none;
}

.contact-channel-entry-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: var(--ft-primary);
}

.contact-channel-entry-title {
  font-weight: 600;
}

.contact-channel-entry-grid {
  display: grid;
  grid-template-columns: auto minmax(180px, 28%) minmax(280px, 1fr) auto;
  grid-template-areas: "icon label value delete";
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.contact-channel-entry-icon { grid-area: icon; }
.contact-channel-label-field { grid-area: label; }

.contact-channel-value-wrap.is-hidden {
  display: none;
}

.contact-channel-value-wrap {
  grid-area: value;
  grid-column: 3;
}

.contact-channel-remove-icon {
  grid-area: delete;
  grid-column: 4;
}

.contact-channel-remove-icon .boows-btn,
.contact-channel-remove-icon.boows-btn {
  min-width: 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}

.contact-channel-picker-popup h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

.contact-channel-type-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.contact-channel-type-card {
  border: 1px solid rgba(var(--ft-primary-rgb), 0.18);
  background: #fff;
  border-radius: 12px;
  min-height: 64px;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.contact-channel-type-card:hover {
  border-color: rgba(var(--ft-primary-rgb), 0.5);
}

.contact-channel-type-card.is-selected {
  border-color: rgba(var(--ft-primary-rgb), 0.9);
  box-shadow: 0 0 0 2px rgba(var(--ft-primary-rgb), 0.15);
  background: rgba(var(--ft-primary-rgb), 0.08);
}

.contact-channel-type-card-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: var(--ft-primary);
}

.contact-channel-type-card-label {
  font-weight: 600;
}

@media (max-width: 760px) {
  .contact-channel-entry-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: flex-start;
  }

  .contact-channel-entry-icon {
    order: 1;
    flex: 0 0 2rem;
  }

  .contact-channel-label-field {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
  }

  .contact-channel-remove-icon {
    order: 3;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .contact-channel-value-wrap {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.1rem;
  }

  .contact-channel-value-wrap .boows-container,
  .contact-channel-value-wrap .boows-input-wrapper,
  .contact-channel-value-wrap .boows-input-field {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .contact-channel-entry-grid {
    gap: 0.5rem;
  }

  .contact-channel-remove-icon {
    align-self: flex-start;
    margin-top: 0;
  }

  .contact-channel-entry-grid .boows-input-field {
    margin-bottom: 0;
  }
}

@media (max-width: 1100px) {
  .contact-channel-value-wrap,
  .contact-channel-remove-icon {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .contact-channel-type-grid {
    grid-template-columns: 1fr;
  }
}

/* === User Profile Modern === */
.user-profile {
  display: grid;
  gap: 0;
  min-height: calc(100vh - var(--app-header-height) - 3rem);
  margin: -0.75rem;
  margin-top: -0.9rem;
}

.upm-hero {
  background: linear-gradient(135deg, var(--ft-primary) 0%, color-mix(in srgb, var(--ft-primary) 70%, #000) 100%);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.upm-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.upm-avatar-wrap {
  position: relative;
  display: inline-block;
}

.upm-avatar {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.upm-avatar.upm-avatar--empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
}

.upm-avatar.upm-avatar--empty .material-icons {
  font-size: 40px;
}

.upm-status {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 2px solid var(--ft-primary);
}

.upm-status--active {
  background: #22c55e;
  color: #fff;
}

.upm-status--inactive {
  background: #ef4444;
  color: #fff;
}

.upm-status--pending {
  background: #f59e0b;
  color: #fff;
}

.upm-status--available {
  background: #22c55e;
  color: #fff;
}

.upm-status--not_sv_registered,
.upm-status--unavailable {
  background: #64748b;
  color: #fff;
}

.upm-status--sick {
  background: #1d4ed8;
  color: #fff;
}

.upm-status--vacation,
.upm-status--time_off,
.upm-status--parental_leave,
.upm-status--paternity_month,
.upm-status--special_leave_unpaid {
  background: #c2410c;
  color: #fff;
}

.upm-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0.25rem 0 0;
}

.upm-role {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* Quick Contact Buttons */
.upm-quick-contact {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.5rem 2rem;
  background: var(--app-surface-solid);
  border-left: 1px solid var(--app-border);
  border-right: 1px solid var(--app-border);
}

.upm-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.upm-contact-btn:hover {
  transform: translateY(-1px);
}

.upm-contact-btn .material-icons {
  font-size: 20px;
}

.upm-contact-btn--phone {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.upm-contact-btn--phone:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.upm-contact-btn--whatsapp {
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.upm-contact-btn--whatsapp:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.upm-contact-btn--email {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.upm-contact-btn--email:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Details Section */
.upm-details {
  padding: 1.5rem 2rem;
  background: var(--app-surface-solid);
  border-left: 1px solid var(--app-border);
  border-right: 1px solid var(--app-border);
}

.upm-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.upm-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
}

.upm-detail-item--wide {
  grid-column: 1 / -1;
}

.upm-detail-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(var(--ft-primary-rgb), 0.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.upm-detail-icon .material-icons {
  font-size: 20px;
  color: var(--ft-primary);
}

.upm-detail-content {
  min-width: 0;
}

.upm-detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.upm-detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--app-text);
  word-break: break-word;
}

.upm-channel-list {
  display: grid;
  gap: 0.25rem;
}

.upm-channel-item {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--app-text);
}

/* Actions */
.upm-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.25rem 2rem;
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
  border-radius: 0 0 var(--app-radius-lg) var(--app-radius-lg);
}

@media (max-width: 600px) {
  .upm-hero {
    padding: 2rem 1rem 1.5rem;
  }

  .upm-avatar {
    width: 80px;
    height: 80px;
  }

  .upm-name {
    font-size: 1.25rem;
  }

  .upm-quick-contact {
    padding: 1rem;
  }

  .upm-contact-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .upm-contact-btn span {
    display: none;
  }

  .upm-details {
    padding: 1rem;
  }

  .upm-details-grid {
    grid-template-columns: 1fr;
  }

  .upm-actions {
    padding: 1rem;
  }
}

/* === Contacts Detail Redesign === */
.contact-detail-page {
  display: grid;
  gap: 1rem;
  margin-top: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
}

.contact-detail-page-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

.contact-detail-page-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.contact-detail-page-header .page-title {
  display: none;
}

.contact-detail-page-header .page-actions {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contact-detail-page-header .page-actions .material-icons {
  font-size: 1rem;
  line-height: 1;
}

.contact-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1.05rem 1.2rem;
  border: 1px solid var(--app-border-subtle, rgba(0, 0, 0, 0.05));
  border-radius: var(--app-radius-xl, 24px);
  background: var(--app-surface-solid, #ffffff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow-x: hidden;
}

.contact-detail-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  width: 100%;
  grid-column: 1;
  grid-row: 1;
}

.contact-detail-identity-display {
  width: 100%;
}

.contact-detail-avatar-wrap,
.contact-detail-identity .user-display-avatar-wrap {
  flex: 0 0 auto;
}

.contact-detail-avatar,
.contact-detail-avatar.user-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 999px;
  object-fit: cover;
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-muted));
}

.contact-detail-avatar--initials,
.contact-detail-avatar.user-avatar--initials {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ft-primary);
}

.contact-detail-headline {
  min-width: 0;
}

.contact-detail-name,
.contact-detail-identity-display .user-display-name {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.14;
  color: var(--app-text);
}

.contact-detail-subline,
.contact-detail-identity-display .user-display-subtitle {
  margin: 0.14rem 0 0;
  font-size: 0.86rem;
  color: var(--app-muted);
  line-height: 1.22;
}

.contact-detail-identity-display .user-display-badges {
  margin-top: 0.28rem;
}

.contact-detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin-top: 0.28rem;
}

.status-pill.status-pill--inline {
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.69rem;
  line-height: 1;
  padding: 0.18rem 0.52rem;
}

.status-pill.status-pill--inline.status-pill-active {
  color: #166534;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.2);
}

.status-pill.status-pill--inline.status-pill-inactive {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.2);
}

.status-pill.status-pill--inline.status-pill-pending {
  color: #9a3412;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-pill.status-pill--inline.status-pill-available {
  color: #166534;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.2);
}

.status-pill.status-pill--inline.status-pill-not_sv_registered,
.status-pill.status-pill--inline.status-pill-unavailable {
  color: #334155;
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(100, 116, 139, 0.28);
}

.status-pill.status-pill--inline.status-pill-sick {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.2);
}

.status-pill.status-pill--inline.status-pill-vacation,
.status-pill.status-pill--inline.status-pill-time_off,
.status-pill.status-pill--inline.status-pill-parental_leave,
.status-pill.status-pill--inline.status-pill-paternity_month,
.status-pill.status-pill--inline.status-pill-special_leave_unpaid {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.2);
}

.contact-detail-status-meta {
  color: var(--app-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.contact-detail-hero-assignment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0;
  width: 100%;
}

.contact-detail-hero-context {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
}

.contact-detail-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 26px;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--app-border, rgba(0, 0, 0, 0.08));
  background: var(--app-surface-muted, #f8fafc);
  color: var(--app-text, #0f172a);
  font-size: 0.72rem;
  line-height: 1.1;
  max-width: 100%;
}

.contact-detail-hero-chip .material-icons {
  font-size: 15px;
  line-height: 1;
}

.contact-detail-hero-chip--team {
  border-color: color-mix(in srgb, var(--team-color, var(--app-border, rgba(0, 0, 0, 0.08))) 55%, var(--app-border, rgba(0, 0, 0, 0.08)));
  background: color-mix(in srgb, var(--team-color, var(--app-surface-muted, #f8fafc)) 16%, #fff);
}

.contact-detail-hero-chip--team .material-icons {
  color: var(--team-color, var(--app-muted, #64748b));
}

.contact-detail-hero-chip--vehicle {
  padding-left: 0.32rem;
}

.contact-detail-hero-chip-image-wrap {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  flex: 0 0 18px;
}

.contact-detail-hero-chip-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.contact-detail-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  grid-column: 2;
  grid-row: 1;
}

.contact-detail-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.42rem 0.68rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
  color: var(--app-text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.contact-detail-quick-link .material-icons {
  font-size: 18px;
  line-height: 1;
}

.contact-detail-quick-link--phone:hover,
.contact-detail-quick-link--whatsapp:hover,
.contact-detail-quick-link--email:hover,
.contact-detail-quick-link--neutral:hover {
  border-color: color-mix(in srgb, var(--ft-primary) 45%, var(--app-border));
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-muted));
}

.profile-detail-summary-bar {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  z-index: 6;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 0.2rem;
  border: 1px solid var(--app-border-subtle, rgba(0, 0, 0, 0.05));
  border-radius: var(--app-radius-lg, 16px);
  background: color-mix(in srgb, var(--app-surface-solid, #ffffff) 95%, var(--app-surface-muted));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  overflow-x: hidden;
}

.profile-detail-summary-list {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.profile-detail-summary-item {
  min-width: 130px;
  flex: 0 0 auto;
  display: grid;
  gap: 0.2rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid, #ffffff);
}

.profile-detail-summary-label {
  display: block;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-detail-summary-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--app-text);
}

.profile-detail-shell {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

.profile-detail-tabbar {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}


.profile-detail-tabbar .profile-detail-tabbar-content .tab_item_content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.profile-detail-tabbar .profile-detail-tabbar-content .tab_item_content.active {
  display: block;
}

.profile-detail-tab-panel {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.profile-detail-tab-panel .contact-detail-grid {
  margin-top: 0;
  min-width: 0;
}

.profile-detail-shell,
.profile-detail-tabbar,
.profile-detail-tabbar .boows_tab_container,
.profile-detail-tabbar .tab_content,
.profile-detail-tabbar .tab_bar {
  min-width: 0;
  max-width: 100%;
}

.profile-detail-tabbar .boows_tab_container {
  width: 100%;
  overflow: visible;
}

.profile-detail-tabbar .tab_bar {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.profile-detail-tabbar .tab_bar_inner {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
}

.profile-detail-tabbar .tab_item {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
}

.profile-detail-tab-panel .contact-detail-card,
.profile-detail-tab-panel .contact-detail-card * {
  max-width: 100%;
  box-sizing: border-box;
}

.profile-detail-tab-panel p,
.profile-detail-tab-panel li,
.profile-detail-tab-panel span,
.profile-detail-tab-panel dd,
.profile-detail-tab-panel strong {
  overflow-wrap: anywhere;
}

.profile-detail-tab-panel a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-detail-panel-empty {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.contact-detail-grid.profile-overview-grid {
  grid-template-columns: 1fr;
}

.profile-overview-card {
  display: grid;
  gap: 0.7rem;
}

.profile-overview-status-head {
  display: grid;
  gap: 0.16rem;
}

.profile-overview-status-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
}

.profile-overview-status-role {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--app-muted);
}

.profile-overview-status-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.profile-overview-status-detail {
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-muted);
}

.profile-overview-chip-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.profile-overview-chip {
  display: grid;
  gap: 0.08rem;
  min-width: 126px;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}

.profile-overview-chip span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-overview-chip strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-overview-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-overview-highlight {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--app-text);
}

.profile-overview-support {
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-muted);
}

.profile-overview-primary-action {
  margin-top: 0.25rem;
  width: fit-content;
}

.profile-overview-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-overview-meta-item {
  display: flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.36rem 0.56rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-overview-meta-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-overview-meta-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid.profile-contact-details-grid {
  grid-template-columns: 1fr;
}

.contact-detail-grid.profile-master-grid {
  grid-template-columns: 1fr;
}

.profile-contact-card {
  display: grid;
  gap: 0.62rem;
}

.profile-master-card {
  display: grid;
  gap: 0.62rem;
}

.profile-contact-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.profile-contact-action-link {
  min-height: 34px;
}

.profile-contact-address {
  display: grid;
  gap: 0.24rem;
}

.profile-contact-address p {
  margin: 0;
  color: var(--app-text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.profile-contact-note {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.profile-contact-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-contact-meta-item {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-contact-meta-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-contact-meta-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid.profile-employment-grid {
  grid-template-columns: 1fr;
}

.profile-employment-card {
  display: grid;
  gap: 0.62rem;
}

.profile-employment-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-employment-highlight {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
}

.profile-employment-support {
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-muted);
}

.profile-employment-support--reason {
  color: var(--app-text);
}

.profile-employment-support--reason strong {
  margin-right: 0.24rem;
  color: var(--app-muted);
  font-size: 0.8rem;
}

.profile-employment-status-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.profile-employment-status-detail {
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-muted);
}

.profile-employment-chip-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.profile-employment-chip {
  display: grid;
  gap: 0.08rem;
  min-width: 126px;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}

.profile-employment-chip span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-employment-chip strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-employment-absence-list {
  display: grid;
  gap: 0.5rem;
}

.profile-employment-absence-item {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.profile-employment-absence-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.profile-employment-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-employment-meta-item {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-employment-meta-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-employment-meta-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid.profile-duty-grid {
  grid-template-columns: 1fr;
}

.contact-detail-grid.profile-operations-grid {
  grid-template-columns: 1fr;
}

.profile-duty-card {
  display: grid;
  gap: 0.56rem;
}

.profile-duty-card--table {
  display: block;
}

.profile-duty-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-duty-highlight {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
}

.profile-duty-support {
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-muted);
}

.profile-duty-support strong {
  color: var(--app-text);
}

.profile-duty-support--note {
  color: var(--app-text);
}

.profile-duty-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.profile-duty-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.3rem 0.46rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
  font-size: 0.74rem;
  color: var(--app-text);
}

.profile-duty-recent-list {
  display: grid;
  gap: 0.48rem;
}

.profile-duty-recent-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.6rem 0.68rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.profile-duty-recent-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-duty-meta-list,
.profile-duty-change-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-duty-meta-item,
.profile-duty-change-item {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-duty-meta-item span,
.profile-duty-change-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-duty-meta-item strong,
.profile-duty-change-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid.profile-teams-grid {
  grid-template-columns: 1fr;
}

.profile-teams-card {
  display: grid;
  gap: 0.56rem;
}

.profile-teams-highlight {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--app-text);
}

.profile-teams-support {
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-muted);
}

.profile-teams-support strong {
  color: var(--app-text);
}

.profile-teams-history-list {
  display: grid;
  gap: 0.48rem;
}

.profile-teams-history-item {
  display: grid;
  gap: 0.24rem;
  padding: 0.56rem 0.64rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.profile-teams-history-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-teams-project-list {
  display: grid;
  gap: 0.5rem;
}

.profile-teams-project-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.62rem 0.68rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.profile-teams-project-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-teams-project-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.profile-teams-project-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.29rem 0.44rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-solid);
  font-size: 0.74rem;
  color: var(--app-text);
}

.profile-teams-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-teams-meta-item {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-teams-meta-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-teams-meta-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid.profile-statistics-grid {
  grid-template-columns: 1fr;
}

.profile-statistics-card {
  display: grid;
  gap: 0.56rem;
}

.profile-statistics-availability-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-statistics-availability-window {
  margin: 0;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.profile-statistics-availability-timeline {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.profile-statistics-availability-day {
  flex: 1;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-border);
}

.profile-statistics-availability-day--available {
  background: var(--ft-primary, #08a29a);
  border-color: var(--ft-primary, #08a29a);
}

.profile-statistics-availability-day--absent {
  background: var(--app-error, #dc2626);
  border-color: var(--app-error, #dc2626);
}

.profile-statistics-availability-day--unknown {
  background: var(--app-muted);
  border-color: var(--app-border);
  opacity: 0.6;
}

.profile-statistics-availability-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0;
}

.profile-statistics-availability-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.profile-statistics-availability-legend-indicator {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.profile-statistics-availability-intervals {
  display: grid;
  gap: 0.5rem;
}

.profile-statistics-availability-interval {
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.profile-statistics-availability-interval-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--app-muted);
}

.profile-statistics-availability-interval-head strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-statistics-availability-interval-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.profile-statistics-chart-box {
  margin: 0;
}

.contact-detail-card .boows-chart-box,
.contact-detail-card .profile-statistics-chart-box {
  box-shadow: none !important;
  background: transparent !important;
  border: 0 !important;
}

.contact-detail-card .boows-chart-container {
  box-shadow: none !important;
  background: transparent !important;
}

.profile-statistics-chart-box .boows-chart-container {
  min-height: 220px;
  height: 220px;
}

.profile-statistics-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-muted);
}

.profile-statistics-kpi-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.46rem;
}

.profile-statistics-kpi-item {
  display: grid;
  gap: 0.14rem;
  padding: 0.52rem 0.56rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.profile-statistics-kpi-item span {
  font-size: 0.72rem;
  color: var(--app-muted);
}

.profile-statistics-kpi-item strong {
  font-size: 0.95rem;
  color: var(--app-text);
}

.profile-statistics-trend-list {
  display: grid;
  gap: 0.46rem;
}

.profile-statistics-trend-item {
  display: grid;
  gap: 0.24rem;
}

.profile-statistics-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--app-text);
}

.profile-statistics-trend-head strong {
  font-size: 0.82rem;
}

.profile-statistics-trend-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--app-border-subtle, rgba(0, 0, 0, 0.08));
  overflow: hidden;
}

.profile-statistics-trend-bar > span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ft-primary) 72%, #ffffff);
}

.profile-statistics-distribution-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.profile-statistics-distribution-item {
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem 0.56rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}

.profile-statistics-distribution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.profile-statistics-distribution-head span {
  font-size: 0.82rem;
  color: var(--app-text);
}

.profile-statistics-distribution-head strong {
  font-size: 0.82rem;
  color: var(--app-text);
}

.profile-statistics-distribution-item small {
  font-size: 0.74rem;
  color: var(--app-muted);
}

.profile-statistics-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-statistics-meta-item {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-statistics-meta-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-statistics-meta-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid.profile-changes-grid,
.contact-detail-grid.profile-logs-grid {
  grid-template-columns: 1fr;
}

.profile-changes-card,
.profile-logs-card {
  display: grid;
  gap: 0.6rem;
}

.profile-changes-timeline,
.profile-logs-list {
  /* Vertical single-column list. Must NOT be `display:grid`: as a grid
     container the browser measures min/max-content of every item to size its
     track, and because each item contains nested grids (meta-rows) that
     intrinsic-sizing pass recurses super-linearly (O(n^2)). With ~80 audit-log
     entries this froze the Protokolle tab ~10s on mobile when the panel went
     display:none -> visible. flex-column gives items a definite width, so the
     nested grids lay out in a single pass (~3s -> <90ms). */
  display: flex;
  flex-direction: column;
  gap: 0.56rem;
}

.profile-changes-item,
.profile-logs-item {
  display: grid;
  gap: 0.34rem;
  padding: 0.56rem 0.62rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.profile-changes-item--warning {
  border-color: color-mix(in srgb, #d97706 45%, var(--app-border));
}

.profile-changes-item--critical {
  border-color: color-mix(in srgb, #dc2626 38%, var(--app-border));
}

.profile-changes-item--positive {
  border-color: color-mix(in srgb, #0f766e 35%, var(--app-border));
}

.profile-changes-item-head,
.profile-logs-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.profile-changes-item-title,
.profile-logs-item-summary {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--app-text);
}

.profile-changes-item-time,
.profile-logs-item-time {
  font-size: 0.74rem;
  color: var(--app-muted);
  white-space: nowrap;
}

.profile-changes-item-meta,
.profile-changes-item-description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--app-text);
}

.profile-changes-item-meta strong {
  color: var(--app-muted);
}

.profile-changes-item-description {
  color: var(--app-muted);
}

.profile-changes-meta-list,
.profile-logs-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-changes-meta-item,
.profile-logs-meta-item {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
}

.profile-changes-meta-item span,
.profile-logs-meta-item span {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.profile-changes-meta-item strong,
.profile-logs-meta-item strong {
  font-size: 0.8rem;
  color: var(--app-text);
}

.profile-logs-item-meta {
  margin: 0;
  display: grid;
  gap: 0.24rem;
}

.profile-logs-item-meta-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 0.4rem;
  align-items: start;
}

.profile-logs-item-meta-row dt {
  margin: 0;
  font-size: 0.74rem;
  color: var(--app-muted);
}

.profile-logs-item-meta-row dd {
  margin: 0;
  font-size: 0.8rem;
  color: var(--app-text);
}

.contact-detail-grid {
  display: grid;
  gap: 1rem 1.1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.contact-detail-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.contact-detail-section--wide {
  grid-column: 1 / -1;
}

/* Contact detail card style */
.contact-detail-page .app-card {
  border: 1px solid var(--app-border-subtle, rgba(0, 0, 0, 0.05));
  border-radius: var(--boows-default-border-container, var(--app-radius-lg));
  background: var(--app-surface-solid, #ffffff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  padding: 1rem 1.05rem;
  min-width: 0;
}

@keyframes slide-to-right {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes slide-from-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slide-to-left {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@keyframes slide-from-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none !important;
}

/* Optional: nur wenn wir wissen dass es "zurück" ist. Da wir kein JS für direction haben, machen wir es global für diese Seite */
.contact-detail-page-body {
  view-transition-name: contact-detail-body;
}

.contact-detail-card {
  grid-column: auto;
}

.contact-detail-card--wide {
  grid-column: 1 / -1;
}

.contact-detail-card--contact-data {
  grid-column: auto;
}

.contact-detail-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.25rem 0;
}

.contact-detail-list-item:not(:last-child) {
  border-bottom: 1px solid var(--app-border-subtle, rgba(0, 0, 0, 0.05));
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.contact-detail-list-item dt {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-muted);
  text-transform: none;
  letter-spacing: normal;
}

.contact-detail-list-item dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--app-text);
  text-align: right;
}

.contact-detail-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--app-muted);
}

.contact-detail-list-item-meta a {
  font-weight: 500;
}

/* Profile Menu Page */
.profile-menu-page {
  padding-top: 0.5rem;
}

@media (max-width: 900px) {
  body.app-auth .app-panel.profile-menu-page,
  body.app-auth .app-panel.profile-settings-page,
  body.app-auth .app-panel.profile-page-panel {
    padding: 0;
    border: none;
    box-shadow: none;
    background: none;
  }
}

.profile-menu-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-menu-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--app-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-menu-avatar--initials {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ft-primary);
}

.profile-menu-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--app-text);
}

.profile-menu-email {
  font-size: 0.95rem;
  color: var(--app-muted);
}

.profile-menu-section {
  margin-bottom: 1.5rem;
}

.app-section-title,
.app-section-title-muted,
.profile-menu-section-title,
.contact-detail-card-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--app-muted);
  line-height: 1.3;
  margin: 0 0 0.35rem 0.75rem;
}

.app-list-card,
.profile-menu-card {
  padding: 0 !important;
  overflow: hidden;
}

.profile-page-panel,
.profile-menu-hero,
.profile-menu-card,
.profile-settings-select .boows-container,
.profile-settings-select .boows-select {
  border-radius: var(--boows-default-border-container, var(--app-radius-lg));
}

.app-list-item,
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--app-text);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.app-list-item:not(:last-child),
.profile-menu-item:not(:last-child) {
  border-bottom: 1px solid var(--app-border-subtle, rgba(0, 0, 0, 0.05));
}

.app-list-item-icon,
.profile-menu-item-icon {
  font-size: 1.4rem;
  color: var(--app-text);
}

.app-list-item-label,
.profile-menu-item-label {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
}

.app-list-item-value,
.profile-menu-item-value {
  font-size: 0.95rem;
  color: var(--app-muted);
}

.app-list-item-arrow,
.profile-menu-item-arrow {
  font-size: 1.2rem;
  color: var(--app-muted);
}

.profile-menu-item--select {
  padding: 0.75rem 1rem;
  cursor: default;
}

.profile-menu-item--select .profile-settings-select-form {
  width: 100%;
}

.profile-menu-item--select .profile-settings-select-form .boows-input-field {
  margin: 0;
}

.profile-menu-item--select .profile-settings-select-form .boows-container,
.profile-menu-item--select .profile-settings-select-form .boows-select {
  max-width: 100%;
}

.profile-menu-item--select .profile-settings-select-form .field-prefix {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  border: 1px solid var(--app-border);
  border-right: 0;
}

.profile-menu-item--select .profile-settings-select-form .field-prefix .material-icons {
  font-size: 1.2rem;
}

.profile-menu-item--select .profile-settings-select-form .boows-container.has-prefix > .boows-select {
  border-left: 0;
}

.profile-menu-item--logout {
  color: #ef4444;
}

.profile-menu-item--logout .profile-menu-item-icon,
.profile-menu-item--logout .profile-menu-item-label {
  color: #ef4444;
}

.contact-detail-list-item dd a {
  color: var(--app-text);
}

.contact-detail-channel-list {
  display: grid;
  gap: 0.45rem;
}

.contact-detail-channel-item {
  display: grid;
  gap: 0.08rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}

.contact-detail-channel-item strong {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.contact-detail-channel-item span {
  font-size: 0.88rem;
  color: var(--app-text);
  word-break: break-word;
}

.contact-detail-channel-item a {
  font-size: 0.88rem;
  color: var(--app-text);
  word-break: break-word;
}

.contact-detail-project-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.32rem;
}

.contact-detail-project-list li {
  color: var(--app-text);
}

.contact-detail-project-list li a {
  color: var(--app-text);
  text-decoration: underline;
}

.contact-detail-empty {
  margin: 0;
  color: var(--app-muted);
}

.contact-detail-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.contact-detail-footer-actions:empty {
  display: none;
}

@media (max-width: 1100px) {
  .contact-detail-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .contact-detail-quick-actions {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .contact-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .profile-detail-summary-bar {
    top: calc(env(safe-area-inset-top, 0px) + 52px);
  }

  .profile-detail-summary-list {
    gap: 0.45rem;
    padding: 0.42rem;
  }

  .profile-detail-summary-item {
    min-width: 122px;
    padding: 0.42rem 0.52rem;
  }

  .profile-detail-summary-label {
    font-size: 0.66rem;
  }

  .profile-detail-summary-value {
    font-size: 0.8rem;
  }

  .contact-detail-hero {
    padding: 0.9rem 0.82rem;
  }

  .contact-detail-avatar.user-avatar {
    width: 52px;
    height: 52px;
  }

  .contact-detail-name,
  .contact-detail-identity-display .user-display-name {
    font-size: 1.16rem;
  }

  .contact-detail-quick-actions {
    gap: 0.36rem;
  }

  .contact-detail-quick-link {
    min-height: 32px;
    padding: 0.4rem 0.58rem;
    font-size: 0.76rem;
  }

  .contact-detail-hero-chip {
    font-size: 0.69rem;
    min-height: 24px;
    padding: 0.18rem 0.45rem;
  }

  .contact-detail-card {
    padding: 0.85rem 0.78rem;
  }

  .profile-statistics-chart-box .boows-chart-container {
    min-height: 190px;
    height: 190px;
  }
}

@media (min-width: 900px) {
  .contact-detail-grid.profile-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-detail-grid.profile-contact-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-detail-grid.profile-master-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-detail-grid.profile-employment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-detail-grid.profile-duty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.contact-detail-grid.profile-operations-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-operations-recent-table {
  width: 100%;
}

.profile-operations-recent-table .boows-table-td,
.profile-operations-recent-table .boows-table-th {
  white-space: normal;
  word-break: break-word;
}

  .contact-detail-grid.profile-teams-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-detail-grid.profile-statistics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-detail-grid.profile-changes-grid,
  .contact-detail-grid.profile-logs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-detail-summary-bar {
    top: 8px;
  }

  .profile-detail-summary-list {
    flex-wrap: wrap;
    overflow: visible;
  }

  .profile-detail-summary-item {
    min-width: 150px;
    flex: 1 1 150px;
  }
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

body.sidebar-collapsed .profile-menu-name,
body.sidebar-collapsed .profile-menu-chevron,
body.sidebar-collapsed .profile-menu-panel {
  display: none;
}

body.sidebar-collapsed .profile-menu summary {
  justify-content: center;
}

.profile-menu {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--app-radius-md);
  padding: 0.75rem;
  color: #f8fafc;
  display: block;
}

.profile-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
}

.profile-menu-avatar--empty {
  color: rgba(255, 255, 255, 0.7);
}

.profile-menu-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  flex: 1;
}

.profile-menu-chevron {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}

.profile-menu[open] .profile-menu-chevron {
  transform: rotate(180deg);
}

.profile-menu-panel {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-menu-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: var(--app-radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.profile-menu-link:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-version {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.app-content {
  padding: 2.25rem 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-height: calc(100vh - var(--app-header-height));
  view-transition-name: app-content;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Main area background to match the light dashboard look */
body.app-auth .app-content {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(237, 242, 247, 0.8) 100%);
}

.app-content.full-width {
  padding: 3rem 1.5rem;
}

.auth-page .app-content.full-width {
  align-items: center;
}

.app-breadcrumb {
  display: block;
  margin: 0;
  padding: 0;
}

.app-breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.app-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--app-muted);
  min-height: 1.2rem;
}

.app-breadcrumb-item:not(:first-child)::before {
  content: "›";
  color: color-mix(in srgb, var(--app-muted) 78%, transparent);
}

.app-breadcrumb-item a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

.app-breadcrumb-item a:hover {
  color: var(--app-text);
}

.app-breadcrumb-item.is-current {
  color: var(--app-text);
  font-weight: 600;
}

/*
  Page-load animations removed: they were fighting with View Transitions and caused
  visible jumps/flicker (especially on mobile). Keep navigation transitions instead.
*/

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: blur(14px);
  /* backdrop-filter creates a stacking context — give the header an
     explicit position+z-index so action-menu popovers can render above
     sibling content (status rail etc.) instead of being trapped. */
  position: relative;
  z-index: 50;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-header .page-actions:empty {
  display: none;
}

.page-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page-title h1,
.app-content h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  display: none !important;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.page-actions[data-action-zone="global"] {
  --action-zone: global;
}

.page-actions [data-page-action="1"] {
  min-height: 40px;
}

.page-actions [data-page-action="1"] .material-icons,
.boows-actions-sheet-item-icon .material-icons {
  font-size: 1.1rem;
}

.app-section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.app-surface-card,
.app-panel,
.app-card {
  background: var(--app-surface-solid);
  border: 1px solid var(--app-border);
  border-radius: var(--boows-default-border-container, var(--app-radius-lg));
  padding: 1.5rem;
  box-shadow: var(--app-shadow-soft);
}

.app-panel.table-card {
  overflow-x: auto;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  width: 100%;
}

.form-actions[data-action-zone="form"] {
  --action-zone: form;
}

.floating-action-bar {
  position: fixed;
  left: var(--floating-action-bar-left, 1rem);
  width: var(--floating-action-bar-width, calc(100vw - 2rem));
  max-width: var(--floating-action-bar-width, calc(100vw - 2rem));
  bottom: 0;
  /* Keep the bar above tab/panel content during transitions.
     (Mobile uses the topbar primary action instead.) */
  z-index: 1500;
  margin: 0;
  padding: 0.75rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom));
  border: 1px solid var(--app-border);
  border-bottom: 0;
  border-radius: var(--app-radius-md) var(--app-radius-md) 0 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--app-shadow-soft);
}

html[data-theme="dark"] .floating-action-bar {
  background: rgba(15, 23, 42, 0.88);
}

form.has-floating-action-bar {
  padding-bottom: calc(var(--floating-action-bar-height, 72px) + 1rem);
}

@media (max-width: 480px) {
  .floating-action-bar {
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0;
  }
}

.profile-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--boows-default-border-container, var(--app-radius-lg));
  background: rgba(248, 250, 252, 0.9);
  border: 1px dashed var(--app-border);
  color: var(--app-muted);
  font-size: 0.9rem;
}

.mobile-profile-page {
  max-width: 720px;
  margin-inline: auto;
  display: grid;
  gap: 0.85rem;
}

.mobile-profile-page-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-profile-page-name {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.mobile-profile-page-links {
  display: grid;
  gap: 0.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid > * {
  width: 100%;
}

.form-grid .form-grid-span {
  grid-column: span 2;
}

.boows-input-field .boows-form-control {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: #fff;
  color: var(--app-text);
  padding: 0.62rem 0.78rem;
  outline: none;
}

.boows-input-field .boows-form-control:focus {
  border-color: rgba(var(--ft-primary-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--ft-primary-rgb), 0.16);
}

html[data-theme="dark"] .boows-input-field .boows-form-control {
  background: rgba(241, 245, 249, 0.04);
  color: var(--app-text);
}

.scaffolding-dashboard {
  display: grid;
  gap: 1rem;
}

.scaffolding-dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.scaffolding-panel {
  border-radius: var(--app-radius-lg);
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
}

.scaffolding-actions-panel {
  padding: 1rem 1.1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
}

.scaffolding-actions-panel .scaffolding-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.scaffolding-actions-panel .boows-submit,
.scaffolding-actions-panel .boows-btn {
  width: auto;
  justify-content: center;
}

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

.scaffolding-kpi-card {
  padding: 0.95rem 1rem;
  border-radius: var(--app-radius-md);
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
}

.scaffolding-kpi-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.scaffolding-kpi-value {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--app-text);
}

.scaffolding-last-movement {
  margin: 1rem 0 0;
  color: var(--app-muted);
}

.scaffolding-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}

.scaffolding-range-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.scaffolding-range-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.scaffolding-section-title {
  margin: 0;
}

.scaffolding-overview-chart-wrap {
  position: relative;
  height: 360px;
  transition: opacity 0.18s ease;
}

.scaffolding-capacity-hint {
  margin: 0 0 0.75rem;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.scaffolding-capacity-chart-wrap {
  cursor: crosshair;
}

.scaffolding-selection-box {
  position: absolute;
  border: 1px dashed rgba(14, 116, 144, 0.8);
  background: rgba(14, 165, 233, 0.16);
  pointer-events: none;
  border-radius: 6px;
  z-index: 2;
}

.scaffolding-overview-chart-wrap.is-loading {
  opacity: 0.64;
}

.scaffolding-overview-chart-wrap.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--app-radius-md);
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.scaffolding-chart-toolbar {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.scaffolding-toggle {
  font: inherit;
  min-height: 40px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  border-radius: var(--app-radius-md);
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  color: var(--app-text);
  font-weight: 600;
  transition: all 0.16s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scaffolding-toggle:hover {
  border-color: rgba(var(--ft-primary-rgb), 0.45);
  color: var(--app-text);
}

.scaffolding-toggle.is-active {
  background: color-mix(in srgb, var(--ft-primary) 11%, #ffffff);
  border-color: color-mix(in srgb, var(--ft-primary) 35%, var(--app-border));
  color: color-mix(in srgb, var(--ft-primary) 85%, #0f172a);
}

.scaffolding-custom-range {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.scaffolding-custom-range .boows-input-field {
  margin: 0;
  min-width: 290px;
}

.scaffolding-custom-range .boows-input-wrapper .boows-input {
  min-height: 40px;
}

@media (max-width: 1200px) {
  .scaffolding-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .scaffolding-range-toolbar {
    justify-content: flex-start;
    width: 100%;
  }

  .scaffolding-range-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .scaffolding-custom-range .boows-input-field {
    min-width: 0;
    width: 100%;
  }
}

.scaffolding-chart-wrap {
  height: 330px;
}

.scaffolding-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.scaffolding-pagination-actions {
  display: flex;
  gap: 0.6rem;
}

.project-section-title {
  margin: 0 0 0.95rem;
}

.project-toolbar,
.projectplan-toolbar {
  display: grid;
  gap: 0.95rem;
}

.project-toolbar-grid {
  display: grid;
  gap: 0.8rem;
}

.project-toolbar-actions,
.projectplan-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.projectplan-toolbar-actions > * {
  flex: 0 0 auto;
}

.projectplan-toolbar-actions .boows-btn,
.projectplan-toolbar-actions .boows-submit {
  min-height: 40px;
}

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

.project-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  overflow: hidden;
  box-shadow: var(--app-shadow-soft);
  display: grid;
}

.project-card-header {
  background: linear-gradient(
    130deg,
    color-mix(in srgb, var(--ft-primary) 86%, #ffffff) 0%,
    color-mix(in srgb, var(--ft-primary) 62%, #ffffff) 100%
  );
  color: #fff;
  padding: 1rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  justify-content: space-between;
}

.project-card-header h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.25;
}

.project-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
}

.project-status-badge.is-active {
  background: rgba(22, 163, 74, 0.2);
}

.project-status-badge.is-completed {
  background: rgba(51, 65, 85, 0.28);
}

.project-status-badge.is-draft {
  background: rgba(148, 163, 184, 0.28);
}

.project-card-body {
  padding: 0.95rem 1rem 0.85rem;
  display: grid;
  gap: 0.45rem;
}

.project-address {
  margin: 0;
  color: var(--app-text);
  font-weight: 550;
}

.project-range,
.project-scaffold,
.project-parties {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.project-card-footer {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.project-card--table-card {
  height: 100%;
}

.projects-table .boows-card-item {
  border: none;
  box-shadow: none;
  background: transparent;
}

.projects-table.boows-table.is-loading {
  min-height: clamp(420px, 62vh, 780px);
}

.project-card--table-card .project-card-body {
  gap: 0.6rem;
}

.project-card-lead .user-inline-avatar.user-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.project-card-lead-color {
  display: block;
  border-left: 4px solid var(--project-lead-color, rgba(var(--ft-primary-rgb), 0.72));
  padding-left: 0.5rem;
  border-radius: 0.35rem;
}

.project-card-address-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.project-card-address {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--app-text);
  font-weight: 550;
  font-size: 0.88rem;
  line-height: 1.35;
  min-width: 0;
}

.project-card-address .material-icons {
  font-size: 0.95rem;
  color: var(--app-muted);
  flex: 0 0 auto;
}

.project-card-address > span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-distance {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--app-muted);
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.project-card-distance .material-icons {
  font-size: 0.86rem;
  color: var(--app-muted);
}

.project-card-distance > span {
  line-height: 1.2;
}

.project-card-fact-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.project-card-fact-row .material-icons {
  font-size: 1rem;
  color: var(--app-muted);
  flex: 0 0 auto;
}

.project-card-fact-value {
  font-size: 0.86rem;
  color: var(--app-text);
  font-weight: 560;
  word-break: break-word;
}

.project-card-progress-row {
  margin-top: 0.15rem;
  width: 100%;
}

.project-card-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0.25rem;
}

.project-card-kpi {
  border: 1px solid rgba(11, 20, 31, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-card-kpi--assessment {
  align-items: flex-start;
  justify-content: center;
}

.project-card-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #8896ab;
  text-align: left;
}

.project-card-kpi-value {
  font-size: 17px;
  font-weight: 700;
  color: #1d293f;
  text-align: left;
}

.project-card-kpi .psc-progress {
  width: 100%;
}

.project-card-meta-row {
  margin-top: 0.12rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
}

.project-card-meta-spacer {
  display: inline-block;
  min-height: 1px;
}

.project-card-meta-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.project-card-scaffold-amount {
  white-space: nowrap;
}

.project-progress {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.project-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  overflow: hidden;
}

.project-progress-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ft-primary) 72%, #ffffff);
}

.project-progress-value {
  font-size: 0.74rem;
  color: var(--app-muted);
  font-weight: 700;
  white-space: nowrap;
}

.project-progress--full {
  width: 100%;
}

.project-card-footer--icons {
  margin-top: 0;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0;
}

.project-card-footer--icons .boows-action-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-card-footer--icons .boows-action-button .material-icons {
  width: 20px;
  height: 20px;
  min-width: 20px;
  line-height: 20px;
  font-size: 22px;
  background: transparent;
}

.project-card-footer--icons .boows-action-button.is-muted {
  opacity: 0.75;
}

.project-card-footer--icons .boows-action-button:hover {
  opacity: 1;
  border-color: color-mix(in srgb, var(--ft-primary) 45%, var(--app-border));
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-muted));
}

.project-card-footer--icons .boows-action-button::after {
  content: none;
}

@media (min-width: 1024px) {
  .project-card-address {
    max-width: min(72%, 460px);
  }
}

.project-empty {
  margin: 0;
  color: var(--app-muted);
}

.project-detail-hero {
  background:
    radial-gradient(circle at 88% -12%, rgba(var(--ft-primary-rgb), 0.16), transparent 40%),
    linear-gradient(180deg, rgba(var(--ft-primary-rgb), 0.05), rgba(var(--ft-primary-rgb), 0.015));
  border-color: color-mix(in srgb, var(--ft-primary) 24%, var(--app-border));
}

.project-detail-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.project-detail-kicker {
  margin: 0 0 0.22rem;
  color: var(--app-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.project-detail-hero-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.project-detail-status-pill {
  margin-top: 0.1rem;
  border-color: color-mix(in srgb, var(--ft-primary) 38%, rgba(255, 255, 255, 0.45));
}

.project-detail-hero-actions {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.project-details-item {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.75rem 0.85rem;
}

.project-details-item--icon {
  position: relative;
  padding-left: 2.3rem;
}

.project-details-item--span {
  grid-column: 1 / -1;
}

.project-details-icon {
  position: absolute;
  left: 0.78rem;
  top: 0.86rem;
  font-size: 1rem;
  color: var(--app-muted);
}

.project-details-label {
  font-size: 0.72rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.project-details-value {
  margin-top: 0.3rem;
  color: var(--app-text);
  font-weight: 600;
  line-height: 1.4;
}

.project-details-section-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.project-details-description {
  margin: 0;
  color: var(--app-text);
  line-height: 1.55;
}

.user-display-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.user-display-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--boows-col-primary, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

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

.user-display-avatar .user-display-initials {
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-display-avatar.has-image .user-display-initials {
  display: none;
}

.user-display-avatar.no-avatar img {
  display: none;
}

.user-display-info {
  line-height: 1.2;
}

.user-display-name {
  font-weight: 500;
  font-size: 14px;
}

.user-display-role {
  font-size: 11px;
  opacity: 0.7;
}

.project-contacts-panel {
  display: grid;
  gap: 0.9rem;
}

.project-contacts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-contacts-subtitle {
  margin: 0.18rem 0 0;
  color: var(--app-muted);
  font-size: 0.84rem;
}

.project-contacts-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.project-contacts-list {
  display: grid;
  gap: 0.65rem;
}

.project-contacts-empty {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.92rem;
}

.project-contacts-empty.small {
  font-size: 0.82rem;
}

.project-contacts-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.project-contacts-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.project-contacts-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: color-mix(in srgb, var(--ft-primary) 74%, #0f172a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.project-contacts-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-contacts-avatar .material-icons {
  font-size: 1.05rem;
}

.project-contacts-main {
  min-width: 0;
}

.project-contacts-name-row {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.project-contacts-name-row strong {
  font-size: 0.92rem;
  color: var(--app-text);
}

.project-contacts-role {
  margin-top: 0.15rem;
  color: var(--app-text);
  font-weight: 600;
  font-size: 0.86rem;
}

.project-contacts-secondary {
  margin-top: 0.1rem;
  color: var(--app-muted);
  font-size: 0.78rem;
}

.project-contacts-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.08rem 0.46rem;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.project-contacts-badge.is-internal {
  background: rgba(var(--ft-primary-rgb), 0.1);
  border-color: rgba(var(--ft-primary-rgb), 0.24);
  color: color-mix(in srgb, var(--ft-primary) 86%, #0f172a);
}

.project-contacts-badge.is-external {
  background: rgba(15, 23, 42, 0.07);
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

.project-contacts-badge.is-primary {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.24);
  color: #166534;
}

.project-contacts-card-meta {
  display: grid;
  gap: 0.15rem;
}

.project-contacts-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--app-muted);
}

.project-contacts-card-meta .material-icons {
  font-size: 0.95rem;
}

.project-contacts-notes {
  margin: 0;
  color: var(--app-text);
  font-size: 0.82rem;
  line-height: 1.4;
}

.project-contacts-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-contacts-quick-links {
  display: inline-flex;
  gap: 0.35rem;
}

.project-contacts-quick-link {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.project-contacts-quick-link .material-icons {
  font-size: 1rem;
}

.project-contacts-card-actions {
  display: inline-flex;
  gap: 0.35rem;
}

.project-contacts-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.project-contacts-icon-btn .material-icons {
  font-size: 1rem;
}

.project-contacts-icon-btn.is-danger {
  color: #b91c1c;
}

.project-contacts-popup-shell .boows-popup {
  width: min(92vw, 760px);
}

.project-contacts-popup {
  display: grid;
  gap: 0;
}

.project-contacts-popup-head {
  padding: 0.2rem 1rem 0.1rem;
}

.project-contacts-popup-head h3 {
  margin: 0;
  font-size: 1rem;
}

.project-contacts-popup .project-contacts-drawer-body {
  max-height: min(70vh, 640px);
}

.project-contacts-drawer[hidden] {
  display: none;
}

.project-contacts-drawer {
  position: fixed;
  inset: 0;
  z-index: 1400;
}

.project-contacts-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.56);
}

.project-contacts-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(100%, 560px);
  background: var(--app-surface-solid);
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.project-contacts-drawer-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-contacts-drawer-head h3 {
  margin: 0;
  font-size: 1rem;
}

.project-contacts-drawer-close {
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.project-contacts-drawer-close .material-icons {
  font-size: 1.1rem;
}

.project-contacts-drawer-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--app-border);
}

.project-contacts-tab {
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  color: var(--app-text);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.project-contacts-tab.is-active {
  border-color: rgba(var(--ft-primary-rgb), 0.38);
  background: rgba(var(--ft-primary-rgb), 0.15);
}

.project-contacts-drawer-body {
  overflow-y: auto;
  min-height: 0;
}

.project-contacts-tab-panel {
  display: none;
  padding: 0.8rem 1rem 1.2rem;
}

.project-contacts-tab-panel.is-active {
  display: grid;
  gap: 0.7rem;
}

.project-contacts-sticky-search {
  position: sticky;
  top: -0.1rem;
  z-index: 2;
  background: var(--app-surface-solid);
  padding-bottom: 0.45rem;
}

.project-contacts-search-results {
  display: grid;
  gap: 0.45rem;
}

.project-contacts-search-item {
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  border-radius: var(--app-radius-md);
  padding: 0.55rem 0.65rem;
  text-align: left;
  display: grid;
  gap: 0.12rem;
  cursor: pointer;
}

.project-contacts-search-item strong {
  font-size: 0.86rem;
}

.project-contacts-search-item span {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.project-contacts-search-item small {
  font-size: 0.74rem;
  color: var(--app-muted);
  line-height: 1.35;
}

.project-contacts-form {
  display: grid;
  gap: 0.65rem;
}

.project-contacts-form label {
  display: grid;
  gap: 0.22rem;
}

.project-contacts-form label > span {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.project-contacts-grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.project-contact-selected {
  border: 1px solid rgba(var(--ft-primary-rgb), 0.25);
  background: rgba(var(--ft-primary-rgb), 0.1);
  border-radius: var(--app-radius-md);
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
  color: var(--app-text);
}

.project-contacts-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.project-contacts-checkbox-row span {
  font-size: 0.84rem;
  color: var(--app-text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.project-contacts-submit-btn {
  justify-self: start;
}

.project-contacts-duplicate-box {
  border: 1px solid rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.09);
  border-radius: var(--app-radius-md);
  padding: 0.55rem 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.project-contacts-duplicate-title {
  margin: 0;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
}

.project-contacts-duplicate-list {
  display: grid;
  gap: 0.4rem;
}

.project-contacts-duplicate-item {
  border: 1px solid rgba(180, 83, 9, 0.24);
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--app-radius-md);
  padding: 0.45rem 0.55rem;
  text-align: left;
  display: grid;
  gap: 0.1rem;
  cursor: pointer;
}

.project-contacts-duplicate-item strong {
  font-size: 0.84rem;
  color: #78350f;
}

.project-contacts-duplicate-item small {
  font-size: 0.74rem;
  color: #92400e;
}

.project-contacts-duplicate-item span {
  font-size: 0.72rem;
  color: #b45309;
}

.project-contacts-confirm-sheet[hidden] {
  display: none;
}

.project-contacts-confirm-sheet {
  position: fixed;
  inset: 0;
  z-index: 1600;
}

.project-contacts-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.48);
}

.project-contacts-confirm-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 520px);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--app-border);
  border-bottom: 0;
  background: var(--app-surface-solid);
  padding: 0.95rem 1rem 1.05rem;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.2);
  display: grid;
  gap: 0.55rem;
}

.project-contacts-confirm-panel h4 {
  margin: 0;
  font-size: 0.95rem;
}

.project-contacts-confirm-panel p {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.85rem;
}

.project-contacts-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.project-contacts-confirm-actions .boows-submit--danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

@media (min-width: 740px) {
  .project-contacts-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-contacts-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.projectplan-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  width: 100%;
}

.projectplan-list,
.projectplan-gantt {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
}

.projectplan-list {
  padding: 0.8rem;
  display: grid;
  gap: 0.65rem;
}

.projectplan-list-head {
  font-weight: 700;
  padding: 0.25rem 0.2rem 0.45rem;
}

.projectplan-list-row {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 0.65rem;
  display: grid;
  gap: 0.4rem;
}

.projectplan-list-row.is-conflict {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.05);
}

.projectplan-list-row.is-focus {
  border-color: rgba(var(--ft-primary-rgb), 0.65);
  box-shadow: 0 0 0 3px rgba(var(--ft-primary-rgb), 0.14);
}

.projectplan-list-title-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.projectplan-conflict-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.projectplan-list-submeta {
  font-size: 0.82rem;
  color: var(--app-muted);
}

.projectplan-conflict-reason {
  margin: 0;
  font-size: 0.8rem;
  color: #b91c1c;
}

.projectplan-move-btn {
  border: 1px solid var(--app-border);
  background: rgba(var(--ft-primary-rgb), 0.08);
  color: var(--app-text);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  justify-self: start;
}

.projectplan-gantt {
  overflow: auto;
  min-height: 280px;
}

.projectplan-gantt-head {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  min-width: 900px;
}

.projectplan-gantt-head span {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--app-muted);
}

.projectplan-gantt-body {
  position: relative;
  min-width: 900px;
  padding: 0.45rem 0.75rem 0.9rem;
}

.projectplan-row {
  position: relative;
  height: 42px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

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

.projectplan-row.is-focus {
  background: rgba(var(--ft-primary-rgb), 0.05);
}

.projectplan-bar {
  position: absolute;
  top: 8px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(var(--ft-primary-rgb), 0.84);
  color: #fff;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  font-weight: 650;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.projectplan-bar.status-active {
  background: rgba(14, 116, 144, 0.88);
}

.projectplan-bar.status-completed {
  background: rgba(51, 65, 85, 0.82);
}

.projectplan-bar.status-draft {
  background: rgba(100, 116, 139, 0.78);
}

.projectplan-bar.is-conflict {
  border-color: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.projectplan-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(239, 68, 68, 0.72);
  z-index: 3;
}

.projectplan-modal[hidden] {
  display: none;
}

.projectplan-modal {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.projectplan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.projectplan-modal-card {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 1.5rem));
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  padding: 1rem;
  box-shadow: var(--app-shadow);
}

.projectplan-modal-card header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0.75rem;
}

.projectplan-modal-card header h3 {
  margin: 0;
}

.projectplan-modal-hint {
  margin: 0.2rem 0 0;
  color: var(--app-muted);
  font-size: 0.86rem;
}

.projectplan-move-preview {
  margin-top: 0.8rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.65rem 0.72rem;
  display: grid;
  gap: 0.45rem;
}

.projectplan-move-preview h4 {
  margin: 0;
  font-size: 0.83rem;
}

.projectplan-move-preview-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.projectplan-move-preview-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-solid);
  padding: 0.42rem 0.48rem;
  display: grid;
  gap: 0.1rem;
}

.projectplan-move-preview-grid span {
  color: var(--app-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.projectplan-move-preview-grid strong {
  font-size: 0.78rem;
}

.projectplan-move-preview-decider {
  margin: 0;
  font-size: 0.76rem;
  color: var(--app-muted);
}

.projectplan-move-preflight-state {
  margin: 0;
  font-size: 0.79rem;
  font-weight: 650;
  color: var(--app-text);
}

.projectplan-move-preflight-state.is-loading {
  color: var(--app-muted);
}

.projectplan-move-preflight-state.is-warning {
  color: #92400e;
}

.projectplan-move-preflight-state.is-blocking {
  color: #991b1b;
}

.projectplan-move-preflight-state.is-info {
  color: #0e7490;
}

.projectplan-move-preflight-state.is-none {
  color: #166534;
}

.projectplan-move-preflight-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.34rem;
}

.projectplan-move-preflight-list li {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-solid);
  padding: 0.38rem 0.46rem;
  display: grid;
  gap: 0.06rem;
}

.projectplan-move-preflight-list li strong {
  font-size: 0.75rem;
}

.projectplan-move-preflight-list li span,
.projectplan-move-preflight-list li em {
  font-size: 0.73rem;
  color: var(--app-muted);
}

.projectplan-move-preflight-list li.is-warning {
  border-color: rgba(217, 119, 6, 0.45);
}

.projectplan-move-preflight-list li.is-blocking {
  border-color: rgba(220, 38, 38, 0.45);
}

.projectplan-move-preflight-list li.is-info {
  border-color: rgba(14, 116, 144, 0.45);
}

.projectplan-move-preflight-list li.is-group-head {
  border-style: dashed;
  background: color-mix(in srgb, var(--app-surface-muted) 78%, transparent);
}

.projectplan-move-preflight-list li.is-group-head strong {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.projectplan-modal-open {
  overflow: hidden;
}

.projectplan-page-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}

#projectPlanToolbar,
.projectplan-timeline-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.projectplan-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.projectplan-page-export-trigger {
  margin: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.projectplan-export-panel[hidden] {
  display: none;
}

.projectplan-export-actions {
  padding: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.projectplan-export-actions .boows-btn {
  width: 100%;
  justify-content: flex-start;
}

.projectplan-toolbar-v3 {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  padding: 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.projectplan-toolbar-main {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
}

.projectplan-range-slider-wrap {
  display: grid;
  gap: 0.32rem;
}

.projectplan-range-slider-wrap .boows-input-field {
  margin: 0;
}
/*
.projectplan-range-slider-wrap .boows-range-slider {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 0.46rem 0.6rem 0.52rem;
  background: var(--app-surface-muted);
}*/

.projectplan-range-slider-wrap .boows-range-ui-wrap {
  margin: 0;
}

.projectplan-range-slider-wrap .boows-range-value-badge {
  min-width: 72px;
  text-align: center;
  font-size: 0.63rem;
  padding: 0.14rem 0.26rem;
}

.projectplan-range-slider-wrap .boows-range-scale {
  display: none !important;
}

.projectplan-range-slider-wrap .boows-range-scale-label {
  font-size: 0.58rem;
  white-space: nowrap;
}

.projectplan-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.projectplan-toolbar-actions .boows-submit {
  margin: 0;
}

.projectplan-toolbar-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.projectplan-toolbar-actions .boows-icon-button {
  margin: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.projectplan-toolbar-btn.is-active {
  border-color: rgba(var(--ft-primary-rgb), 0.45);
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: color-mix(in srgb, var(--ft-primary) 76%, #0f172a);
}

.projectplan-toolbar-btn-icon {
  width: 38px;
  min-width: 38px;
  justify-content: center;
  padding: 0;
}

.projectplan-toolbar-btn .material-icons {
  font-size: 18px;
}

.projectplan-toolbar-btn-text {
  display: none;
  font-size: 0.78rem;
  font-weight: 650;
}

.projectplan-toolbar-subpanels {
  display: none;
  gap: 0.55rem;
}

.projectplan-toolbar-panel {
  overflow: hidden;
}

.projectplan-control-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.68rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
}

.projectplan-control-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  overflow: clip;
}

.projectplan-daily-panel {
  margin-bottom: 0.65rem;
}

.projectplan-daily-body {
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.projectplan-daily-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.projectplan-daily-form-grid {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: 1fr;
}

.projectplan-daily-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
}

.projectplan-daily-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.projectplan-daily-summary > span {
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.15rem 0.52rem;
}

.projectplan-daily-state.is-ok {
  border-color: rgba(6, 95, 70, 0.38);
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
}

.projectplan-daily-state.is-warning {
  border-color: rgba(180, 83, 9, 0.38);
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
}

.projectplan-daily-state.is-conflict {
  border-color: rgba(185, 28, 28, 0.42);
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.projectplan-daily-state.is-unknown {
  border-color: rgba(71, 85, 105, 0.4);
  background: rgba(148, 163, 184, 0.2);
  color: #334155;
}

.projectplan-daily-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.projectplan-daily-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.38rem;
}

.projectplan-daily-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
}

.projectplan-daily-check-team {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectplan-daily-check-message {
  font-size: 0.73rem;
  color: var(--app-muted);
}

.projectplan-daily-check-state {
  border-radius: 999px;
  border: 1px solid var(--app-border);
  padding: 0.08rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 650;
  background: rgba(148, 163, 184, 0.16);
  color: #334155;
}

.projectplan-daily-check.is-ok .projectplan-daily-check-state {
  border-color: rgba(6, 95, 70, 0.36);
  background: rgba(16, 185, 129, 0.14);
  color: #065f46;
}

.projectplan-daily-check.is-warning .projectplan-daily-check-state {
  border-color: rgba(180, 83, 9, 0.38);
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
}

.projectplan-daily-check.is-conflict .projectplan-daily-check-state {
  border-color: rgba(185, 28, 28, 0.42);
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
}

.projectplan-daily-check.is-unknown .projectplan-daily-check-state {
  border-color: rgba(71, 85, 105, 0.38);
  background: rgba(148, 163, 184, 0.2);
  color: #334155;
}

.projectplan-filter-grid {
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}

.projectplan-active-filters {
  border-top: 1px solid var(--app-border);
  padding: 0.72rem 0.85rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.projectplan-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--ft-primary-rgb), 0.28);
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: color-mix(in srgb, var(--ft-primary) 78%, #0f172a);
  padding: 0.15rem 0.52rem;
  font-size: 0.73rem;
  line-height: 1.25;
  font-weight: 600;
}

.projectplan-filter-chip.is-empty {
  border-color: var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-muted);
}

.projectplan-layer-list {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem;
}

.projectplan-layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 0.52rem 0.62rem;
  background: var(--app-surface-muted);
  font-size: 0.84rem;
}

.projectplan-layer-toggle input {
  width: 1rem;
  height: 1rem;
}

.projectplan-layer-toggle.is-active {
  border-color: rgba(var(--ft-primary-rgb), 0.45);
  background: rgba(var(--ft-primary-rgb), 0.12);
}

.projectplan-layer-hint {
  margin: 0;
  border-top: 1px solid var(--app-border);
  padding: 0.68rem 0.85rem 0.8rem;
  color: var(--app-muted);
  font-size: 0.78rem;
}

.projectplan-legend {
  padding: 0.75rem 0.85rem 0.85rem;
}

.projectplan-legend-below {
  width: 100%;
  margin-top: 0.65rem;
}

.projectplan-legend h3 {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
}

.projectplan-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.projectplan-legend-chip {
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  font-size: 0.73rem;
  font-weight: 650;
  border: 1px solid var(--app-border);
  color: var(--app-text);
}

.projectplan-legend-chip.is-blocking {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
}

.projectplan-legend-chip.is-warning {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.16);
  color: #92400e;
}

.projectplan-legend-chip.is-info {
  border-color: rgba(14, 116, 144, 0.32);
  background: rgba(6, 182, 212, 0.14);
  color: #0e7490;
}

.projectplan-legend-chip.is-request-pending {
  border-color: rgba(8, 145, 178, 0.3);
  background: rgba(6, 182, 212, 0.14);
  color: #0f766e;
}

.projectplan-legend-chip.is-request-stale {
  border-color: rgba(71, 85, 105, 0.35);
  background: rgba(100, 116, 139, 0.18);
  color: #334155;
}

.projectplan-legend-chip.is-project-color {
  border-color: rgba(30, 41, 59, 0.26);
  background: linear-gradient(90deg, #ef4444 0%, #f97316 20%, #eab308 40%, #22c55e 60%, #3b82f6 80%, #8b5cf6 100%);
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.45);
}

.projectplan-legend-sources {
  margin: 0.62rem 0 0;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.projectplan-timeline-panel {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
  order: 2;
}

/* Ensure native [hidden] works reliably inside project plan module. */
[data-project-plan-root] [hidden] {
  display: none !important;
}

.projectplan-loading-state,
.projectplan-empty-state,
.projectplan-error-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 0.45rem;
  padding: 1.2rem;
  text-align: center;
  color: var(--app-muted);
}

.projectplan-loading-state .material-icons,
.projectplan-empty-state .material-icons,
.projectplan-error-state .material-icons {
  font-size: 1.55rem;
}

.projectplan-error-state {
  color: #b91c1c;
}

.projectplan-empty-state p,
.projectplan-error-state p {
  margin: 0;
}

.projectplan-timeline-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.projectplan-timeline-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted);
}

.projectplan-row-label-head {
  position: sticky;
  left: 0;
  z-index: 14;
  padding: 0.62rem 0.75rem;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--app-muted);
  border-right: 1px solid var(--app-border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow: hidden;
}

.projectplan-header-rail {
  overflow: hidden;
  min-height: 52px;
  position: relative;
}

.projectplan-header-slots {
  position: relative;
  min-height: 52px;
  transform: translateX(0);
  will-change: transform;
}

.projectplan-header-slot {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px dashed rgba(148, 163, 184, 0.32);
  padding: 0.5rem 0.35rem 0.35rem;
  overflow: hidden;
}

.projectplan-header-slot strong {
  display: block;
  font-size: 0.75rem;
  color: var(--app-text);
  white-space: nowrap;
}

.projectplan-header-slot small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.69rem;
  color: var(--app-muted);
  white-space: nowrap;
}

.projectplan-viewport {
  overflow: auto;
  max-height: min(72vh, 780px);
}

.projectplan-row-list {
  display: grid;
  min-height: 120px;
}

.projectplan-row-list.is-virtualized {
  align-content: start;
}

.projectplan-row-spacer {
  width: 100%;
  min-height: 1px;
  pointer-events: none;
}

.projectplan-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 64px;
  min-height: 64px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.projectplan-row.is-group-start:not(:first-child) {
  border-top: 2px solid color-mix(in srgb, var(--app-border) 72%, #94a3b8);
}

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

.projectplan-row-label {
  position: sticky;
  left: 0;
  z-index: 13;
  border-right: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  padding: 0.42rem 0.52rem;
  display: grid;
  gap: 0.24rem;
  align-content: center;
  overflow: hidden;
  box-shadow: inset 3px 0 0 var(--projectplan-row-lead-color, transparent);
}

.projectplan-row.is-lane-continuation .projectplan-row-label {
  box-shadow: none;
  background: color-mix(in srgb, var(--app-surface-solid) 88%, #f1f5f9);
}

.projectplan-row-identity.is-continuation {
  grid-template-columns: 10px;
  gap: 0;
}

.projectplan-row-continuation-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--projectplan-row-lead-color, #94a3b8) 72%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--projectplan-row-lead-color, #64748b) 72%, #ffffff);
}

.projectplan-row-identity {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}

.projectplan-row-avatar,
.projectplan-row-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
}

.projectplan-row-avatar {
  display: block;
  object-fit: cover;
}

.projectplan-row-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--app-muted);
}

.projectplan-row-label-main {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.projectplan-row-label-main strong {
  font-size: 0.84rem;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectplan-row-label-main span {
  font-size: 0.74rem;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectplan-row-metrics {
  display: flex;
  align-items: center;
  gap: 0.24rem;
}

.projectplan-row-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.14rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--app-surface-muted);
  color: var(--app-muted);
  padding: 0.06rem 0.3rem;
  font-size: 0.67rem;
  line-height: 1.1;
}

.projectplan-row-metric .material-icons {
  font-size: 0.78rem;
}

.projectplan-row-metric strong {
  font-size: 0.67rem;
  color: var(--app-text);
}

.projectplan-row-metric.is-conflict-active {
  border-width: 1px;
  font-weight: 700;
}

.projectplan-row-metric.is-conflict-active.is-blocking {
  border-color: rgba(220, 38, 38, 0.5);
  background: rgba(239, 68, 68, 0.18);
  color: #991b1b;
}

.projectplan-row-metric.is-conflict-active.is-warning,
.projectplan-row-metric.is-conflict-active:not(.is-blocking):not(.is-info) {
  border-color: rgba(180, 83, 9, 0.48);
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
}

.projectplan-row-metric.is-conflict-active.is-info {
  border-color: rgba(14, 116, 144, 0.42);
  background: rgba(6, 182, 212, 0.18);
  color: #0e7490;
}

.projectplan-row-metric.is-conflict-active strong {
  color: currentColor;
}

.projectplan-row-track {
  position: relative;
  min-height: 64px;
  overflow: hidden;
  z-index: 1;
}

.projectplan-row-track.is-drag-active {
  background-color: rgba(var(--ft-primary-rgb), 0.06);
}

.projectplan-row-track.is-drop-invalid {
  background-color: rgba(220, 38, 38, 0.12);
}

.projectplan-row.is-drop-target .projectplan-row-label {
  background: color-mix(in srgb, var(--ft-primary) 12%, #ffffff);
}

.projectplan-row.is-drop-target .projectplan-row-track {
  background-color: rgba(var(--ft-primary-rgb), 0.08);
}

.projectplan-drag-preview {
  position: absolute;
  top: 18px;
  height: 28px;
  border-radius: 999px;
  border: 1px dashed rgba(var(--ft-primary-rgb), 0.8);
  background: rgba(var(--ft-primary-rgb), 0.2);
  color: color-mix(in srgb, var(--ft-primary) 75%, #0f172a);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  z-index: 3;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectplan-drag-preview.is-invalid {
  border-color: rgba(220, 38, 38, 0.9);
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.projectplan-drag-preview.is-resize {
  border-style: solid;
}

body.projectplan-dragging {
  user-select: none;
}

.projectplan-item-bar {
  position: absolute;
  top: 18px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 0.65rem;
  background: rgba(var(--ft-primary-rgb), 0.88);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 650;
  min-width: 34px;
  overflow: hidden;
  z-index: 3;
}

.projectplan-item-bar.has-lead-color {
  background: var(--projectplan-item-color, rgba(var(--ft-primary-rgb), 0.88));
  border-color: color-mix(in srgb, var(--projectplan-item-color, #334155) 54%, #0f172a);
}

.projectplan-item-bar.has-lead-color.status-draft {
  background: color-mix(in srgb, var(--projectplan-item-color, #64748b) 72%, #64748b);
}

.projectplan-item-bar.has-lead-color.status-completed {
  background: color-mix(in srgb, var(--projectplan-item-color, #334155) 44%, #334155);
}

.projectplan-item-bar.is-movable {
  cursor: pointer;
}

.projectplan-item-bar.is-draggable {
  cursor: grab;
  touch-action: none;
}

.projectplan-item-bar.is-draggable:active {
  cursor: grabbing;
}

.projectplan-item-bar.is-dragging {
  opacity: 0.48;
}

.projectplan-item-bar.is-resizing {
  opacity: 0.56;
}

.projectplan-item-bar.is-resizable {
  padding-inline: 0.85rem;
}

.projectplan-resize-handle {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(15, 23, 42, 0.25);
  transform: translateY(-50%);
  z-index: 2;
}

.projectplan-resize-handle.is-start {
  left: 2px;
  cursor: ew-resize;
}

.projectplan-resize-handle.is-end {
  right: 2px;
  cursor: ew-resize;
}

.projectplan-item-bar.status-completed {
  background: rgba(51, 65, 85, 0.88);
}

.projectplan-item-bar.status-draft {
  background: rgba(100, 116, 139, 0.78);
}

.projectplan-item-bar.conflict-warning {
  border-color: rgba(180, 83, 9, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.projectplan-item-bar.conflict-info {
  border-color: rgba(14, 116, 144, 0.5);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.18);
}

.projectplan-item-bar.conflict-blocking {
  border-color: rgba(185, 28, 28, 0.8);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.projectplan-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projectplan-item-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72em;
  opacity: 0.78;
  margin-left: 0.35em;
}

.projectplan-item-signals {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.projectplan-item-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 0 0.2rem;
  min-height: 16px;
  font-size: 0.66rem;
  background: rgba(15, 23, 42, 0.22);
}

.projectplan-item-indicator .material-icons {
  font-size: 0.74rem;
  line-height: 1;
}

.projectplan-item-indicator.is-conflict.is-blocking {
  border-color: rgba(254, 202, 202, 0.9);
  background: rgba(153, 27, 27, 0.55);
}

.projectplan-item-indicator.is-conflict.is-warning {
  border-color: rgba(253, 230, 138, 0.82);
  background: rgba(146, 64, 14, 0.48);
}

.projectplan-item-indicator.is-conflict.is-info {
  border-color: rgba(165, 243, 252, 0.82);
  background: rgba(14, 116, 144, 0.5);
}

.projectplan-item-indicator.is-request {
  border-color: rgba(186, 230, 253, 0.82);
  background: rgba(2, 132, 199, 0.44);
}

.projectplan-item-indicator.is-info-hint {
  border-color: rgba(226, 232, 240, 0.9);
  background: rgba(15, 23, 42, 0.36);
  cursor: help;
}

.projectplan-item-indicator.is-info-hint .material-icons {
  font-size: 0.72rem;
}

.projectplan-item-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
}

.projectplan-item-badge {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.projectplan-item-badge.is-conflict.is-warning {
  background: #f59e0b;
}

.projectplan-item-badge.is-conflict.is-info {
  background: #22d3ee;
}

.projectplan-item-badge.is-conflict.is-blocking {
  background: #ef4444;
}

.projectplan-item-badge.is-request.is-pending {
  background: #06b6d4;
}

.projectplan-item-badge.is-request.is-stale {
  background: #64748b;
}

.projectplan-item-badge.is-planning.is-warning {
  background: #f59e0b;
}

.projectplan-item-badge.is-planning.is-conflict {
  background: #ef4444;
}

.projectplan-item-badge.is-planning.is-unknown {
  background: #64748b;
}

.projectplan-segment {
  position: absolute;
  top: 9px;
  height: 7px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 4;
}

.projectplan-segment-tooltip-target {
  cursor: help;
}

.projectplan-segment.layer-scaffold_setup {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.96), rgba(14, 116, 144, 0.96));
  border: 1px solid rgba(8, 145, 178, 0.68);
  height: 8px;
}

.projectplan-segment.layer-scaffold_dismantle {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  border: 1px solid rgba(217, 119, 6, 0.62);
  height: 8px;
}

.projectplan-segment.layer-team_assignment_window {
  top: 50px;
  height: 5px;
  background: rgba(37, 99, 235, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.56);
  z-index: 6;
}

.projectplan-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(239, 68, 68, 0.8);
  pointer-events: none;
  z-index: 1;
}

.projectplan-item-bar.is-focus {
  box-shadow: 0 0 0 3px rgba(var(--ft-primary-rgb), 0.24);
}

.projectplan-pagination {
  border-top: 1px solid var(--app-border);
  padding: 0.65rem 0.75rem;
  display: flex;
  justify-content: flex-end;
}

[data-projectplan-load-more].is-loading {
  opacity: 0.72;
  cursor: progress;
}

.projectplan-detail-drawer[hidden] {
  display: none;
}

.projectplan-detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 1900;
}

.projectplan-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.52);
}

.projectplan-detail-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(100%, 540px);
  border-left: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.projectplan-detail-head {
  border-bottom: 1px solid var(--app-border);
  padding: 0.82rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.projectplan-detail-head h3 {
  margin: 0;
  font-size: 1rem;
}

.projectplan-detail-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0.82rem 0.95rem 1rem;
  display: grid;
  gap: 0.86rem;
}

.projectplan-detail-project-title {
  margin: 0;
  font-size: 1.05rem;
}

.projectplan-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.55rem;
}

.projectplan-detail-grid > div {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.5rem 0.55rem;
  display: grid;
  gap: 0.12rem;
}

.projectplan-detail-grid span {
  font-size: 0.7rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.projectplan-detail-grid strong {
  font-size: 0.83rem;
  color: var(--app-text);
}

.projectplan-detail-body section h5 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}

.projectplan-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.projectplan-detail-list li {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.45rem 0.52rem;
  display: grid;
  gap: 0.1rem;
}

.projectplan-detail-list li strong {
  font-size: 0.8rem;
}

.projectplan-detail-list li span,
.projectplan-detail-list li em {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.projectplan-detail-list li.is-info {
  border-color: rgba(14, 116, 144, 0.3);
}

.projectplan-detail-list li.is-warning {
  border-color: rgba(217, 119, 6, 0.38);
}

.projectplan-detail-list li.is-blocking {
  border-color: rgba(220, 38, 38, 0.4);
}

.projectplan-detail-list li.is-empty {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.projectplan-detail-actions {
  border-top: 1px solid var(--app-border);
  padding: 0.72rem 0.95rem 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

body.projectplan-detail-open {
  overflow: hidden;
}

.projectplan-inline-link {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 0.12rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.projectplan-inline-link:hover strong {
  text-decoration: underline;
}

.projectplan-item-bar:focus-visible,
.projectplan-inline-link:focus-visible,
.projectplan-request-list-button:focus-visible,
.projectplan-request-detail-actions .boows-btn:focus-visible,
.projectplan-toolbar-actions .boows-btn:focus-visible,
.projectplan-toolbar-actions .boows-submit:focus-visible,
.projectplan-toolbar-actions .boows-icon-button:focus-visible {
  outline: 2px solid rgba(var(--ft-primary-rgb), 0.72);
  outline-offset: 2px;
}

.projectplan-request-drawer[hidden] {
  display: none;
}

.projectplan-request-drawer {
  position: fixed;
  inset: 0;
  z-index: 1890;
}

.projectplan-request-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.5);
}

.projectplan-request-panel {
  position: relative;
  width: 100%;
  height: 100%;
  border-left: 0;
  background: var(--app-surface-solid);
  box-shadow: none;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.projectplan-request-head {
  border-bottom: 1px solid var(--app-border);
  padding: 0.8rem 0.95rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.projectplan-request-head-main h3 {
  margin: 0;
  font-size: 1rem;
}

.projectplan-request-head-main p {
  margin: 0.22rem 0 0;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.projectplan-request-filters {
  border-bottom: 1px solid var(--app-border);
  padding: 0.72rem 0.95rem 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.projectplan-request-filter-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr;
}

.projectplan-request-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  align-items: center;
}

.projectplan-request-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--app-text);
}

.projectplan-request-checkbox input {
  width: 1rem;
  height: 1rem;
}

.projectplan-request-layout {
  min-height: 0;
  display: block;
}

.projectplan-request-list-pane,
.projectplan-request-detail-pane {
  min-height: 0;
}

.projectplan-request-list-pane {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-right: 0;
}

.projectplan-request-list {
  list-style: none;
  margin: 0;
  padding: 0.78rem 0.85rem;
  display: grid;
  gap: 0.45rem;
  overflow-y: auto;
}

.projectplan-request-list-item {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
}

.projectplan-request-list-item.is-selected {
  border-color: rgba(var(--ft-primary-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--ft-primary-rgb), 0.24);
}

.projectplan-request-list-item.status-stale {
  border-color: rgba(148, 163, 184, 0.5);
  background: color-mix(in srgb, var(--app-surface-muted) 78%, #cbd5e1);
}

.projectplan-request-list-button {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0.55rem 0.62rem;
  text-align: left;
  display: grid;
  gap: 0.28rem;
  color: inherit;
  cursor: pointer;
}

.projectplan-request-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.projectplan-request-list-top strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.projectplan-request-list-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.projectplan-request-list-range {
  font-size: 0.74rem;
  color: var(--app-text);
}

.projectplan-request-list-meta {
  display: grid;
  gap: 0.12rem;
}

.projectplan-request-list-meta em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--app-muted);
}

.projectplan-request-list-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.projectplan-request-list-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  padding: 0.1rem 0.42rem;
  font-size: 0.66rem;
  font-weight: 700;
}

.projectplan-request-list-chip.is-decision {
  border-color: rgba(var(--ft-primary-rgb), 0.45);
  background: rgba(var(--ft-primary-rgb), 0.12);
  color: color-mix(in srgb, var(--ft-primary) 78%, #0f172a);
}

.projectplan-request-list-chip.is-conflict.is-blocking {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
}

.projectplan-request-list-chip.is-conflict.is-warning {
  border-color: rgba(180, 83, 9, 0.32);
  background: rgba(251, 191, 36, 0.16);
  color: #92400e;
}

.projectplan-request-list-chip.is-conflict.is-info {
  border-color: rgba(14, 116, 144, 0.32);
  background: rgba(6, 182, 212, 0.14);
  color: #0e7490;
}

.projectplan-request-list-chip.is-conflict.is-none {
  color: var(--app-muted);
}

.projectplan-request-list-chip.is-chat {
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.14);
  color: color-mix(in srgb, var(--ft-primary) 80%, #0f172a);
}

.projectplan-request-list-loading,
.projectplan-request-list-empty,
.projectplan-request-list-error {
  padding: 0.95rem;
  display: grid;
  place-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--app-muted);
}

.projectplan-request-list-error {
  color: #b91c1c;
}

.projectplan-request-pagination {
  border-top: 1px solid var(--app-border);
  padding: 0.68rem 0.85rem 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.projectplan-request-detail-pane {
  border-top: 1px solid var(--app-border);
}

.projectplan-request-detail-placeholder {
  min-height: 220px;
  padding: 1rem;
  display: grid;
  place-items: center;
  gap: 0.42rem;
  color: var(--app-muted);
  text-align: center;
}

.projectplan-request-detail {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.projectplan-request-detail-head {
  border-bottom: 1px solid var(--app-border);
  padding: 0.75rem 0.9rem 0.8rem;
  display: grid;
  gap: 0.35rem;
}

.projectplan-request-detail-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.projectplan-request-detail-back {
  width: fit-content;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  padding: 0.24rem 0.44rem;
  background: var(--app-surface-muted);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.projectplan-request-state-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.projectplan-request-state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  padding: 0.14rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.projectplan-request-state-badge.status-pending {
  border-color: rgba(8, 145, 178, 0.35);
  background: rgba(6, 182, 212, 0.14);
  color: #0f766e;
}

.projectplan-request-state-badge.status-stale {
  border-color: rgba(71, 85, 105, 0.35);
  background: rgba(100, 116, 139, 0.18);
  color: #334155;
}

.projectplan-request-state-badge.status-approved {
  border-color: rgba(21, 128, 61, 0.33);
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.projectplan-request-state-badge.status-rejected {
  border-color: rgba(185, 28, 28, 0.34);
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
}

.projectplan-request-state-badge.status-cancelled {
  color: var(--app-muted);
}

.projectplan-request-state-badge.is-decision {
  border-color: rgba(var(--ft-primary-rgb), 0.42);
  background: rgba(var(--ft-primary-rgb), 0.11);
  color: color-mix(in srgb, var(--ft-primary) 78%, #0f172a);
}

.projectplan-request-detail-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem 0.92rem 0.95rem;
  display: grid;
  gap: 0.82rem;
}

.projectplan-request-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.55rem;
}

.projectplan-request-detail-grid > div {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.46rem 0.52rem;
  display: grid;
  gap: 0.12rem;
}

.projectplan-request-detail-grid span {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--app-muted);
}

.projectplan-request-detail-grid strong {
  font-size: 0.81rem;
}

.projectplan-request-reason,
.projectplan-request-stale-reason,
.projectplan-request-decision-reason {
  margin: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-muted);
  padding: 0.45rem 0.52rem;
  font-size: 0.77rem;
}

.projectplan-request-reject-box {
  border: 1px solid rgba(220, 38, 38, 0.32);
  border-radius: var(--app-radius-md);
  background: color-mix(in srgb, #ef4444 8%, var(--app-surface-solid));
  padding: 0.6rem;
}

.projectplan-request-reject-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.projectplan-request-detail-actions {
  border-top: 1px solid var(--app-border);
  padding: 0.72rem 0.92rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

#boows-table-overlay[data-overlay-type="projectplan-requests"] .boows-table-overlay-header {
  display: none;
}

#boows-table-overlay[data-overlay-type="projectplan-requests"] {
  max-height: 92vh;
  padding: 0;
}

#boows-table-overlay[data-overlay-type="projectplan-requests"] .boows-table-overlay-content {
  padding: 0;
  overflow: hidden;
  display: grid;
}

#boows-table-overlay[data-overlay-type="projectplan-requests"] .projectplan-request-panel {
  height: 100%;
  min-height: 0;
}

#boows-table-overlay[data-overlay-type="projectplan-requests"] [hidden] {
  display: none !important;
}

.boows-popup-bg.projectplan-requests-popup .boows-popup {
  width: min(96vw, 1240px);
  max-width: 96vw;
}

.boows-popup-bg.projectplan-requests-popup .boows-popup-content {
  padding: 0;
  min-height: min(88vh, 880px);
  display: grid;
}

.boows-popup-bg.projectplan-requests-popup .projectplan-request-panel {
  height: 100%;
  min-height: 0;
}

.boows-popup-bg.projectplan-requests-popup [hidden] {
  display: none !important;
}

.boows-popup-bg.projectplan-detail-popup .boows-popup {
  width: min(96vw, 960px);
  max-width: 96vw;
}

.boows-popup-bg.projectplan-detail-popup .boows-popup-content {
  padding: 0;
}

.boows-popup-bg.projectplan-detail-popup .projectplan-detail-panel {
  position: static;
  width: 100%;
  max-width: 100%;
  border-left: 0;
  box-shadow: none;
  max-height: min(88vh, 860px);
}

.boows-popup-bg.projectplan-move-popup .boows-popup {
  width: min(96vw, 880px);
  max-width: 96vw;
}

.boows-popup-bg.projectplan-move-popup .boows-popup-content {
  padding: 0;
}

.boows-popup-bg.projectplan-move-popup .projectplan-modal-card {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#boows-table-overlay[data-overlay-type="projectplan-filters"] .boows-table-overlay-content,
#boows-table-overlay[data-overlay-type="projectplan-layers"] .boows-table-overlay-content,
#boows-table-overlay[data-overlay-type="projectplan-exports"] .boows-table-overlay-content {
  padding: 0.6rem;
}

#boows-table-overlay[data-overlay-type="projectplan-filters"] .projectplan-toolbar-panel,
#boows-table-overlay[data-overlay-type="projectplan-layers"] .projectplan-toolbar-panel,
#boows-table-overlay[data-overlay-type="projectplan-exports"] .projectplan-export-panel {
  display: block !important;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#boows-table-overlay[data-overlay-type="projectplan-filters"] .projectplan-control-title,
#boows-table-overlay[data-overlay-type="projectplan-layers"] .projectplan-control-title,
#boows-table-overlay[data-overlay-type="projectplan-exports"] .projectplan-control-title {
  display: none;
}

#boows-table-overlay[data-overlay-type="projectplan-filters"] .projectplan-filter-bar,
#boows-table-overlay[data-overlay-type="projectplan-layers"] .projectplan-layer-panel {
  padding-top: 0;
}

#boows-table-overlay[data-overlay-type="projectplan-exports"] .projectplan-export-actions {
  padding: 0;
}

@media screen and (min-width: 1025px) {
  #boows-table-overlay[data-overlay-type="projectplan-requests"].is-popup {
    width: min(96vw, 1240px);
    max-width: 96vw;
    max-height: 92vh;
  }
}

@media (min-width: 740px) {
  .projectplan-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projectplan-request-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .projectplan-toolbar-main {
    grid-template-columns: minmax(260px, 1fr) minmax(140px, 180px) minmax(160px, 220px);
  }

  .projectplan-request-layout {
    display: grid;
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    height: 100%;
  }

  .projectplan-request-list-pane {
    border-right: 1px solid var(--app-border);
  }

  .projectplan-request-detail-pane {
    border-top: 0;
  }

  .projectplan-request-detail-back {
    display: none;
  }

  .projectplan-request-layout .projectplan-request-detail-pane {
    display: block !important;
  }
}

@media (min-width: 641px) and (max-width: 899px) {
  .projectplan-toolbar-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .projectplan-range-slider-wrap {
    grid-column: 1 / -1;
  }
}

@media (max-width: 899px) {
  .projectplan-timeline-header,
  .projectplan-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .projectplan-row-label-head,
  .projectplan-row-label {
    padding-left: 0.34rem;
    padding-right: 0.34rem;
  }

  .projectplan-toolbar-subpanels {
    display: none;
  }

  .projectplan-page-actions {
    justify-content: flex-start;
  }

  .projectplan-toolbar-btn-text {
    display: none;
  }
}

@media (max-width: 640px) {
  .projectplan-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .projectplan-timeline-header,
  .projectplan-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .projectplan-row-label-head {
    font-size: 0;
    letter-spacing: 0;
  }

  .projectplan-row-label-head::before {
    content: "Grp";
    font-size: 0.63rem;
    font-weight: 700;
    color: var(--app-muted);
  }

  .projectplan-row-identity {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 0.18rem;
  }

  .projectplan-row-avatar,
  .projectplan-row-avatar-fallback {
    width: 22px;
    height: 22px;
  }

  .projectplan-row-label-main strong,
  .projectplan-row-label-main span {
    display: none;
  }

  .projectplan-row-metrics {
    gap: 0.1rem;
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
  }

  .projectplan-row-metric {
    min-width: 0;
    padding: 0.03rem 0.18rem;
    font-size: 0.6rem;
  }

  .projectplan-row-metric .material-icons {
    font-size: 0.66rem;
  }

  .projectplan-row-metric strong {
    font-size: 0.59rem;
  }

  .projectplan-toolbar-btn-text {
    font-size: 0.72rem;
  }

  .projectplan-item-bar {
    padding: 0 0.48rem;
    font-size: 0.75rem;
  }

  .projectplan-resize-handle {
    display: none;
  }

  .projectplan-detail-panel {
    width: 100%;
  }

  .projectplan-detail-grid {
    grid-template-columns: 1fr;
  }

  .projectplan-move-preview-grid {
    grid-template-columns: 1fr;
  }

  .projectplan-request-layout:not(.is-detail-open) .projectplan-request-detail-pane {
    display: none;
  }

  .projectplan-request-layout.is-detail-open .projectplan-request-list-pane {
    display: none;
  }

  .projectplan-request-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Custom-field layout should use full form width, not only one grid column. */
.form-grid > .cf-layout {
  grid-column: 1 / -1;
  width: 100%;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.cf-visibility-toolbar {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: rgba(59, 130, 246, 0.08);
}

.cf-visibility-toolbar .boows-input-field {
  margin: 0;
}

html[data-theme="dark"] .cf-visibility-toolbar {
  background: rgba(59, 130, 246, 0.16);
}

form.boows-form.full-width {
  max-width: 100% !important;
  width: 100%;
}

/* --------------------------------------------------------
 * Forms: consistent width
 * --------------------------------------------------------
 * Boows defaults to a 700px max-width which feels inconsistent across pages.
 * We standardize form pages to a slightly wider, more readable max-width.
 * Mobile should always use the full available width.
 */
.app-panel form.boows-form:not(.full-width),
.app-panel form[data-boows-form]:not(.full-width) {
  max-width: min(980px, 100%);
  width: 100%;
}

@media (max-width: 720px) {
  .app-panel form.boows-form:not(.full-width),
  .app-panel form[data-boows-form]:not(.full-width) {
    max-width: 100%;
  }
}

/* --------------------------------------------------------
 * Buttons: normalize legacy .boows-submit
 * -------------------------------------------------------- */
.boows-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--boows-button-height, 44px);
  padding: 0 1rem;
  border-radius: var(--boows-button-radius, 14px);
  border: 1px solid var(--boows-col-primary, #1d4ed8);
  background: var(--boows-col-primary, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.boows-submit:hover {
  filter: brightness(0.98);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.boows-submit:active {
  transform: translateY(1px);
  filter: brightness(0.94);
}

.boows-submit.pale {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.24);
  color: var(--boows-col-primary, #1d4ed8);
  box-shadow: none;
}

.boows-submit.no-border {
  border-color: transparent;
}

html[data-theme="dark"] .boows-submit {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .boows-submit.pale {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.24);
}

.cf-options {
  margin-top: 1.25rem;
}

.cf-translation-language-switch {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.cf-translation-language-switch label {
  font-size: 0.82rem;
  color: var(--app-muted);
}

.cf-translation-language-switch .boows-input-field {
  margin: 0;
}

.cf-translation-language-switch .boows-input-field label {
  font-size: 0.82rem;
  color: var(--app-muted);
  margin-bottom: 0.25rem;
}

.cf-translation-panels,
.cf-translation-panel {
  display: grid;
  gap: 0.85rem;
}

.cf-translations {
  border: 1px solid var(--app-border);
  background: rgba(248, 250, 252, 0.65);
}

html[data-theme="dark"] .cf-translations {
  background: rgba(15, 23, 42, 0.28);
}

.cf-group-layout-builder {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

html[data-theme="dark"] .cf-group-layout-builder {
  background: transparent;
}

.cf-group-form-locked .boows-container.readonly .boows-select {
  pointer-events: none;
  opacity: 0.62;
  border-color: var(--app-border) !important;
  background: rgba(148, 163, 184, 0.14) !important;
}

.cf-group-form-locked .boows-container.readonly .boows-select-icon {
  opacity: 0.5;
}

.cf-group-form-locked .boows-container.readonly .boows-select-list {
  display: none !important;
}

.cf-group-form-locked .boows-container.readonly.use-native-on-mobile .boows-select-native,
.cf-group-form-locked .boows-container.readonly.use-native-on-mobile-alternative .boows-select-native {
  pointer-events: none;
}

.cf-group-form-locked .boows-container.readonly .field-prefix,
.cf-group-form-locked .boows-container.readonly .field-suffix {
  opacity: 0.62;
}

.cf-layout-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.cf-breakpoint-switch {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.cf-breakpoint-switch .js-breakpoint-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem !important;
}

.cf-breakpoint-switch .js-breakpoint-btn .material-icons {
  font-size: 18px;
  opacity: 0.9;
}

.cf-tool-btn {
  border: 1px solid var(--app-border) !important;
  color: var(--app-text) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: var(--app-radius-sm) !important;
  min-height: 36px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cf-tool-btn:hover:not(:disabled) {
  border-color: rgba(var(--ft-primary-rgb), 0.35) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  transform: translateY(-1px);
}

.cf-tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.cf-tool-btn .material-icons {
  font-size: 18px;
}

.cf-breakpoint-switch .js-breakpoint-btn.is-active {
  border-color: var(--ft-primary) !important;
  color: #fff !important;
  background: var(--ft-primary) !important;
  box-shadow: 0 8px 18px rgba(var(--ft-primary-rgb), 0.3);
}

.cf-layout-toolbar-actions {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.cf-layout-workbench {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  align-items: start;
}

.cf-layout-pool {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 0.85rem;
  background: rgba(148, 163, 184, 0.06);
  position: sticky;
  top: calc(var(--app-header-height) + 16px);
}

html[data-theme="dark"] .cf-layout-pool,
html[data-theme="dark"] .cf-layout-column-card {
  background: rgba(15, 23, 42, 0.32);
}

.cf-layout-pool h4 {
  margin: 0 0 0.4rem;
  font-size: 0.93rem;
}

.cf-layout-canvas {
  display: grid;
  gap: 0.9rem;
}

.cf-layout-row-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-solid);
  padding: 0.8rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.cf-layout-row-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
}

.cf-layout-row-columns {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.cf-layout-column-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 0.65rem;
  background: rgba(148, 163, 184, 0.04);
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  grid-column: span 12;
}

.cf-layout-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cf-layout-column-key {
  display: inline-flex;
  width: fit-content;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  font-size: 0.74rem;
  color: var(--app-muted);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .cf-layout-column-key {
  background: rgba(241, 245, 249, 0.08);
}

.cf-layout-span-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.cf-layout-span-label {
  font-size: 0.72rem;
}

.cf-layout-span-value {
  min-width: 2ch;
  text-align: center;
  font-size: 0.82rem;
  color: var(--app-text);
}

.cf-layout-row-footer {
  display: flex;
  justify-content: flex-end;
}

.cf-field-dropzone {
  border: 1px dashed var(--app-border);
  border-radius: var(--app-radius-sm);
  min-height: 74px;
  padding: 0.5rem;
  display: grid;
  gap: 0.45rem;
  align-content: start;
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .cf-field-dropzone {
  background: rgba(15, 23, 42, 0.24);
}

.cf-field-dropzone.is-over {
  border-color: var(--ft-primary);
  background: rgba(59, 130, 246, 0.08);
}

.cf-layout-field-chip {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-solid);
  padding: 0.48rem 0.58rem;
  display: grid;
  gap: 0.2rem;
  cursor: grab;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cf-layout-field-chip:hover {
  border-color: rgba(var(--ft-primary-rgb), 0.35);
  box-shadow: 0 6px 14px rgba(var(--ft-primary-rgb), 0.15);
  transform: translateY(-1px);
}

.cf-layout-field-chip strong {
  font-size: 0.85rem;
  line-height: 1.2;
}

.cf-layout-field-chip span {
  font-size: 0.72rem;
  color: var(--app-muted);
}

.cf-layout-empty {
  font-size: 0.78rem;
  color: var(--app-muted);
  padding: 0.25rem 0;
}

.cf-layout {
  display: grid;
  gap: 1rem;
  width: 100%;
}

.cf-group {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}

.cf-group-header {
  display: grid;
  gap: 0.35rem;
}

.cf-group-header.cf-group-header--outside {
  margin: 0;
}

.cf-group-title {
  margin: 0;
  font-size: 1.05rem;
}

.cf-group-header--outside .cf-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--app-muted);
}

.cf-group-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--app-muted);
}

.cf-scope-rule-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.cf-scope-rule-list li {
  margin: 4px 0;
}

.cf-group-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem;
}

.cf-group-grid .boows-input-field > label {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-address-stack {
  display: grid;
  gap: 0.75rem;
  container-type: inline-size;
}

.cf-address-title {
  font-weight: 600;
  color: var(--app-text);
}

.cf-address-grid {
  display: grid;
  gap: 0.75rem;
}

.cf-address-grid:not(.boows-form-grid) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cf-address-grid .boows-input-field {
  margin: 0;
}

.cf-address-zip-city-country {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  --cf-address-gap: 0.5rem;
  gap: 0.5rem;
  align-items: start;
}

.cf-address-zip-city-country > * {
  min-width: 0;
}

.cf-address-zip-city-country .boows-input-field {
  margin: 0;
  min-width: 0;
}

.cf-address-zip-city-country .cf-address-postcode {
  flex: 0 1 calc(20% - (var(--cf-address-gap) * 0.67));
  min-width: 6.25rem;
  max-width: calc(20% - (var(--cf-address-gap) * 0.67));
}

.cf-address-zip-city-country .cf-address-city {
  flex: 1 1 calc(40% - (var(--cf-address-gap) * 0.67));
  min-width: 11.25rem;
}

.cf-address-zip-city-country .cf-address-country {
  flex: 1 1 calc(40% - (var(--cf-address-gap) * 0.67));
  min-width: 11.25rem;
}

.cf-address-zip-city-country .boows-container,
.cf-address-zip-city-country .boows-select,
.cf-address-zip-city-country .boows-select-list {
  width: 100%;
  max-width: 100% !important;
  min-width: 100%;
}

@container (max-width: 29rem) {
  .cf-address-zip-city-country .cf-address-postcode {
    flex: 0 1 calc(30% - (var(--cf-address-gap) * 0.5));
    min-width: 6.25rem;
    max-width: calc(30% - (var(--cf-address-gap) * 0.5));
  }

  .cf-address-zip-city-country .cf-address-city {
    flex: 1 1 calc(70% - (var(--cf-address-gap) * 0.5));
    min-width: 11.25rem;
    max-width: calc(70% - (var(--cf-address-gap) * 0.5));
  }

  .cf-address-zip-city-country .cf-address-country {
    flex-basis: 100%;
    min-width: 11.25rem;
    max-width: 100%;
  }
}

@container (max-width: 24rem) {
  .cf-address-zip-city-country .cf-address-postcode,
  .cf-address-zip-city-country .cf-address-city,
  .cf-address-zip-city-country .cf-address-country {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
}

.cf-radio-group {
  display: grid;
  gap: 0.45rem;
}

.cf-radio-group-title {
  font-weight: 600;
  color: var(--app-text);
}

.cf-field-slot {
  min-width: 0;
  grid-row: var(--cf-row-mobile, auto);
  grid-column: var(--cf-col-start-mobile, 1) / span var(--cf-col-span-mobile, 12);
}

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

.cf-options .cf-options-table.boows-table .boows-table-data .boows-table-row .column {
  align-items: flex-start;
}

.cf-options .cf-options-table.boows-table .column.cf-options-action-col {
  justify-content: center;
}

.cf-options.boows-form-size-sm .boows-input-field {
  margin-bottom: 0;
}

.cf-options.boows-form-size-sm .boows-input-field .boows-input {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}

.cf-options .js-remove-option-row {
  min-width: 2.25rem;
}

.project-custom-group-block {
  margin-top: 0.9rem;
}

.project-custom-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--app-muted);
}

@media (min-width: 768px) {
  .cf-field-slot {
    grid-row: var(--cf-row-tablet, var(--cf-row-mobile, auto));
    grid-column: var(--cf-col-start-tablet, var(--cf-col-start-mobile, 1)) / span var(--cf-col-span-tablet, var(--cf-col-span-mobile, 12));
  }
}

@media (min-width: 900px) {
  .project-toolbar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projectplan-wrap {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    align-items: start;
  }

  .projectplan-list {
    max-height: 70vh;
    overflow: auto;
    position: sticky;
    top: calc(var(--app-header-height) + 16px);
  }
}

@media (min-width: 1024px) {
  .cf-field-slot {
    grid-row: var(--cf-row-desktop, var(--cf-row-tablet, auto));
    grid-column: var(--cf-col-start-desktop, var(--cf-col-start-tablet, 1)) / span var(--cf-col-span-desktop, var(--cf-col-span-tablet, 12));
  }
}

@media (max-width: 1023px) {
  .cf-layout-workbench {
    grid-template-columns: 1fr;
  }

  .cf-layout-pool {
    position: static;
    top: auto;
  }

  .cf-layout-column-card {
    grid-column: span 12 !important;
  }

  .cf-layout-toolbar {
    align-items: stretch;
  }

  .cf-breakpoint-switch,
  .cf-layout-toolbar-actions {
    width: 100%;
  }

  .cf-breakpoint-switch .cf-tool-btn,
  .cf-layout-toolbar-actions .cf-tool-btn {
    flex: 1;
    justify-content: center;
  }

  .cf-layout-row-header {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .cf-address-grid:not(.boows-form-grid) {
    grid-template-columns: 1fr;
  }

  .cf-address-zip-city-country {
    gap: 0.5rem;
  }

  .cf-layout-row-card {
    padding: 0.65rem;
  }

  .cf-layout-column-card {
    padding: 0.55rem;
  }

  .cf-field-dropzone {
    min-height: 62px;
  }

  .cf-layout-field-chip strong {
    font-size: 0.82rem;
  }

  .cf-layout-field-chip span {
    font-size: 0.7rem;
  }
}

/* --------------------------------------------------------
   Image Uploader fixes
   - iOS/Safari sometimes blocks programmatic clicks on display:none file inputs
   - Long file names should not break the layout
   - Allow removing an already selected/uploaded file (handled via app.js)
   -------------------------------------------------------- */
.boows-image-uploader {
  position: relative;
}

.boows-image-uploader-input {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  display: block !important;
}

.boows-image-uploader-details {
  min-width: 0;
}

.boows-image-uploader-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.boows-image-uploader-item {
  position: relative;
}

.boows-image-uploader-delete {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 32px;
  height: 32px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--app-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.boows-image-uploader-delete:hover {
  background: rgba(15, 23, 42, 0.07);
}

html[data-theme="dark"] .boows-image-uploader-delete {
  background: rgba(241, 245, 249, 0.05);
}

html[data-theme="dark"] .boows-image-uploader-delete:hover {
  background: rgba(241, 245, 249, 0.09);
}

fieldset {
  margin: 1.5rem 0 0;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  display: grid;
  gap: 0.65rem 1.25rem;
}

fieldset legend {
  padding: 0 0.5rem;
  color: var(--app-muted);
  font-weight: 600;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.module-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.module-actions .boows-input-field {
  margin: 0;
}

.module-actions .module-toggle-form {
  margin: 0;
}

/* Action buttons inside tables should not add extra vertical spacing */
.boows-table .boows-action-button-bar.inline-actions {
  margin: 0;
}

.boows-table .table-btn-box .boows-table-action-icon,
.boows-table .table-btn-box .boows-table-actions-more {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
  color: var(--app-text);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.boows-table .table-btn-box .boows-table-action-icon:hover,
.boows-table .table-btn-box .boows-table-actions-more:hover {
  border-color: color-mix(in srgb, var(--ft-primary) 45%, var(--app-border));
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-muted));
  color: var(--app-text);
  transform: translateY(-1px);
}

.boows-table .table-btn-box .boows-table-action-icon .material-icons,
.boows-table .table-btn-box .boows-table-actions-more .material-icons {
  font-size: 20px;
  line-height: 1;
  background: transparent;
}

.boows-action-button.danger .material-icons {
  background: var(--app-danger);
}

/* Sticky action column background should match current theme */
.boows-table.scroll-table .scroll-table-action-column {
  background: rgba(255, 255, 255, 0.86);
}

html[data-theme="dark"] .boows-table.scroll-table .scroll-table-action-column {
  background: rgba(17, 24, 39, 0.85);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill.status-on {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.25);
}

.status-pill.status-off {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.4);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15);
  object-fit: cover;
  background: var(--app-surface-muted);
}

.user-avatar.user-avatar--empty {
  display: grid;
  place-items: center;
  color: var(--app-muted);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
}

.user-avatar.user-avatar--empty .material-icons {
  font-size: 18px;
}

.user-avatar.user-avatar--initials {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #134e4a;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(20, 184, 166, 0.14));
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.user-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.user-display {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.user-display-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.user-display-avatar-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.user-display-avatar-wrap--with-status {
  position: relative;
}

/* Online-status dot, positioned at the bottom-right of the avatar. */
.user-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 30%;
  min-width: 9px;
  max-width: 14px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid var(--app-surface-solid, #ffffff);
  background: var(--app-muted, #94a3b8);
  pointer-events: none;
  box-shadow: 0 0 0 0.5px rgba(15, 23, 42, 0.12);
}

.user-status-dot.is-online {
  background: var(--app-presence-online);
}

.user-status-dot.is-offline {
  background: var(--app-presence-offline);
}

/* Until the status endpoint resolves, keep the dot hidden to avoid a flash. */
.user-status-dot.is-unknown {
  display: none;
}

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

/* Inline presence indicator: a coloured dot plus the spelled-out status label.
   Used where the meaning of the avatar's status dot must be explicit (e.g. the
   contact profile header). Hidden until the presence module resolves a state. */
.presence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--app-muted);
  white-space: nowrap;
}

.presence-indicator.is-unknown {
  display: none;
}

.presence-indicator-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--app-muted, #94a3b8);
}

.presence-indicator.is-online .presence-indicator-dot {
  background: var(--app-presence-online);
}

.presence-indicator.is-offline .presence-indicator-dot {
  background: var(--app-presence-offline);
}

.user-display-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-display-name {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-display-subtitle {
  margin-top: 0.08rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-display-meta {
  margin-top: 0.1rem;
  font-size: 0.76rem;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-display-badges {
  margin-top: 0.14rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.user-display-actions {
  margin-top: 0.22rem;
}

.user-display-avatar.user-avatar,
.user-display-avatar--size-normal.user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.user-display-avatar--size-compact.user-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.user-display-avatar--size-large.user-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.user-display-avatar--size-xl.user-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}

.user-display--size-compact .user-display-name {
  font-size: 0.88rem;
}

.user-display--size-compact .user-display-subtitle {
  font-size: 0.74rem;
}

.user-display--size-large .user-display-name {
  font-size: 0.98rem;
}

.user-display--size-large .user-display-subtitle {
  font-size: 0.82rem;
}

.user-display--size-xl .user-display-name {
  font-size: 1.08rem;
}

.user-display--size-xl .user-display-subtitle {
  font-size: 0.9rem;
}

.user-display--hero,
.user-display--detail {
  align-items: flex-start;
  gap: 0.85rem;
}

.user-display--hero .user-display-main,
.user-display--detail .user-display-main {
  line-height: 1.22;
}

.user-display--hero .user-display-name,
.user-display--detail .user-display-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.user-display--hero .user-display-subtitle,
.user-display--detail .user-display-subtitle {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.user-display--card {
  display: flex;
  width: 100%;
}

.user-display--clickable:hover .user-display-name,
.user-display--clickable:focus-visible .user-display-name {
  text-decoration: underline;
}

.contacts-avatar-display,
.admin-users-avatar-display,
.project-contact-avatar-display,
.team-role-display,
.team-member-display {
  display: inline-flex;
}

.contacts-avatar-display-main,
.admin-users-avatar-display-main,
.project-contact-avatar-display-main,
.team-role-display-main,
.team-member-display-main {
  display: none;
}

.user-inline-avatar.user-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.user-inline-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-inline-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-inline-role {
  margin-top: 0.08rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-display,
.vehicle-display-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.vehicle-display-avatar.user-inline-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  object-fit: cover;
}

.vehicle-display-avatar--empty.user-inline-avatar {
  color: var(--app-muted, #64748b);
  background: var(--app-surface-muted, #f8fafc);
  border: 1px solid var(--app-border, rgba(0, 0, 0, 0.08));
}

.vehicle-display-avatar--empty .material-icons {
  font-size: 18px;
  line-height: 1;
}

.vehicle-display-main {
  min-width: 0;
}

.vehicle-display-label,
.vehicle-display-meta {
  display: block;
}

/* User Card View */
.user-card {
  position: relative;
  overflow: visible;
  border-radius: 16px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
}

.user-card--directory .user-card-banner {
  height: 72px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--ft-primary) 86%, #ffffff) 0%,
    color-mix(in srgb, var(--ft-primary) 58%, #ffffff) 100%
  );
}

.user-card--directory .user-card-inner {
  position: relative;
  margin-top: -28px;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.user-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.user-card-avatar .user-avatar {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.2);
  background: color-mix(in srgb, var(--app-surface-muted) 86%, #cbd5e1);
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-role {
  margin-top: 0.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-muted);
}

.user-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.user-card-email {
  font-size: 0.85rem;
  color: var(--app-muted);
  max-width: min(72%, 250px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-status {
  display: inline-flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.22rem;
  justify-content: flex-end;
}

.user-card-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.32rem 0.65rem;
  border: 1px solid transparent;
  line-height: 1.15;
  white-space: nowrap;
}

.user-card-status-pill--active {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.user-card-status-pill--inactive {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.user-card-status-pill--vacation {
  color: #92400e;
  background: #ffedd5;
  border-color: #fdba74;
}

.user-card-status-pill--sick {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}

.user-card-status-pill--available {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.user-card-status-pill--not_sv_registered,
.user-card-status-pill--unavailable {
  color: #334155;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.user-card-status-pill--time_off,
.user-card-status-pill--parental_leave,
.user-card-status-pill--paternity_month,
.user-card-status-pill--special_leave_unpaid {
  color: #92400e;
  background: #ffedd5;
  border-color: #fdba74;
}

.user-card-status-pill--unknown,
.user-card-status-pill--pending {
  color: #334155;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.user-card-status-detail {
  font-size: 0.66rem;
  color: var(--app-muted);
  line-height: 1.2;
  text-align: right;
}

.user-card-quick {
  border-top: 1px solid var(--app-border);
  padding-top: 0.75rem;
}

.user-card-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.user-card-quick-link {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.user-card-quick-link:hover {
  transform: translateY(-1px);
}

.user-card-quick-link .material-icons {
  font-size: 18px;
}

.user-card-quick-link--email:hover {
  border-color: color-mix(in srgb, #2563eb 45%, var(--app-border));
  background: color-mix(in srgb, #2563eb 12%, var(--app-surface-muted));
}

.user-card-quick-link--whatsapp:hover {
  border-color: color-mix(in srgb, #16a34a 45%, var(--app-border));
  background: color-mix(in srgb, #16a34a 12%, var(--app-surface-muted));
}

.user-card-quick-link--call:hover {
  border-color: color-mix(in srgb, #d97706 45%, var(--app-border));
  background: color-mix(in srgb, #d97706 12%, var(--app-surface-muted));
}

.user-card-quick-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 42px;
}

.boows-card-item--directory {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.contacts-table--card-only .scroll-container,
.contacts-table--card-only .boows-view-toggle,
.contacts-table--card-only .filter-column {
  display: none !important;
}

.contacts-table--card-only .boows-card-view {
  display: grid !important;
}

.user-card-menu {
  position: relative;
}

.user-card-menu > summary {
  list-style: none;
}

.user-card-menu > summary::-webkit-details-marker {
  display: none;
}

.user-card-menu-trigger {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--app-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.user-card-menu[open] .user-card-menu-trigger {
  background: transparent;
}

.user-card-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  z-index: 20;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-solid);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  padding: 0.35rem;
  display: none;
}

.user-card-menu[open] .user-card-menu-panel {
  display: block;
}

.user-card-menu-panel .boows-actions-inline-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-card-menu-panel .boows-action-button {
  width: 100%;
  min-height: 36px;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  background: transparent;
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.user-card-menu-panel .boows-action-button:hover {
  background: rgba(148, 163, 184, 0.14);
}

.user-card-menu-panel .boows-action-button::after {
  content: attr(data-action-label);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--app-text);
}

.user-card-menu-panel .boows-action-button .material-icons {
  width: 20px;
  height: 20px;
  min-width: 20px;
  font-size: 18px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.user-card-menu-panel form {
  display: none !important;
}

.user-card-actions--single .boows-actions-inline-wrap {
  display: flex;
}

.user-card-actions--single .boows-action-button {
  min-height: 34px;
  height: 34px;
  padding: 0 0.2rem 0 0;
  border-radius: 8px;
  background: transparent;
  color: var(--app-text);
  gap: 0.35rem;
}

.user-card-actions--single .boows-action-button:hover {
  background: rgba(148, 163, 184, 0.14);
}

.user-card-actions--single .boows-action-button::after {
  content: attr(data-action-label);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--app-text);
  line-height: 1.2;
}

.user-card-actions--single .boows-action-button .material-icons {
  width: 20px;
  height: 20px;
  min-width: 20px;
  line-height: 20px;
  font-size: 18px;
  background: transparent;
}

.user-card-quick--split {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.user-card-quick-main {
  display: flex;
  align-items: center;
}

.user-card-quick-view {
  margin-left: auto;
}

.user-card-quick-view .boows-actions-inline-wrap {
  display: flex;
}

.user-card--contacts .user-card-quick-view .boows-action-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-card--contacts .user-card-quick-view .boows-action-button:hover {
  border-color: color-mix(in srgb, var(--ft-primary) 45%, var(--app-border));
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-muted));
}

.user-card--contacts .user-card-quick-view .boows-action-button::after {
  content: none;
}

.user-card--contacts .user-card-quick-view .boows-action-button .material-icons {
  width: 20px;
  height: 20px;
  min-width: 20px;
  line-height: 20px;
  font-size: 22px;
  background: transparent;
}

.user-card--contacts.user-card--contacts-compact .user-card-inner {
  margin-top: 0;
  padding: 0.65rem 0.75rem;
  gap: 0;
}

.user-card--contacts.user-card--contacts-compact .user-card-header {
  align-items: center;
  gap: 0.6rem;
}

.user-card--contacts.user-card--contacts-compact .user-card-avatar .user-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  box-shadow: none;
}

.user-card--contacts.user-card--contacts-compact .user-card-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.user-card--contacts.user-card--contacts-compact .user-card-role-row {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: -0.14rem;
  min-width: 0;
}

.user-card--contacts.user-card--contacts-compact .user-card-role {
  margin-top: 0;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: color-mix(in srgb, var(--app-text) 72%, #166534);
  background: color-mix(in srgb, #16a34a 8%, transparent);
  border: none;
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  white-space: nowrap;
}

.user-card--contacts.user-card--contacts-compact .user-card-actions {
  min-width: 0;
}

.user-card--contacts.user-card--contacts-compact .contact-card-actions-inline {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.user-card--contacts.user-card--contacts-compact .contact-card-actions-inline .boows-actions-inline-wrap {
  display: flex;
  align-items: center;
  gap: 0.32rem;
}

.user-card--contacts .contact-card-actions-inline .boows-action-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-card--contacts .contact-card-actions-inline .boows-action-button:hover {
  border-color: color-mix(in srgb, var(--ft-primary) 45%, var(--app-border));
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-muted));
}

.user-card--contacts .contact-card-actions-inline .boows-action-button.disabled {
  opacity: 0.42;
}

.user-card--contacts .contact-card-actions-inline .boows-action-button::after {
  content: none;
}

.user-card--contacts .contact-card-actions-inline .boows-action-button .material-icons {
  width: 19px;
  height: 19px;
  min-width: 19px;
  line-height: 19px;
  font-size: 20px;
  background: transparent;
}

.user-card--contacts .contact-card-actions-inline .boows-action-button.contact-action-details {
  display: none;
}

.user-card--contacts.user-card--contacts-compact .contact-card-actions-mobile {
  display: none;
  min-width: 34px;
  justify-content: flex-end;
}

.user-card--contacts.user-card--contacts-compact .user-card-menu-trigger {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.contact-card-actions-source {
  display: none !important;
}

.contacts-table-section.app-panel.table-card {
  overflow: visible;
}

.contacts-sort-filter {
  min-width: 230px;
}

.contacts-sort-filter .boows-input-field {
  margin: 0;
}

.contacts-sort-filter .boows-container {
  min-width: 230px;
}

@media (min-width: 761px) and (max-width: 1599px) {
  .contacts-table--card-only .boows-card-grid--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .contacts-table-section.app-panel.table-card {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.5rem 0.55rem 0.65rem;
  }

  .boows-table-overlay[data-overlay-type="filter"] .boows-table-overlay-handle.topbar-page-actions-handle,
  .boows-table-overlay[data-overlay-type="actions"] .boows-table-overlay-handle.topbar-page-actions-handle,
  .boows-table-overlay[data-overlay-type="page-size"] .boows-table-overlay-handle.topbar-page-actions-handle {
    display: block;
  }

  .boows-table .search-table-box .boows-form .search-wrapper {
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }

  .boows-table .search-table-box .boows-form .search-wrapper .boows-input-field {
    width: 100%;
  }

  .user-card--directory .user-card-banner {
    height: 62px;
  }

  .user-card--directory .user-card-inner {
    margin-top: -24px;
    padding: 0 0.85rem 0.85rem;
  }

  .user-card-email {
    max-width: 68%;
  }

  .user-card-actions {
    min-width: 42px;
  }

  .user-card-menu-panel {
    min-width: 200px;
    right: -2px;
  }
}

@media (max-width: 760px) {
  .contacts-table--card-only .boows-card-view {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }

  .user-card--contacts.user-card--contacts-compact .user-card-inner {
    padding: 0.5rem 0.62rem;
  }

  .user-card--contacts.user-card--contacts-compact .contact-card-actions-inline {
    display: none;
  }

  .user-card--contacts.user-card--contacts-compact .contact-card-actions-mobile {
    display: flex;
  }

  .user-card--contacts.user-card--contacts-compact .user-card-avatar .user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .user-card--contacts.user-card--contacts-compact .user-card-name {
    font-size: 0.96rem;
  }

  .user-card--contacts.user-card--contacts-compact .user-card-role {
    font-size: 0.75rem;
  }

  .user-card-type-chip {
    font-size: 0.64rem;
    padding: 0.14rem 0.36rem;
  }

  .user-card--contacts.user-card--contacts-compact .user-card-menu-trigger {
    width: 30px;
    height: 30px;
  }

  .user-card--contacts.user-card--contacts-compact .user-card-menu-panel {
    min-width: 184px;
  }
}

@media (min-width: 900px) {
  .project-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.dashboard-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-radius: var(--boows-default-border-container, var(--app-radius-lg));
  border: 1px solid var(--app-border);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.settings-form {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 100% !important;
}

.settings-section {
  display: grid;
  gap: 1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--app-border);
}

.settings-section:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.settings-section.settings-section--stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-links {
  display: grid;
  gap: 1rem;
}

.settings-title {
  margin: 0;
  font-size: 1.05rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--app-border);
}

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

.settings-grid .setting-item--span {
  grid-column: 1 / -1;
}

.settings-grid .form-grid-span {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.settings-note {
  margin-top: 0.4rem;
}

.cache-status-grid,
.cache-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.cache-status-card {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(var(--ft-primary-rgb), 0.06), rgba(148, 163, 184, 0.08));
  padding: 0.68rem 0.72rem;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
}

.cache-status-card--wide {
  grid-column: 1 / -1;
}

.cache-status-label {
  font-size: 0.74rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--app-muted);
}

.cache-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.22rem 0.58rem;
  width: fit-content;
  max-width: 100%;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cache-chip--success {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.28);
}

.cache-chip--danger {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.28);
}

.cache-chip--warning {
  background: rgba(217, 119, 6, 0.14);
  color: #9a3412;
  border-color: rgba(217, 119, 6, 0.3);
}

.cache-chip--info {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.28);
}

.cache-chip--neutral {
  background: rgba(148, 163, 184, 0.16);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.32);
}

html[data-theme="dark"] .cache-status-card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .cache-status-label {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .cache-chip--success {
  color: #86efac;
  border-color: rgba(22, 163, 74, 0.4);
}

html[data-theme="dark"] .cache-chip--danger {
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.42);
}

html[data-theme="dark"] .cache-chip--warning {
  color: #fdba74;
  border-color: rgba(217, 119, 6, 0.42);
}

html[data-theme="dark"] .cache-chip--info {
  color: #93c5fd;
  border-color: rgba(37, 99, 235, 0.44);
}

html[data-theme="dark"] .cache-chip--neutral {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.42);
}

.cache-test-result {
  margin-top: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.92rem;
  border: 1px solid transparent;
  line-height: 1.4;
}

.cache-test-result--pending {
  background: rgba(148, 163, 184, 0.16);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.32);
}

.cache-test-result--success {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.32);
}

.cache-test-result--error {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.32);
}

html[data-theme="dark"] .cache-test-result--pending { color: #cbd5e1; }
html[data-theme="dark"] .cache-test-result--success { color: #86efac; }
html[data-theme="dark"] .cache-test-result--error { color: #fca5a5; }

.settings-api-key-status {
  margin-top: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-api-key-status-label {
  font-size: 0.72rem;
}

.settings-pdf-font-status-detail {
  margin-top: 0.3rem;
  font-size: 0.72rem;
}

.settings-form .settings-language-select--active .boows-select-box-container {
  margin-top: 0.4rem;
}

.settings-form .settings-language-select--active .boows-select-box-container .boows-select-item {
  cursor: pointer;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: rgba(var(--ft-primary-rgb), 0.08);
  padding: 0.32rem 0.9rem 0.32rem 0.65rem;
}

.settings-form .settings-language-select--active .boows-select-box-container .boows-select-item:hover {
  background: rgba(var(--ft-primary-rgb), 0.14);
  border-color: rgba(var(--ft-primary-rgb), 0.45);
}

.settings-form .settings-language-select--active .boows-select-box-container .boows-select-item.selected::after {
  color: var(--app-danger);
}

.settings-form .settings-language-select--default .boows-select-list .boows-select-item.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.settings-form .boows-image-uploader {
  display: block;
}

.settings-form .boows-color-picker .clr-field input {
  color: var(--app-text) !important;
}

.settings-placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.settings-placeholder-chips code {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(var(--ft-primary-rgb), 0.08);
  font-size: 0.82rem;
}

.email-layout-accordion {
  display: grid;
  gap: 0.8rem;
}

.email-layout-accordion .menu-item {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-solid);
  overflow: hidden;
}

.email-layout-accordion .menu-title {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--app-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-weight: 600;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.email-layout-accordion .menu-title .material-icons {
  color: var(--app-muted);
  transition: transform 0.2s ease;
}

.email-layout-accordion .menu-item.active .menu-title .material-icons {
  transform: rotate(180deg);
}

.email-layout-accordion .menu-options {
  padding: 0 1rem 1rem;
}

.email-designer-split {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.email-designer-split-pane--controls {
  min-width: 0;
  --boows-max-input-width: 100%;
}

.email-designer-split-pane--controls .settings-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
}

.email-designer-split-pane--controls .boows-input-field {
  width: 100%;
  max-width: 100%;
}

.email-designer-split-pane--controls .setting-item,
.email-designer-split-pane--controls .boows-input-inner-box,
.email-designer-split-pane--controls .boows-input-wrapper,
.email-designer-split-pane--controls .boows-select,
.email-designer-split-pane--controls .boows-select-box-button,
.email-designer-split-pane--controls .boows-container {
  min-width: 0;
  max-width: 100%;
}

.email-designer-split-pane--controls .boows-input-wrapper input,
.email-designer-split-pane--controls .boows-input-wrapper textarea,
.email-designer-split-pane--controls .boows-input-wrapper select {
  max-width: 100% !important;
}

.email-designer-split-pane--preview {
  min-width: 0;
  align-self: start;
  position: sticky;
  top: 0.75rem;
  height: fit-content;
}

.email-designer-split-pane--preview .settings-section {
  margin-top: 0;
  position: static;
}

.email-template-preview-frame-wrap {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  overflow: hidden;
  background: #fff;
}

.email-template-preview-frame {
  width: 100%;
  min-height: 620px;
  height: calc(100vh - 6.5rem);
  border: 0;
  display: block;
  background: #fff;
}

.settings-form .boows-input-field > label {
  text-align: left !important;
}

.email-template-html-editor {
  --boows-max-input-width: 100%;
}

.setting-item[data-setting-key="email_template_body_html"] .boows-html-editor,
.setting-item[data-setting-key="email_template_footer"] .boows-html-editor,
.setting-item[data-setting-key="email_template_body_html"] .boows-html-editor .tox-tinymce,
.setting-item[data-setting-key="email_template_footer"] .boows-html-editor .tox-tinymce {
  width: 100%;
  max-width: 100% !important;
}

.email-align-select-button .boows-select-button,
.email-image-source-select-button .boows-select-button {
  display: flex;
  width: 100%;
  margin: 0;
}

.email-align-select-button .boows-select-button-option,
.email-image-source-select-button .boows-select-button-option {
  flex: 1 1 0;
  justify-content: center;
  padding: 0.5rem 0.45rem;
}

.email-align-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.email-align-option .material-icons {
  font-size: 19px;
  line-height: 1;
}

.email-image-source-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.email-image-source-option .material-icons {
  font-size: 18px;
  line-height: 1;
}

.email-image-width-inline {
  display: grid;
  gap: 0.35rem;
}

.email-image-align-control .boows-input-field {
  margin-bottom: 0.45rem;
}

.email-image-width-inline__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 0.55rem;
  align-items: end;
}

.email-image-width-inline__value .boows-input-field,
.email-image-width-inline__unit .boows-input-field {
  margin-bottom: 0;
}

.email-image-width-inline__unit .boows-select,
.email-image-width-inline__unit .boows-container,
.email-image-width-inline__unit .boows-select-native {
  width: 100%;
  max-width: 100%;
}

.email-spacing-editor {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 0.65rem 0.65rem 0.7rem;
  background: rgba(var(--ft-primary-rgb), 0.04);
}

.email-spacing-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.email-spacing-editor__label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--app-text);
}

.email-spacing-link-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: #fff;
  color: var(--app-muted);
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.email-spacing-link-toggle.is-linked {
  color: var(--ft-primary);
  border-color: rgba(var(--ft-primary-rgb), 0.42);
  background: rgba(var(--ft-primary-rgb), 0.1);
}

.email-spacing-link-toggle .material-icons {
  font-size: 15px;
}

.email-spacing-editor__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.email-spacing-side {
  display: grid;
  gap: 0.2rem;
}

.email-spacing-side > span {
  font-size: 0.68rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.email-spacing-side input[type="number"] {
  width: 100%;
  height: 2.1rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  font-size: 0.84rem;
  box-sizing: border-box;
  text-align: center;
}


.auth-page::before {
  width: 60vw;
  height: 60vw;
  top: -20vw;
  left: -15vw;
}

.auth-page::after {
  width: 55vw;
  height: 55vw;
}

.login-container,
.setup-page {
  width: min(960px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.login-container {
  width: min(460px, 100%);
}



.auth-shell {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  width: min(1200px, 100%);
}

.auth-panel {
  width: 100%;
}

.auth-visual {
  display: none;
}

.auth-visual-card {
  background: linear-gradient(150deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.85));
  color: #f8fafc;
  padding: 2.5rem;
  border-radius: var(--app-radius-xl);
  box-shadow: var(--app-shadow);
  display: grid;
  gap: 1.5rem;
}

.auth-visual-card h2 {
  margin: 0;
  font-size: 2rem;
}

.auth-visual-card p {
  margin: 0;
  color: rgba(248, 250, 252, 0.8);
}

.auth-visual-list {
  display: grid;
  gap: 0.85rem;
}

.auth-visual-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-weight: 600;
}

.auth-visual-item .material-icons {
  color: rgba(255, 255, 255, 0.85);
}

.auth-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-logo img {
  max-width: 180px;
}

.auth-header {
  text-align: center;
}

.auth-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
}

.auth-header p {
  margin: 0;
  color: var(--app-muted);
}

.auth-card {
  background: var(--app-surface-solid);
  border-radius: var(--app-radius-xl);
  border: 1px solid var(--app-border);
  padding: 2rem;
  box-shadow: var(--app-shadow);
}

.auth-actions {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.auth-actions .boows-btn {
  width: 100%;
  justify-content: center;
}

.login-recaptcha {
  margin-top: 1rem;
}

.login-recaptcha.is-hidden {
  display: none;
}

.login-recaptcha .g-recaptcha > div {
  margin: 0 auto;
}

.boows-login-captcha {
  display: grid;
  gap: 0.85rem;
}

.boows-login-captcha-instruction {
  margin: 0;
  font-size: 0.92rem;
  color: var(--app-muted);
}

.boows-login-captcha-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.boows-login-captcha-option {
  appearance: none;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  min-height: 2.4rem;
  padding: 0.2rem 0.45rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.boows-login-captcha-option:hover {
  transform: translateY(-1px);
}

.boows-login-captcha-option.is-selected {
  border-color: rgba(var(--ft-primary-rgb), 0.7);
  box-shadow: 0 0 0 2px rgba(var(--ft-primary-rgb), 0.25);
}

.boows-login-captcha-option.color-green { background: #e7f8eb; color: #176f33; }
.boows-login-captcha-option.color-blue { background: #e8f1ff; color: #1a4fa5; }
.boows-login-captcha-option.color-red { background: #ffe9e9; color: #a62a2a; }
.boows-login-captcha-option.color-orange { background: #fff2e4; color: #a5530d; }
.boows-login-captcha-option.color-black { background: #eceff4; color: #1f2937; }
.boows-login-captcha-option.color-purple { background: #f3ebff; color: #5a2e9e; }

@media (max-width: 560px) {
  .boows-login-captcha-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.setup-grid .setup-span-full {
  grid-column: span 2;
}

.setup-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.setup-note {
  font-size: 0.85rem;
  color: var(--app-muted);
  margin-top: 1rem;
}

.setup-actions {
  justify-content: center;
}

.setup-complete {
  text-align: center;
}

.setup-check {
  font-size: 3rem;
  color: var(--ft-primary);
  margin-bottom: 1rem;
}

.inbox-tabs {
  display: inline-flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.inbox-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: transparent;
  color: var(--app-muted);
  font-weight: 700;
  cursor: pointer;
}

.inbox-tab.is-active {
  background: #ffffff;
  color: var(--app-text);
  box-shadow: var(--app-shadow-soft);
}

.inbox-tab-content[hidden] {
  display: none !important;
}

.mobile-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
}

.mobile-search-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(2px);
}

.mobile-search-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--app-surface-solid);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid var(--app-border);
  border-bottom: 0;
  padding: 0.9rem 0.85rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--app-shadow-soft);
}

.mobile-search-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.mobile-search-input {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-muted);
  color: var(--app-text);
  font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
}

.mobile-search-close {
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--app-muted);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-search-results {
  margin-top: 0.65rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  max-height: 58vh;
  overflow: auto;
}

.mobile-search-open {
  overflow: hidden;
}

.app-mobile-footer-menu {
  display: none;
  view-transition-name: none;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.bottom-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  height: 72px;
  padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
  view-transition-name: app-bottom-nav;
  transform: translateZ(0);
  contain: layout paint;
}

.bottom-tabbar-item {
  position: relative;
  flex: 1 1 20%;
  border: 0;
  text-decoration: none;
  color: var(--app-muted);
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bottom-tabbar-item i {
  font-size: 1.28rem;
}

.bottom-tabbar-item.active {
  color: var(--ft-primary);
}

.bottom-tabbar-badge {
  position: absolute;
  top: 0.12rem;
  right: 0.62rem;
  min-width: 16px;
  height: 16px;
  font-size: 0.62rem;
  padding: 0 4px;
}

.bottom-tabbar-avatar {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--app-border);
}

@media (min-width: 901px) {
  .app-mobile-footer-menu {
    display: none !important;
  }

  .bottom-tabbar,
  .mobile-search-overlay {
    display: none !important;
  }
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 460px);
  height: 72px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-xl);
  z-index: 220;
  padding: 0.5rem 0.75rem;
  justify-content: space-around;
  backdrop-filter: blur(16px);
  box-shadow: var(--app-shadow-soft);
  view-transition-name: app-bottom-nav;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bottom-nav-item.active {
  color: var(--ft-primary);
}

.nav-icon-text {
  font-size: 1.4rem;
  line-height: 1;
}

@media (max-width: 900px) {
  :root {
    --boows-max-input-width: 100%;
  }

  .app-wrapper {
    grid-template-columns: 1fr;
  }

  body.app-auth .app-wrapper {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  .app-header {
    display: none;
  }

  .bottom-tabbar {
    display: flex;
  }

  .app-mobile-footer-menu {
    display: block;
  }

  .app-content {
    grid-column: 1;
    padding: 1rem 0.75rem 1.5rem;
  }

  .app-breadcrumb {
    display: none;
  }

  body.app-auth:not(.layout-chat-fullscreen) .app-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 1rem);
  }

  body.layout-chat-fullscreen .app-content {
    padding: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Less visual noise on mobile: tighter cards, better use of width */
  body.app-auth .page-header {
    padding-bottom: 0.25rem;
  }

  body.app-auth .app-panel,
  body.app-auth .app-card {
    padding: 0.75rem;
    border-radius: var(--app-radius-lg);
  }

  .settings-form .settings-section {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .settings-form .settings-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .settings-form .setting-item {
    min-width: 0;
  }

  /* The Boows tab containers are grid items with min-width:auto, so the nowrap
   * tab bar forced them (and every field inside) far wider than the viewport —
   * the form ran off-screen and couldn't be scrolled. Let them shrink to the
   * grid track; the tab bar scrolls internally (overflow-x:auto). */
  .settings-form .boows_tab_container,
  .settings-form .tab_bar,
  .settings-form .tab_content,
  .settings-form .tab_item_content {
    min-width: 0;
    max-width: 100%;
  }

  .settings-form .boows-input-field,
  .settings-form .boows-input-inner-box,
  .settings-form .boows-input-wrapper,
  .settings-form .boows-container,
  .settings-form .boows-select,
  .settings-form .boows-image-uploader,
  .settings-form .boows-html-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .settings-form .boows-input-wrapper input,
  .settings-form .boows-input-wrapper textarea,
  .settings-form .boows-input-wrapper select {
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
  }

  .email-template-preview-frame {
    min-height: 420px;
    height: 420px;
  }

  .email-designer-split {
    grid-template-columns: 1fr;
  }

  .email-designer-split-pane--preview {
    position: static;
    top: auto;
  }

  .email-designer-split-pane--preview .settings-section {
    position: static;
    top: auto;
  }

  .app-content > .app-panel.table-card {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .auth-shell.auth-shell-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-shell.auth-shell-single .auth-panel {
    display: flex;
    justify-content: center;
  }

  .auth-visual {
    display: block;
  }

  .login-container,
  .setup-page {
    width: min(460px, 100%);
  }

  .auth-logo {
    justify-content: center;
  }

  .auth-header {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .page-title h1,
  .app-content h1 {
    font-size: 1.35rem;
  }

  body.app-auth .app-content {
    padding: 0.9rem 0.75rem 1.5rem;
  }

  .app-content.full-width {
    padding: 2.25rem 1rem;
  }

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

  .setup-grid .setup-span-full {
    grid-column: span 1;
  }

  .setup-subgrid {
    grid-template-columns: 1fr;
  }

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

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

  .form-grid .form-grid-span {
    grid-column: span 1;
  }
}

@media (min-width: 900px) {
  fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  fieldset legend {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1400px) {
  .app-content {
    padding: 3rem 4rem 4rem;
  }

  .page-header {
    padding: 1.5rem 2rem;
  }
}

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

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

@keyframes appFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes appFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* --------------------------------------------------------
   Header/Sidebar UI tools (Language + Theme)
   -------------------------------------------------------- */
.ui-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.ui-select {
  width: 100%;
  border: 1px solid rgba(var(--boows-col-text-rgb), 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--boows-col-text);
  padding: 10px 12px;
  border-radius: var(--boows-border-radius-button);
  font-size: 14px;
  outline: none;
}

.ui-theme-toggle {
  height: 42px;
  min-width: 42px;
  border: 1px solid rgba(var(--boows-col-text-rgb), 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--boows-col-text);
  border-radius: var(--boows-border-radius-button);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--boows-transition);
}

.ui-theme-toggle:hover {
  transform: translateY(-1px);
}

/* --------------------------------------------------------
   Dark Mode (App + Boows Variables)
   -------------------------------------------------------- */
:root[data-theme="dark"] {
  --app-bg: #0b1220;
  --app-surface: rgba(17, 24, 39, 0.92);
  --app-surface-solid: #111827;
  --app-surface-muted: rgba(15, 23, 42, 0.85);
  --app-border: rgba(148, 163, 184, 0.18);
  --app-text: #f1f5f9;
  --app-muted: #94a3b8;
  --app-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  --app-shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.25);

  --ft-bg: var(--app-bg);
  --ft-surface: var(--app-surface);
  --ft-surface-solid: var(--app-surface-solid);
  --ft-surface-muted: var(--app-surface-muted);
  --ft-border: var(--app-border);
  --ft-text: var(--app-text);
  --ft-text-muted: var(--app-muted);

  --boows-col-text: var(--app-text);
  --boows-col-text-rgb: 241, 245, 249;
  --boows-col-text-80: #e2e8f0;
  --boows-col-text-60: rgba(148, 163, 184, 0.92);
  --boows-col-text-40: rgba(148, 163, 184, 0.72);
  --boows-col-text-20: rgba(148, 163, 184, 0.25);
  --boows-col-text-10: rgba(148, 163, 184, 0.15);
  --boows-col-text-5: rgba(148, 163, 184, 0.08);

  --boows-col-bg: var(--app-bg);
  --boows-col-bg-rgb: 11, 18, 32;
  --boows-col-border: var(--app-border);
  --boows-col-bg-light: rgba(241, 245, 249, 0.06);

  --boows-input-bg: rgba(241, 245, 249, 0.06);
  --boows-input-hover-bg: rgba(241, 245, 249, 0.09);
  --boows-input-border: var(--app-border);
  --boows-input-focus: rgba(var(--ft-primary-rgb), 0.35);
}

html[data-theme="dark"] body.boows-rounded {
  --boows-surface: var(--app-surface-solid);
  --boows-surface-2: var(--app-bg);
  --boows-border: var(--app-border);
  --boows-border-strong: rgba(148, 163, 184, 0.28);
  --boows-shadow-1: 0 18px 40px rgba(0, 0, 0, 0.35);
  --boows-shadow-2: 0 10px 24px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] body {
  background: radial-gradient(1200px 800px at 10% 10%, rgba(37, 99, 235, 0.18), transparent 60%),
              radial-gradient(900px 700px at 90% 30%, rgba(20, 184, 166, 0.14), transparent 55%),
              var(--ft-bg);
  color: var(--ft-text);
}

:root[data-theme="dark"] .ui-select,
:root[data-theme="dark"] .ui-theme-toggle {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.20);
  color: var(--ft-text);
}

/* ===========================================================================
 * Dark mode: app-wide component coverage.
 * These components hard-code light surfaces (or use a token that flips text to
 * light while the surface stays white), so they were unreadable in dark mode:
 * page background, modals, segmented tabs, the Boows tab bar and autofilled
 * inputs. Light mode is untouched.
 * ========================================================================= */

/* Page background — body.app-auth .app-content paints a light gradient ("match
 * the light dashboard look") with no dark variant. Drop it so the dark body
 * shows through (fixes the light page area on inbox, profile detail, …). */
html[data-theme="dark"] body.app-auth .app-content {
  background: transparent;
}

/* Modals / dialogs — .boows-popup hard-codes background-color:#fff, so every
 * dialog ("Push aktivieren?", confirmations, forms) was white with light text. */
html[data-theme="dark"] .boows-popup {
  background-color: var(--app-surface-solid);
  color: var(--app-text);
}
html[data-theme="dark"] .boows-popup-header {
  border-color: var(--app-border);
}

/* Inbox segmented control — the active pill was #fff with var(--app-text)
 * (light in dark mode) = invisible. Elevated dark pill + light text instead. */
html[data-theme="dark"] .inbox-tab.is-active {
  background: rgba(148, 163, 184, 0.30);
  color: var(--app-text);
  box-shadow: none;
}

/* Boows tab bar — the track is the primary colour and the active pill is #fff,
 * but the active label uses --boows-col-text which flips to light → invisible
 * on the white pill. Keep the active label dark (as in light mode). */
html[data-theme="dark"] .boows_tab_container {
  --boows-tabbar-active-color: #0f172a;
}

/* Autofilled inputs — browsers paint their own light background over the field
 * (the pink/white login e-mail box). Pin colours so it stays dark + legible. */
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus,
html[data-theme="dark"] textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--app-text);
  caret-color: var(--app-text);
  -webkit-box-shadow: 0 0 0 1000px #1f2937 inset;
  box-shadow: 0 0 0 1000px #1f2937 inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* --- Boows Mobile Select (Phone / Language) --- */
.boows-select-mobile-popup .boows-select-mobile-search {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.65);
  color: var(--app-text);
  outline: none;
}

html[data-theme="dark"] .boows-select-mobile-popup .boows-select-mobile-search {
  background: rgba(241, 245, 249, 0.06);
}

.boows-select-mobile-popup .boows-select-mobile-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 60vh;
  overflow: auto;
}

.boows-select-mobile-popup .boows-select-mobile-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--app-radius-md);
}

.boows-select-mobile-popup .boows-select-mobile-option:hover {
  background: rgba(var(--ft-primary-rgb), 0.08);
}

.boows-select-mobile-popup .boows-select-mobile-option .item-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
}

.boows-select-mobile-popup .boows-select-mobile-option .finf {
  font-weight: 650;
}

.boows-select-mobile-popup .boows-select-mobile-option .info {
  color: var(--app-muted);
  font-size: 0.92rem;
}

.boows-select-mobile-popup .boows-select-mobile-option .phone_flag {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  flex: 0 0 22px;
  background-position: center;
}


/* Language & phone flags */
.boows-flag-svg{width:18px;height:18px;border-radius:50%;object-fit:cover;display:inline-block;vertical-align:middle;margin-right:8px;box-shadow:0 0 0 1px rgba(0,0,0,0.08);}

.push-status{font-weight:600;padding:4px 10px;border-radius:999px;background:rgba(0,0,0,.06);}
.push-status.is-on{background:rgba(var(--ft-primary-rgb),.15);}

/* Simple table (non-Boows table component) */
.app-simple-table {
  width: 100%;
  border-collapse: collapse;
}

.app-simple-table th,
.app-simple-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
  text-align: left;
  vertical-align: top;
}

.app-simple-table thead th {
  font-weight: 600;
  color: var(--app-text);
  background: var(--app-surface-muted);
}

.push-table-message-cell {
  display: inline-block;
  min-width: 240px;
}

.push-table-endpoint-cell {
  display: inline-block;
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* HR module */
.hr-subnav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.1rem;
  margin-bottom: 1rem;
}

.hr-subnav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
}

.hr-subnav-link.is-active {
  border-color: rgba(var(--ft-primary-rgb), 0.4);
  background: color-mix(in srgb, var(--ft-primary) 12%, var(--app-surface-solid));
  color: var(--app-text);
}

.hr-grid-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

.hr-kpi-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
}

.hr-kpi-card h3 {
  margin: 0;
  font-size: 0.86rem;
  color: var(--app-muted);
}

.hr-kpi-card p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.hr-kpi-value {
  font-size: clamp(1.4rem, 6vw, 2rem);
  line-height: 1;
  font-weight: 700;
  color: var(--app-text);
}

.hr-section-panel {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.hr-section-panel .boows-table,
.hr-section-panel .boows-table .search-table-box,
.hr-section-panel .boows-table .scroll-container {
  max-width: 100%;
  min-width: 0;
}

.hr-section-panel .boows-table .scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hr-section-panel h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--app-text);
}

.hr-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.hr-scope-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.45rem;
  padding-bottom: 0.1rem;
}

.hr-scope-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.hr-scope-tab.is-active {
  border-color: rgba(var(--ft-primary-rgb), 0.45);
  color: var(--app-text);
  background: color-mix(in srgb, var(--ft-primary) 10%, var(--app-surface-solid));
}

.hr-grid-overview--phase2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
}

.hr-chart-bars {
  display: grid;
  gap: 0.55rem;
}

.hr-chart-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 2fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.hr-chart-bar-label,
.hr-chart-bar-count {
  font-size: 0.78rem;
  color: var(--app-muted);
}

.hr-chart-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  overflow: hidden;
}

.hr-chart-bar-value {
  height: 100%;
  min-width: 8px;
  border-radius: 999px;
  background: var(--ft-primary);
}

.hr-chart-bar-value.is-pending {
  background: #4f8dd8;
}

.hr-chart-bar-value.is-unavailable {
  background: #f59f00;
}

.hr-chart-bar-value.is-sick {
  background: #e03131;
}

.hr-chart-bar-value.is-sv {
  background: #7b5cff;
}

.hr-chart-bar-value.is-worktime {
  background: #0ca678;
}

.hr-list-stack {
  display: grid;
  gap: 0.6rem;
}

.hr-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
}

.hr-row-card.is-selected {
  border-color: rgba(var(--ft-primary-rgb), 0.4);
  background: color-mix(in srgb, var(--ft-primary) 8%, var(--app-surface-muted));
}

.hr-row-main {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.hr-row-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-text);
  word-break: break-word;
}

.hr-row-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.hr-row-note {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--app-muted);
  line-height: 1.35;
  word-break: break-word;
}

.hr-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hr-table-action-form {
  display: none !important;
}

.hr-row-actions .boows-form {
  margin: 0;
  width: 100%;
}

.hr-row-actions .boows-btn {
  width: 100%;
  justify-content: center;
}

.hr-row-action-hint {
  font-size: 0.74rem;
  color: var(--app-muted);
  align-self: center;
}

.hr-row-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  color: var(--app-muted);
  text-decoration: none;
}

.hr-row-link .material-icons {
  font-size: 19px;
}

.hr-empty {
  margin: 0;
  padding: 0.2rem 0;
  color: var(--app-muted);
  font-size: 0.82rem;
}

.hr-form-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

.hr-inline-form {
  width: 100%;
}

.hr-settings-separator {
  height: 1px;
  background: var(--app-border);
  margin: 0.2rem 0;
}

.hr-form-help {
  margin: -0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.hr-decision-grid {
  display: grid;
  gap: 0.8rem;
}

.hr-flash-panel {
  padding: 0.7rem 0.9rem;
}

.hr-flash-panel .status-pill {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.hr-entry-amount {
  font-weight: 700;
}

.hr-entry-amount.is-positive {
  color: #15803d;
}

.hr-entry-amount.is-negative {
  color: #b91c1c;
}

@media (min-width: 860px) {
  .hr-grid-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hr-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-row-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hr-scope-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .hr-row-actions .boows-form {
    width: auto;
  }

  .hr-row-actions .boows-btn {
    width: auto;
  }

  .hr-inline-form {
    width: auto;
    min-width: 220px;
  }

  .hr-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.permission-group-block {
  gap: 0.4rem 1rem;
}

.permission-group-block .permission-item .checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.3;
}

.permission-group-block .permission-item .permission-item-title {
  font-weight: 500;
}

.permission-group-block .permission-item .permission-item-description {
  font-size: 0.82rem;
  color: var(--app-muted, #8a8f99);
  font-weight: 400;
}

.role-presets-section {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--app-border, #d8dde5);
  border-radius: 8px;
  background: var(--app-surface-muted, rgba(0, 0, 0, 0.02));
}

.role-presets-header {
  margin-bottom: 0.75rem;
}

.role-presets-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.role-presets-hint {
  font-size: 0.82rem;
  color: var(--app-muted, #8a8f99);
  margin: 0;
}

.role-presets-controls {
  align-items: end;
  gap: 0.75rem;
}

.role-presets-description {
  font-size: 0.82rem;
  color: var(--app-muted, #8a8f99);
  margin: 0;
  min-height: 1em;
  grid-column: 1 / -1;
}
