@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  /* Conferir HEX oficiais no BELKIT_BRANDBOOK.pdf, p.24 */
  --bk-coral: #D96A5F;
  --bk-coral-soft: #F7D8D3;
  --bk-bluegray: #6F8491;
  --bk-bluegray-dark: #3F515B;
  --bk-gray-50: #F8F9FA;
  --bk-gray-100: #EEF1F3;
  --bk-gray-200: #DDE3E7;
  --bk-text: #263238;
  --bk-muted: #6B747B;
  --bk-white: #FFFFFF;

  --bk-success: #2E7D62;
  --bk-warning: #C98716;
  --bk-danger: #C94C4C;
  --bk-info: #3C7C9A;

  --bk-radius: 8px;
  --bk-shadow: 0 8px 24px rgba(38, 50, 56, 0.08);
  --bk-topbar-bg: rgba(255, 255, 255, 0.96);
  --bk-kanban-column-bg: #FDFDFD;
  --bk-alert-bg: #FFF4F2;
  --bk-alert-border: #F0C7C2;
  --bk-alert-text: #8E3F37;
  --bk-project-hover-border: #E6B6B0;
  --bk-avatar-bg: #E7EEF2;
  --topbar-height: 56px;
  --sidebar-width: 260px;
  --right-panel-width: 292px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: var(--bk-gray-50);
  --bs-body-color: var(--bk-text);
  --bs-border-color: var(--bk-gray-200);
  --bk-coral: #E07A70;
  --bk-coral-soft: #4D2A2A;
  --bk-bluegray: #A7B6BE;
  --bk-bluegray-dark: #D9E2E6;
  --bk-gray-50: #111719;
  --bk-gray-100: #202B30;
  --bk-gray-200: #314147;
  --bk-text: #EEF3F5;
  --bk-muted: #A9B7BE;
  --bk-white: #192125;

  --bk-success: #6BC59E;
  --bk-warning: #E0AE4F;
  --bk-danger: #E07878;
  --bk-info: #72B6D2;

  --bk-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  --bk-topbar-bg: rgba(25, 33, 37, 0.94);
  --bk-kanban-column-bg: #151D20;
  --bk-alert-bg: #3A2324;
  --bk-alert-border: #6B3B3A;
  --bk-alert-text: #F3BAB4;
  --bk-project-hover-border: #8D5751;
  --bk-avatar-bg: #26363C;
}

body.sidebar-collapsed {
  --sidebar-width: 74px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: var(--bk-gray-50);
  color: var(--bk-text);
  font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-lockup {
  font-family: Gotham, Montserrat, "Source Sans Pro", Arial, sans-serif;
  letter-spacing: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--bk-gray-200);
  background: var(--bk-topbar-bg);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--bk-text);
  padding: 0;
  text-align: left;
}

.brand-lockup small {
  display: block;
  color: var(--bk-muted);
  font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
  font-size: 0.78rem;
  line-height: 1;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--bk-radius);
  background: var(--bk-coral);
  color: var(--bk-white);
  font-weight: 700;
}

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

.topbar-user {
  display: grid;
  line-height: 1.05;
  text-align: left;
}

.topbar-user span {
  font-weight: 700;
}

.topbar-user small {
  color: var(--bk-muted);
  font-size: 0.75rem;
}

.account-menu {
  flex: 0 0 auto;
}

.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding-inline: 10px;
}

.account-dropdown {
  min-width: 220px;
  padding: 6px;
  border-radius: var(--bk-radius);
  border-color: var(--bk-border);
  box-shadow: var(--bk-shadow);
}

.account-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--bk-radius);
  padding: 9px 10px;
  font-weight: 600;
}

.account-dropdown .dropdown-item i {
  width: 18px;
  text-align: center;
}

.account-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.btn {
  border-radius: var(--bk-radius);
  font-weight: 600;
}

.btn-primary {
  --bs-btn-bg: var(--bk-coral);
  --bs-btn-border-color: var(--bk-coral);
  --bs-btn-hover-bg: #c95d53;
  --bs-btn-hover-border-color: #c95d53;
  --bs-btn-active-bg: #b8544b;
  --bs-btn-active-border-color: #b8544b;
}

.btn-primary.is-saving,
.btn-primary.is-saving:disabled {
  --bs-btn-disabled-bg: var(--bk-gray-100);
  --bs-btn-disabled-border-color: var(--bk-gray-200);
  --bs-btn-disabled-color: var(--bk-muted);
  background: var(--bk-gray-100);
  border-color: var(--bk-gray-200);
  color: var(--bk-muted);
  opacity: 1;
}

.btn-danger {
  --bs-btn-bg: var(--bk-danger);
  --bs-btn-border-color: var(--bk-danger);
}

.btn-light {
  --bs-btn-bg: var(--bk-white);
  --bs-btn-border-color: var(--bk-gray-200);
  --bs-btn-hover-bg: var(--bk-gray-100);
  --bs-btn-hover-border-color: var(--bk-gray-200);
  color: var(--bk-text);
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bk-gray-200);
  background: var(--bk-white);
}

.theme-toggle {
  min-width: 86px;
}

.notification-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.notification-toggle.has-unread {
  color: var(--bk-coral);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--bk-topbar-bg);
  border-radius: 999px;
  background: var(--bk-danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.app-shell {
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

body.departments-hidden .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.departments-hidden .app-sidebar,
body.departments-hidden [data-bs-target="#departmentOffcanvas"] {
  display: none !important;
}

.app-sidebar,
.app-right-panel {
  background: var(--bk-white);
  border-color: var(--bk-gray-200);
}

.app-sidebar {
  min-height: calc(100vh - var(--topbar-height));
  flex-direction: column;
  border-right: 1px solid var(--bk-gray-200);
  padding: 12px 9px;
  overflow-y: auto;
}

.app-right-panel {
  display: none !important;
  border-left: 1px solid var(--bk-gray-200);
  padding: 12px;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

body[data-view="project"] .app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

body[data-view="project"] .app-right-panel {
  display: none !important;
}

.sidebar-heading,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--bk-bluegray-dark);
  font-weight: 700;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.department-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.department-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--bk-radius);
  background: transparent;
  padding: 8px;
  color: var(--bk-text);
  text-align: left;
}

.department-item:hover,
.department-item.active {
  border-color: var(--bk-gray-200);
  background: var(--bk-gray-50);
}

.department-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.department-content {
  min-width: 0;
  flex: 1;
}

.department-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--bk-gray-100);
  color: var(--bk-bluegray-dark);
}

.department-health-compact {
  display: none;
}

.department-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--bk-muted);
  font-size: 0.84rem;
}

.health-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--bk-success);
}

.health-dot.yellow {
  background: var(--bk-warning);
}

.health-dot.red {
  background: var(--bk-danger);
}

.app-main {
  min-width: 0;
  padding: 16px;
}

.view-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.view-title {
  margin: 0;
  color: var(--bk-text);
  font-size: clamp(1.18rem, 1rem + 0.32vw, 1.48rem);
  font-weight: 700;
}

.view-eyebrow {
  color: var(--bk-coral);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.view-subtitle {
  margin: 6px 0 0;
  color: var(--bk-muted);
}

.view-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.department-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
}

.department-view-option {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bk-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.department-view-option.active {
  background: var(--bk-coral);
  color: #fff;
}

.department-view-option:not(.active):hover,
.department-view-option:not(.active):focus {
  background: var(--bk-gray-100);
  color: var(--bk-text);
}

.department-project-filter-menu,
.project-task-filter-menu {
  position: relative;
}

.department-project-filter-dropdown,
.project-task-filter-dropdown {
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
}

.project-task-filter-dropdown {
  min-width: min(340px, 88vw);
  max-height: min(520px, 78vh);
  overflow: auto;
}

.project-task-filter-add {
  display: grid;
  gap: 5px;
  padding: 6px 8px 10px;
  color: var(--bk-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-task-filter-active {
  display: grid;
  gap: 8px;
}

.project-task-filter-block {
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-gray-50);
}

.project-task-filter-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--bk-text);
  font-size: 0.84rem;
}

.project-task-filter-block-header .btn-icon {
  width: 26px;
  height: 26px;
  min-height: 26px;
}

.department-project-filter-option,
.project-task-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--bk-text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.department-project-filter-option:hover,
.project-task-filter-option:hover {
  background: var(--bk-gray-100);
}

.department-project-filter-switch-input,
.project-task-filter-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.department-project-filter-switch,
.project-task-filter-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: var(--bk-gray-200);
  transition: background-color 0.16s ease;
}

.department-project-filter-switch::after,
.project-task-filter-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--bk-white);
  box-shadow: 0 1px 3px rgba(38, 50, 56, 0.22);
  transition: transform 0.16s ease;
}

.department-project-filter-switch-input:checked + .department-project-filter-switch,
.project-task-filter-switch-input:checked + .project-task-filter-switch {
  background: var(--bk-coral);
}

.department-project-filter-switch-input:checked + .department-project-filter-switch::after,
.project-task-filter-switch-input:checked + .project-task-filter-switch::after {
  transform: translateX(14px);
}

.department-project-filter-switch-input:focus-visible + .department-project-filter-switch,
.project-task-filter-switch-input:focus-visible + .project-task-filter-switch {
  outline: 2px solid var(--bk-coral-soft);
  outline-offset: 2px;
}

.project-task-filter-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.project-task-filter-date-grid label {
  display: grid;
  gap: 4px;
  color: var(--bk-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-task-filter-check-grid {
  display: grid;
  gap: 4px;
}

.project-task-filter-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  margin: 0;
  padding: 3px 4px;
  border-radius: 5px;
  color: var(--bk-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.project-task-filter-check:hover {
  background: var(--bk-white);
}

.project-task-filter-label-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.project-task-filter-empty {
  padding: 4px;
  color: var(--bk-muted);
  font-size: 0.8rem;
}

.project-task-search {
  position: relative;
  width: min(280px, 42vw);
}

.project-assignee-filter {
  width: min(220px, 34vw);
}

.project-task-search > i {
  position: absolute;
  top: 50%;
  left: 10px;
  z-index: 1;
  color: var(--bk-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.project-task-search .form-control {
  padding-left: 32px;
}

.project-task-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(520px, 82vw);
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #2b2d31;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.project-task-search-heading {
  padding: 6px 8px 8px;
  color: #a9adb8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-task-search-item {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e8eaef;
  text-align: left;
}

.project-task-search-item:hover,
.project-task-search-item:focus {
  background: rgba(255, 255, 255, 0.08);
}

.project-task-search-item i {
  color: #c3c7d1;
  font-size: 1rem;
}

.project-task-search-item strong,
.project-task-search-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-task-search-item strong {
  font-size: 0.9rem;
}

.project-task-search-item small,
.project-task-search-empty {
  color: #a9adb8;
  font-size: 0.78rem;
}

.project-task-search-empty {
  padding: 8px;
}

.app-alert {
  border: 1px solid var(--bk-alert-border);
  background: var(--bk-alert-bg);
  color: var(--bk-alert-text);
  padding: 10px 12px;
  border-radius: var(--bk-radius);
  margin-bottom: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card,
.project-card,
.data-panel,
.task-card {
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
}

.metric-card {
  min-height: 92px;
  padding: 12px;
}

body[data-view="project"] .metric-card {
  min-height: 78px;
  padding: 10px 12px;
}

.metric-label {
  color: var(--bk-muted);
  font-weight: 700;
  font-size: 0.84rem;
}

.metric-value {
  margin-top: 8px;
  font-family: Gotham, Montserrat, "Source Sans Pro", Arial, sans-serif;
  font-size: 1.62rem;
  font-weight: 700;
}

body[data-view="project"] .metric-value {
  font-size: 1.45rem;
}

.metric-foot {
  color: var(--bk-muted);
  font-size: 0.86rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.data-panel {
  padding: 12px;
}

.data-panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

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

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--bk-gray-100);
}

.list-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.list-title {
  margin: 0;
  font-weight: 700;
}

.list-meta {
  color: var(--bk-muted);
  font-size: 0.86rem;
}

.empty-state {
  border: 1px dashed var(--bk-gray-200);
  border-radius: var(--bk-radius);
  padding: 18px;
  color: var(--bk-muted);
  background: var(--bk-white);
  text-align: center;
}

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

.project-card {
  padding: 12px;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--bk-project-hover-border);
}

.project-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.project-stat {
  min-height: 54px;
  border: 1px solid var(--bk-gray-100);
  border-radius: var(--bk-radius);
  padding: 8px;
}

.project-stat strong {
  display: block;
  font-size: 1.2rem;
}

.project-stat span {
  color: var(--bk-muted);
  font-size: 0.78rem;
}

.badge-soft {
  --badge-bg: var(--bk-gray-100);
  --badge-color: var(--bk-bluegray-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--badge-bg);
  color: var(--badge-color);
  font-size: 0.78rem;
  font-weight: 700;
}

.priority-critical {
  --badge-bg: #FBEAEA;
  --badge-color: var(--bk-danger);
}

.priority-high {
  --badge-bg: var(--bk-coral-soft);
  --badge-color: #9b453d;
}

.priority-medium {
  --badge-bg: #E7EEF2;
  --badge-color: var(--bk-bluegray-dark);
}

.priority-low {
  --badge-bg: var(--bk-gray-100);
  --badge-color: var(--bk-muted);
}

.health-green {
  --badge-bg: #E7F4EF;
  --badge-color: var(--bk-success);
}

.health-yellow {
  --badge-bg: #FFF3D9;
  --badge-color: var(--bk-warning);
}

.health-red,
.status-blocked {
  --badge-bg: #FBEAEA;
  --badge-color: var(--bk-danger);
}

.status-done {
  --badge-bg: #E7F4EF;
  --badge-color: var(--bk-success);
}

.status-waiting,
.status-review {
  --badge-bg: #FFF3D9;
  --badge-color: var(--bk-warning);
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(252px, 1fr);
  gap: 10px;
  align-items: start;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-bottom: 10px;
  scrollbar-gutter: stable both-edges;
}

.department-task-board {
  margin-top: 2px;
}

.kanban-column {
  min-height: 500px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-kanban-column-bg);
}

.kanban-column-header {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--bk-gray-200);
  color: var(--bk-bluegray-dark);
  font-weight: 700;
}

.kanban-task-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
  min-height: 92px;
  border-radius: 0 0 var(--bk-radius) var(--bk-radius);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.kanban-task-list.is-drop-target {
  background: var(--bk-coral-soft);
  box-shadow: inset 0 0 0 1px rgba(217, 106, 95, 0.35);
}

.task-card {
  position: relative;
  padding: 10px 42px 10px 10px;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.task-card.is-overdue {
  border-color: #efb2ac;
}

.task-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
  box-shadow: var(--bk-shadow);
  transform: scale(0.99);
}

.task-link-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.task-card-cover {
  width: calc(100% + 32px);
  aspect-ratio: 1 / 1;
  max-height: 240px;
  margin: 0 0 9px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-gray-100);
  overflow: hidden;
}

.task-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.task-card-title-row {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.task-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.task-description {
  margin: 8px 0 0;
  color: var(--bk-muted);
  font-size: 0.88rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.task-description ul,
.task-description ol {
  margin: 4px 0;
  padding-left: 18px;
}

.task-description li {
  margin: 2px 0;
}

.task-description .task-inline-image-wrap,
.task-description .task-inline-image {
  display: none;
}

.task-meta,
.task-badges,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.task-meta {
  margin-top: 10px;
  color: var(--bk-muted);
  font-size: 0.84rem;
}

.task-badges {
  margin-top: 10px;
}

.task-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 7px;
}

.task-label-row .project-label-chip {
  min-height: 19px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
}

.task-actions {
  margin-top: 12px;
}

.task-actions .btn {
  min-width: 30px;
}

.task-checklist-progress-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bk-gray-100);
}

.task-checklist-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bk-success);
}

.checklist-editor,
.attachment-editor {
  display: grid;
  gap: 12px;
}

.task-editor-form {
  align-items: end;
}

.task-editor-form .form-label {
  margin-bottom: 5px;
  color: var(--bk-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.task-editor-form #taskDueDate {
  min-width: 0;
}

.task-inline-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-inline-tool {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.task-inline-tool .form-label {
  margin-bottom: 0;
  text-align: center;
}

.task-editor-form .attachment-start-button {
  height: 38px;
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.task-section {
  margin-top: 2px;
  padding: 12px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
}

.task-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-section-header strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bk-text);
}

.task-modal-dialog {
  max-width: min(1180px, calc(100vw - 32px));
}

.task-modal-dialog .modal-content {
  height: min(860px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
}

.task-modal-dialog .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.task-modal-dialog .modal-content.has-task-cover .modal-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  border-bottom: 0;
  background: transparent;
}

.task-cover-preview {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  height: 210px;
  border-bottom: 1px solid var(--bk-gray-200);
  background: var(--bk-gray-200);
  overflow: hidden;
}

.task-cover-image-frame {
  display: grid;
  place-items: center;
  width: min(520px, calc(100% - 128px));
  height: calc(100% - 20px);
  overflow: hidden;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
}

#taskCoverImage {
  display: none;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
}

#taskCoverButton.has-cover {
  border-color: rgba(224, 96, 86, 0.45);
  color: var(--bk-coral);
}

.task-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.task-editor-pane {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  scrollbar-gutter: stable;
}

.task-comments-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  border-left: 1px solid var(--bk-gray-200);
  background: var(--bk-gray-50);
  scrollbar-gutter: stable;
}

.task-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-comments-header > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-comments-header span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bk-gray-100);
  color: var(--bk-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.task-comment-composer {
  position: relative;
  display: grid;
  gap: 8px;
}

.task-comment-editor,
.task-comment-inline-editor {
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  overflow: hidden;
}

.task-comment-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--bk-gray-200);
}

.task-comment-toolbar button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bk-muted);
}

.task-comment-toolbar button:hover {
  background: var(--bk-gray-100);
  color: var(--bk-bluegray-dark);
}

.task-comment-font-size {
  width: 92px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bk-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.task-comment-font-size:hover,
.task-comment-font-size:focus {
  background: var(--bk-gray-100);
  color: var(--bk-bluegray-dark);
  outline: 0;
}

.task-draft-button {
  border-color: #f4d69a;
  background: #fff8e6;
  color: #7a4b00;
  font-weight: 700;
}

.task-draft-button:hover,
.task-draft-button:focus {
  border-color: #e8bf66;
  background: #ffefc2;
  color: #583600;
}

.task-rich-editor {
  min-height: 92px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--bk-muted);
}

.task-rich-editor ul,
.task-rich-editor ol {
  margin: 0;
  padding-left: 1.2rem;
}

.task-inline-image-wrap {
  display: inline-block;
  position: relative;
  width: min(360px, 100%);
  max-width: 100%;
  margin: 8px 0;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  vertical-align: top;
  user-select: none;
}

.task-inline-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  border-radius: 7px;
  object-fit: contain;
}

.task-rich-editor .task-inline-image-wrap {
  overflow: hidden;
  min-width: 120px;
  padding: 2px;
  cursor: default;
}

.task-inline-image-resize-handle {
  display: none;
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border-right: 2px solid var(--bk-bluegray);
  border-bottom: 2px solid var(--bk-bluegray);
  background: rgba(255, 255, 255, 0.78);
  cursor: nwse-resize;
}

.task-rich-editor .task-inline-image-resize-handle {
  display: block;
}

.task-inline-image-wrap.is-resizing {
  outline: 2px solid var(--bk-bluegray);
  outline-offset: 2px;
}

body.is-resizing-inline-image {
  cursor: nwse-resize;
  user-select: none;
}

.task-rich-editor .task-inline-image {
  height: auto;
  pointer-events: none;
}

.task-emoji-picker-wrap {
  position: relative;
}

.task-emoji-menu {
  position: absolute;
  z-index: 30;
  right: 0;
  top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 32px);
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
}

.task-emoji-menu button {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.task-comment-composer textarea,
.task-comment-editor textarea {
  resize: none;
  min-height: 92px;
  max-height: 180px;
  overflow-y: auto;
}

.task-comment-editor textarea,
.task-comment-inline-editor textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.task-comment-editor textarea:focus,
.task-comment-inline-editor textarea:focus {
  box-shadow: none;
}

.task-comment-inline-editor {
  margin-top: 2px;
}

.task-comment-inline-editor textarea {
  min-height: 74px;
}

.task-comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.task-comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-comment-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-comment-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 6px;
  background: var(--bk-white);
  font-size: 0.8rem;
}

.task-comment-file-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-comment-file-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bk-muted);
}

.task-mention-suggestions {
  position: fixed;
  z-index: 1090;
  width: min(260px, calc(100vw - 24px));
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
}

.task-mention-suggestions button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bk-text);
  text-align: left;
}

.task-mention-suggestions button:hover {
  background: var(--bk-gray-100);
}

.task-mention-suggestions small {
  display: block;
  color: var(--bk-muted);
}

.task-comments-list {
  display: grid;
  align-content: start;
  gap: 14px;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  padding-right: 8px;
}

.task-comment-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
}

.task-comment-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--bk-bluegray);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
}

.task-comment-content {
  min-width: 0;
}

.task-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.task-comment-meta span {
  color: var(--bk-muted);
  font-size: 0.78rem;
}

.task-comment-body {
  padding: 10px 12px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-comment-body ul,
.task-comment-body ol {
  margin: 4px 0;
  padding-left: 20px;
}

.task-comment-body li {
  margin: 2px 0;
}

.task-comment-font-small {
  font-size: 0.82em;
}

.task-comment-font-normal {
  font-size: 1em;
}

.task-comment-font-large {
  font-size: 1.16em;
}

.task-comment-font-huge {
  font-size: 1.34em;
}

.task-comment-mention {
  color: var(--bk-info);
  font-weight: 700;
}

.task-auto-link {
  display: inline;
  padding: 1px 4px;
  border: 1px solid rgba(42, 122, 226, 0.42);
  border-radius: 4px;
  color: #1d66d1;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.task-auto-link:hover {
  border-color: #1d66d1;
  color: #164f9f;
  background: rgba(42, 122, 226, 0.08);
}

.link-config-button {
  position: fixed;
  z-index: 1080;
  display: none;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(42, 122, 226, 0.5);
  border-radius: 6px;
  background: var(--bk-white);
  color: #1d66d1;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: var(--bk-shadow);
}

.link-config-button.is-visible {
  display: inline-flex;
  align-items: center;
}

.task-comment-attachments {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.task-comment-attachment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  color: var(--bk-text);
  text-decoration: none;
}

.task-comment-attachment img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
}

.task-comment-attachment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-comment-attachment small,
.task-comment-mentions {
  color: var(--bk-muted);
  font-size: 0.78rem;
}

.task-comment-mentions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.task-comment-mentions span {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--bk-gray-100);
}

.task-comment-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  color: var(--bk-muted);
  font-size: 0.82rem;
}

.task-comment-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bk-bluegray-dark);
  text-decoration: underline;
}

.task-comment-links button:hover {
  color: var(--bk-coral);
}

#taskDescriptionEditor {
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  border: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.task-description-editor {
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px 8px 0 0;
  background: var(--bk-white);
  overflow: hidden;
}

.task-description-editor #taskDescriptionEditor:focus {
  box-shadow: none;
}

#taskDescriptionEditor.is-expanded {
  min-height: 680px;
  max-height: 900px;
}

.task-description-field-toggle {
  width: 100%;
  height: 32px;
  margin-top: -1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--bk-gray-200);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: var(--bk-white);
  color: var(--bk-muted);
  font-weight: 700;
}

.task-description-field-toggle:hover {
  color: var(--bk-bluegray-dark);
  border-color: var(--bk-gray-300);
}

@media (max-width: 991.98px) {
  .task-modal-dialog {
    max-width: calc(100vw - 16px);
    margin-right: auto;
    margin-left: auto;
  }

  .task-modal-layout {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 160px);
  }

  .task-cover-preview {
    height: 118px;
  }

  .task-editor-pane,
  .task-comments-pane {
    max-height: none;
  }

  .task-comments-pane {
    border-left: 0;
    border-top: 1px solid var(--bk-gray-200);
  }
}

.checklist-editor-row {
  align-items: center;
}

.checklist-editor-list {
  display: grid;
  gap: 18px;
}

.checklist-group {
  display: grid;
  gap: 10px;
}

.checklist-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checklist-group-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.checklist-group-title-wrap i {
  color: var(--bk-text);
  font-size: 1rem;
}

.checklist-group-title {
  min-width: 0;
  width: min(320px, 52vw);
  border: 0;
  background: transparent;
  color: var(--bk-text);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.checklist-group-title:focus {
  outline: 0;
  border-bottom: 1px solid var(--bk-gray-300);
}

.checklist-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.checklist-group-items {
  display: grid;
  gap: 8px;
}

.checklist-editor-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  color: var(--bk-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.checklist-editor-row {
  display: grid;
  grid-template-columns: 24px minmax(140px, 1fr) 128px minmax(118px, 0.34fr) 34px 34px 34px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-gray-50);
}

.checklist-editor-check {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--bk-success);
}

.checklist-editor-row .form-control,
.checklist-editor-row .form-select {
  min-width: 0;
  height: 36px;
  border-color: var(--bk-gray-200);
  background: var(--bk-white);
  box-shadow: none;
}

.checklist-editor-row > .btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.checklist-description-button.has-description {
  border-color: var(--bk-coral);
  background: var(--bk-white);
  color: var(--bk-coral);
}

.checklist-description-button.has-description:hover {
  border-color: var(--bk-coral);
  background: var(--bk-coral-soft);
  color: var(--bk-coral);
}

.checklist-editor-row .form-control:focus,
.checklist-editor-row .form-select:focus {
  border-color: var(--bk-gray-200);
  background: var(--bk-white);
}

.checklist-editor-row.is-completed .checklist-title {
  color: var(--bk-muted);
  text-decoration: line-through;
}

.checklist-start-button,
.checklist-add-button,
.attachment-start-button {
  width: fit-content;
}

.checklist-add-button {
  width: fit-content;
}

.checklist-add-item-button {
  justify-self: start;
  margin-left: 32px;
}

.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.attachment-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-gray-50);
}

.attachment-preview-thumb {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
  color: var(--bk-bluegray);
}

.attachment-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview-thumb-file {
  font-size: 1.35rem;
}

.attachment-pdf-thumb {
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--bk-danger);
  font-weight: 800;
}

.attachment-pdf-thumb i {
  font-size: 1.45rem;
  line-height: 1;
}

.attachment-pdf-thumb small {
  font-size: 0.64rem;
}

.attachment-card-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.attachment-card-name {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bk-text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.attachment-card-name:hover {
  color: var(--bk-coral);
}

.attachment-card-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.attachment-card-actions .btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-gray-50);
}

.attachment-link {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bk-text);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.attachment-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-link:hover {
  color: var(--bk-primary);
}

.attachment-size,
.attachment-empty {
  color: var(--bk-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.attachment-preview-modal .modal-body {
  background: var(--bk-gray-50);
}

.attachment-preview-frame {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.attachment-preview-frame img,
.attachment-preview-frame iframe {
  width: 100%;
  max-height: 72vh;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-white);
}

.attachment-preview-frame img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.attachment-preview-frame iframe {
  min-height: 72vh;
}

.task-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.task-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--bk-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.task-import-preview {
  min-height: 130px;
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: 8px;
  background: var(--bk-gray-50);
}

.task-import-table {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.task-import-table th {
  color: var(--bk-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.task-import-table td {
  vertical-align: top;
}

.task-import-table small {
  display: block;
  margin-top: 2px;
  color: var(--bk-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.task-import-table .badge-soft {
  display: inline-flex;
  margin: 2px 2px 2px 0;
  font-size: 0.7rem;
}

@media (max-width: 640px) {
  .checklist-editor-row {
    grid-template-columns: 24px minmax(0, 1fr) 32px;
  }

  .checklist-editor-row .checklist-due-date {
    grid-column: 2 / 4;
  }

  .checklist-editor-row .form-select {
    grid-column: 2 / 4;
  }
}

.avatar {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  padding: 0;
  border-radius: 999px;
  background: var(--bk-avatar-bg);
  color: var(--bk-bluegray-dark);
  font-size: 0.75rem;
  font-weight: 800;
  overflow: hidden;
}

.avatar img,
.member-avatar img,
.task-comment-avatar img,
.profile-avatar-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.avatar:has(img),
.member-avatar:has(img),
.task-comment-avatar:has(img),
.profile-avatar-preview:has(img) {
  background: transparent;
}

.profile-avatar-field {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.profile-avatar-preview {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bk-avatar-bg);
  color: var(--bk-bluegray-dark);
  font-size: 1rem;
  font-weight: 800;
  overflow: hidden;
}

.task-member-picker,
.project-member-picker,
.task-label-picker {
  min-height: 38px;
  display: flex;
  align-items: center;
}

.task-label-field .form-label {
  display: block;
  text-align: right;
}

.task-label-picker {
  justify-content: flex-end;
}

.task-member-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-member-stack-card {
  gap: 6px;
}

.member-avatar,
.member-add-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.member-avatar {
  border: 1px solid transparent;
  background: #6450c8;
  color: #fff;
  overflow: hidden;
}

button.member-avatar {
  appearance: none;
  cursor: pointer;
}

button.member-avatar:hover,
button.member-avatar:focus {
  border-color: rgba(255, 255, 255, 0.55);
  filter: brightness(1.04);
}

.member-add-button {
  border: 1px solid var(--bk-gray-200);
  background: transparent;
  color: var(--bk-muted);
}

.member-add-button:hover,
.member-add-button:focus {
  border-color: var(--bk-primary);
  color: var(--bk-primary);
}

.member-avatar-sm {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: 0.68rem;
}

.member-menu {
  min-width: 260px;
  max-height: 280px;
  overflow: auto;
}

.member-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-menu-item span:last-child {
  min-width: 0;
  display: grid;
}

.member-menu-item small {
  color: var(--bk-muted);
}

.task-member-empty {
  color: var(--bk-muted);
  font-size: 0.82rem;
}

.project-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-gray-50);
}

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

.project-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
}

.project-label-chip,
.label-add-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.project-label-chip {
  max-width: 100%;
  padding: 7px 10px;
  border: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.project-label-chip-action {
  gap: 6px;
  cursor: pointer;
}

.task-label-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.label-add-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--bk-gray-200);
  background: transparent;
  color: var(--bk-muted);
}

.label-add-button:hover,
.label-add-button:focus {
  border-color: var(--bk-coral);
  color: var(--bk-coral);
}

.label-menu {
  min-width: 220px;
  max-height: 260px;
  overflow: auto;
}

.label-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-color-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

body.sidebar-collapsed .sidebar-heading span,
body.sidebar-collapsed .department-content {
  display: none;
}

body.sidebar-collapsed .app-sidebar {
  align-items: center;
}

body.sidebar-collapsed .sidebar-heading {
  justify-content: center;
}

body.sidebar-collapsed .department-list,
body.sidebar-collapsed .department-item {
  width: 100%;
}

body.sidebar-collapsed .department-item {
  justify-content: center;
  padding: 7px;
  position: relative;
}

body.sidebar-collapsed .department-health-compact {
  display: block;
  position: absolute;
  top: 7px;
  right: 7px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bk-gray-50);
}

body.auth-checking .login-screen {
  display: none;
}

.login-card {
  width: min(100%, 380px);
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
  padding: 24px;
}

.login-card h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.login-card p {
  margin: 6px 0 18px;
  color: var(--bk-muted);
}

.activity-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.activity-item {
  border-left: 3px solid var(--bk-coral);
  padding-left: 10px;
}

.activity-item p {
  margin: 0;
}

.activity-item small {
  color: var(--bk-muted);
}

.people-table {
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  overflow: hidden;
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
}

.access-profile-layout {
  display: grid;
  gap: 14px;
}

.access-profile-editor {
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  padding: 14px;
  background: var(--bk-white);
  box-shadow: var(--bk-shadow);
}

.access-profile-editor-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.access-profile-editor-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.access-profile-editor-header p {
  margin: 4px 0 0;
  color: var(--bk-muted);
}

.access-profile-active {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.permission-group {
  border: 1px solid var(--bk-gray-100);
  border-radius: var(--bk-radius);
  padding: 12px;
  background: var(--bk-gray-50);
}

.permission-group h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--bk-bluegray-dark);
}

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

.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
  cursor: pointer;
}

.permission-option strong,
.permission-option small {
  display: block;
}

.permission-option small {
  color: var(--bk-muted);
}

.access-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.table {
  margin-bottom: 0;
}

.table th {
  color: var(--bk-bluegray-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.compact-item {
  border: 1px solid var(--bk-gray-100);
  border-radius: var(--bk-radius);
  padding: 10px;
  background: var(--bk-gray-50);
}

.compact-item strong {
  display: block;
  line-height: 1.2;
}

.compact-item span,
.compact-item small {
  display: block;
  color: var(--bk-muted);
  font-size: 0.84rem;
  margin-top: 2px;
}

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

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--bk-gray-200);
  border-radius: var(--bk-radius);
  background: var(--bk-white);
  color: var(--bk-text);
  text-align: left;
}

.notification-item:hover,
.notification-item:focus {
  border-color: var(--bk-project-hover-border);
  background: var(--bk-gray-50);
}

.notification-item.is-unread {
  border-color: var(--bk-coral-soft);
}

.notification-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bk-gray-100);
  color: var(--bk-bluegray-dark);
}

.notification-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-content strong,
.notification-content span,
.notification-content small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification-content span,
.notification-content small {
  color: var(--bk-muted);
}

.notification-content small {
  font-size: 0.78rem;
  font-weight: 700;
}

.notification-dot {
  width: 9px;
  height: 9px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--bk-coral);
}

.modal-content,
.form-control,
.form-select {
  border-radius: var(--bk-radius);
}

html[data-theme="dark"] .priority-critical,
html[data-theme="dark"] .health-red,
html[data-theme="dark"] .status-blocked {
  --badge-bg: #3C2427;
  --badge-color: #F0A0A0;
}

html[data-theme="dark"] .priority-high {
  --badge-bg: #4D2A2A;
  --badge-color: #F2A59D;
}

html[data-theme="dark"] .priority-medium {
  --badge-bg: #263942;
  --badge-color: #BFD2DB;
}

html[data-theme="dark"] .health-green,
html[data-theme="dark"] .status-done {
  --badge-bg: #1F3A32;
  --badge-color: #8FD8B8;
}

html[data-theme="dark"] .health-yellow,
html[data-theme="dark"] .status-waiting,
html[data-theme="dark"] .status-review {
  --badge-bg: #3E3320;
  --badge-color: #E8C274;
}

html[data-theme="dark"] .btn-primary {
  --bs-btn-bg: var(--bk-coral);
  --bs-btn-border-color: var(--bk-coral);
  --bs-btn-hover-bg: #C9635A;
  --bs-btn-hover-border-color: #C9635A;
  --bs-btn-active-bg: #B85850;
  --bs-btn-active-border-color: #B85850;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .toast {
  background: var(--bk-white);
  border-color: var(--bk-gray-200);
  color: var(--bk-text);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .offcanvas-header {
  border-color: var(--bk-gray-200);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: var(--bk-kanban-column-bg);
  border-color: var(--bk-gray-200);
  color: var(--bk-text);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background-color: var(--bk-kanban-column-bg);
  border-color: var(--bk-coral);
  color: var(--bk-text);
  box-shadow: 0 0 0 0.18rem rgba(224, 122, 112, 0.18);
}

html[data-theme="dark"] .form-control::placeholder {
  color: var(--bk-muted);
}

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

html[data-theme="dark"] .table {
  --bs-table-bg: var(--bk-white);
  --bs-table-color: var(--bk-text);
  --bs-table-border-color: var(--bk-gray-200);
  --bs-table-hover-bg: #223035;
  color: var(--bk-text);
}

html[data-theme="dark"] .kanban-task-list.is-drop-target {
  background: rgba(224, 122, 112, 0.18);
  box-shadow: inset 0 0 0 1px rgba(224, 122, 112, 0.38);
}

html[data-theme="dark"] .task-card.is-overdue {
  border-color: #7B5551;
}

html[data-theme="dark"] .loading-line {
  background: linear-gradient(90deg, var(--bk-gray-100), var(--bk-gray-200), var(--bk-gray-100));
}

.loading-line {
  min-height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bk-gray-100), var(--bk-gray-200), var(--bk-gray-100));
  background-size: 200% 100%;
  animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

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

@media (max-width: 991.98px) {
  .app-topbar {
    padding: 0 12px;
  }

  .topbar-actions .btn span,
  .brand-lockup small {
    display: none;
  }

  .topbar-actions .account-toggle .topbar-user,
  .topbar-actions .account-toggle .account-avatar,
  .topbar-actions .account-toggle .topbar-user span,
  .topbar-actions .account-toggle .topbar-user small {
    display: grid;
  }

  .topbar-actions .btn .notification-badge {
    display: inline-grid;
  }

  .topbar-actions .btn .notification-badge.d-none {
    display: none !important;
  }

  .theme-toggle {
    min-width: 34px;
  }

  .account-toggle {
    max-width: 150px;
  }

  .account-toggle .topbar-user {
    min-width: 0;
  }

  .account-toggle .topbar-user span,
  .account-toggle .topbar-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-main {
    padding: 16px;
  }

  .view-toolbar {
    display: grid;
  }

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

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

  .metric-grid,
  .dashboard-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }

  .kanban-column {
    min-height: auto;
  }
}

@media (max-width: 575.98px) {
  .topbar-actions {
    gap: 4px;
  }

  .topbar-actions .btn {
    padding-inline: 8px;
  }

  .account-toggle {
    max-width: 44px;
  }

  .account-toggle .topbar-user,
  .account-toggle .topbar-user small,
  .account-toggle .bi-chevron-down {
    display: none;
  }

  .metric-grid {
    gap: 8px;
  }

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

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