:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  background: color-mix(in srgb, var(--panel) 94%, #0e1216 6%);
  padding: 18px 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.sidebar-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
  padding-bottom: 12px;
}

.sidebar-brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-mark {
  --ring-color: var(--brand);
  flex: 0 0 auto;
}

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

.sidebar-link {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.sidebar-link-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex: 0 0 auto;
}

.sidebar-link-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.sidebar-link:hover {
  color: var(--text);
  border-color: transparent;
  background: color-mix(in srgb, var(--card-bg) 82%, #ffffff 18%);
}

.sidebar-link.active {
  color: var(--text);
  border-color: transparent;
  background: color-mix(in srgb, var(--brand) 18%, var(--card-bg));
}

.sidebar-projects {
  margin-top: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 0;
  position: relative;
}

.sidebar-projects-archived {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.sidebar-projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  margin: 0;
  min-height: 18px;
  line-height: 1.2;
  flex: 0 0 auto;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
}

.sidebar-projects-primary {
  gap: 8px;
}

.sidebar-projects-primary .sidebar-projects-head {
  gap: 6px;
  margin-bottom: 0;
  font-size: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  min-height: auto;
}

.sidebar-projects-primary .sidebar-link {
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-projects-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.sidebar-crm-groups .sidebar-projects-head {
  gap: 6px;
  margin-bottom: 2px;
  font-size: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  min-height: auto;
}

.sidebar-crm-groups .sidebar-projects-head .sidebar-link {
  flex: 1 1 auto;
}

#crmToggleBtn.sidebar-archive-toggle {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

#crmToggleBtn.sidebar-archive-toggle .arrow {
  width: 12px;
  height: 12px;
}

#crmPipelinesList {
  padding-left: 24px;
  margin-top: 2px;
}

.sidebar-archive-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  font-size: 12px;
  padding: 0;
  line-height: 1.2;
}

.sidebar-projects-head-actions .sidebar-archive-toggle {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-archive-toggle > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-section-label-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 auto;
}

.sidebar-section-label-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.sidebar-archive-toggle .arrow {
  transition: transform 0.15s ease;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-archive-toggle .arrow svg {
  width: 12px;
  height: 12px;
  display: block;
  fill: currentColor;
}

.sidebar-archive-toggle[aria-expanded="true"] .arrow {
  transform: rotate(90deg);
}

.sidebar-add-project {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-add-project svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sidebar-projects-list {
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 0;
  padding-top: 2px;
  max-height: none;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.sidebar-projects-primary .sidebar-projects-list {
  padding-left: 0;
}

.sidebar-project-groups {
  border-top: 1px solid color-mix(in srgb, var(--border) 38%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 38%, transparent);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-nav-secondary {
  margin-top: 2px;
}

.sidebar-project-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 12px;
  line-height: 1.35;
}

.sidebar-project-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  min-width: 0;
}

.sidebar-star-form {
  margin: 0;
}

.sidebar-star {
  border: 0;
  background: transparent;
  color: #798797;
  padding: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-star svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.sidebar-star.active {
  color: #d9bc6a;
}

.sidebar-project-link .name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project-link:hover {
  color: var(--text);
  border-color: transparent;
  background: color-mix(in srgb, var(--card-bg) 82%, #ffffff 18%);
}

.sidebar-project-link.active {
  color: var(--text);
  border-color: transparent;
  background: color-mix(in srgb, var(--brand) 18%, var(--card-bg));
}

.sidebar-project-link.archived {
  opacity: 0.9;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  flex: 0 0 auto;
}

.profile-trigger {
  border: 0;
  background: #1a1d1f;
  color: #ffffff;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
}

.profile-trigger:hover {
  background: #353839;
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #353839;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.profile-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.profile-meta {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.profile-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email {
  color: #c1c6cc;
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.nav-link,
.navbar-brand,
.text-muted,
.form-label,
.small {
  color: var(--muted) !important;
}

.navbar-brand {
  color: var(--text) !important;
}

.panel {
  border-radius: 14px;
  background: var(--panel);
  border: 0;
  box-shadow: none;
}

.dot,
.dot-ring {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border-radius: 999px;
  box-sizing: border-box;
  flex: 0 0 14px;
  aspect-ratio: 1 / 1;
}

.dot {
  border: 1px solid color-mix(in srgb, var(--text) 70%, transparent);
}

.dot-ring {
  border: 4px solid var(--ring-color, var(--brand));
  background: transparent;
}

.form-control,
.form-select,
.btn {
  border-radius: 10px;
}

.btn svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.form-control,
.form-select {
  border-color: transparent;
  background: color-mix(in srgb, var(--card-bg) 90%, #ffffff 10%);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--brand) 28%, transparent);
  border-color: transparent;
}

.project-card {
  color: inherit;
  text-decoration: none;
}

.project-card:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
}

.stat .value {
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
}

.project-page-top {
  display: grid;
  gap: 4px;
}

.project-page-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.project-info-strip {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-info-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.project-info-item strong {
  color: var(--text);
}

.project-info-icon {
  opacity: 0.9;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-info-icon svg,
.metric-icon {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.stage-col {
  min-height: 260px;
  position: relative;
  overflow: hidden;
}

.stage-col.js-stage-edit-surface {
  cursor: pointer;
}

.stage-col::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--stage-accent, #5ec4ff);
}

.stage-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.stage-head {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.stage-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-head-row-title {
  align-items: flex-start;
}

.stage-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-status-chip-idle {
  background: color-mix(in srgb, var(--border) 30%, transparent);
  border-color: color-mix(in srgb, var(--border) 55%, transparent);
  color: var(--muted);
}

.stage-status-chip-active {
  background: color-mix(in srgb, var(--accent-blue) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent-blue) 48%, transparent);
  color: #d6ebff;
}

.stage-status-chip-done {
  background: color-mix(in srgb, #3f8f61 22%, transparent);
  border-color: color-mix(in srgb, #6dc28d 46%, transparent);
  color: #daf5e4;
}

.stage-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.stage-metric-plan {
  background: color-mix(in srgb, var(--accent-blue) 22%, var(--gray-onyx));
  color: #e3edf8;
}

.stage-metric-fact {
  background: rgba(253, 198, 147, 0.22);
  color: #f8eadf;
}

.stage-progress-wrap {
  display: grid;
  gap: 4px;
}

.stage-progressbar {
  height: 9px;
  border-radius: 999px;
  background: #1c2f45;
  overflow: hidden;
}

.stage-progressbar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--stage-accent, #5ec4ff);
}

.stage-progress-label {
  font-size: 11px;
  color: var(--muted);
}

.project-empty-stage .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-empty-stage-copy {
  color: var(--muted);
}

.task-card {
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--card-bg) 88%, #0e1318 12%);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-col .task-card {
  padding-right: 10px;
}

.task-delete-top {
  position: static;
}

.stage-col .task-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.date-plain-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.date-plain-inline {
  display: inline-block;
}

.task-date-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.task-date-badge-empty {
  cursor: default;
  opacity: 0.82;
}

.task-stage-done {
  border: 1px solid #495057;
  background: #1f2123;
  color: #cfd3d7;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex: 0 0 auto;
}

.task-stage-done svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.task-card:not(.done) .task-stage-done:hover,
.task-card:not(.done) .task-stage-done:focus-visible {
  background: #1ca168;
  border-color: #1ca168;
  color: #fff;
  box-shadow: 0 0 0 3px #1ca16833;
}

.task-card:not(.done) .task-stage-done:hover svg,
.task-card:not(.done) .task-stage-done:focus-visible svg {
  opacity: 1;
}

.task-card.done .task-stage-done {
  background: #2f654b;
  border-color: #3b7e5b;
  color: #e4f7ed;
}

.task-card.done .task-stage-done svg {
  opacity: 1;
}

.stage-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.1;
  white-space: nowrap;
}

.stage-inline-edit {
  color: var(--text);
  cursor: pointer;
}

.stage-inline-edit:hover {
  opacity: 0.92;
}

.stage-col .task-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 20px;
}

.task-metric-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  padding: 3px 9px;
  background: #242527;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.1;
  cursor: pointer;
}

.task-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #242527;
}

.task-controls-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-fact-label {
  opacity: 0.78;
}

.project-task-fact-btn {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
}

.project-task-fact-btn .timer-live.tiny {
  margin-left: 0;
  border: 0;
  border-radius: 10px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1;
}

.project-task-fact-btn:hover .timer-live.tiny {
  background: rgba(255, 255, 255, 0.16);
}

.project-task-fact-btn.project-task-fact-btn-over .timer-live.tiny {
  background: rgba(255, 149, 149, 0.22);
  color: #ffdfe3;
}

.task-metric-btn:hover {
  background: #2f3234;
}

.task-metric-btn .metric-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.task-metric-btn-fact {
  background: #2a3a3a;
}

.task-metric-btn-fact:hover {
  background: #324647;
}

.task-inline-edit {
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.task-inline-edit:hover {
  opacity: 0.92;
}

.stage-col .task-meta-row .priority {
  font-size: 9px;
  cursor: pointer;
  margin-left: auto;
}

.stage-col .js-task-edit-trigger {
  cursor: pointer;
}

.task-card.done {
  opacity: 0.40;
}

.task-title {
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  min-width: 0;
}

.priority {
  text-transform: none;
  font-size: 10px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid transparent;
}

.priority.high { background: #ffe5e5; color: #9f1616; border-color: #f5bcbc; }
.priority.medium { background: #fff3d7; color: #9a6a00; border-color: #f4dfaa; }
.priority.low { background: #dffbe7; color: #0e7a37; border-color: #bdebc9; }
.priority.frozen { background: #ddeeff; color: #1f5d9f; border-color: #bfd8f1; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.tasks-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.day-col {
  min-height: 520px;
}

.day-head {
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.day-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.day-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.day-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.day-stats {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-stat {
  font-size: 11px;
  color: #e3edf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

.day-stat .lbl {
  min-width: auto;
  opacity: 0.82;
}

.day-stat-plan {
  background: color-mix(in srgb, var(--accent-blue) 22%, var(--gray-onyx));
}

.day-stat-fact {
  background: rgba(253, 198, 147, 0.22);
  color: #f8eadf;
}

.day-stat-fact.day-stat-over {
  background: rgba(255, 149, 149, 0.22);
  border-color: rgba(255, 149, 149, 0.42);
  color: #ffd3d8;
}

.day-body {
  padding: 10px;
  display: grid;
  gap: 10px;
}

.week-task {
  cursor: grab;
}

.week-task.dragging {
  opacity: 0.55;
}

.week-task.done {
  opacity: 0.45;
  filter: saturate(0.72);
}

.task-path {
  font-size: 10px;
  font-weight: 400;
  margin-bottom: 4px;
  width: 90%;
  display: inline;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  white-space: normal;
}

.task-path:hover {
  color: #ffffff !important;
}

.overdue-mark {
  display: inline-flex;
  align-items: center;
  margin-bottom: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgb(255, 149, 149);
  font-size: 11px;
  font-weight: 500;
}

.week-task.overdue .task-title {
  color: #ffffff !important;
}

.week-task.priority-high {
  border-color: #f08b8b;
  box-shadow: inset 0 0 0 1px #f08b8b33;
}

.week-task.priority-low {
  border-color: #6fa7e8;
  box-shadow: inset 0 0 0 1px #6fa7e833;
}

.task-time-btn {
  margin-top: 0;
  border-radius: 8px;
  border: none;
  padding: 3px 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.week-task .task-title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.week-task .task-time-btn .estimate-label {
  font-weight: 600;
}

.task-time-btn-plan {
  padding: 0;
  background: transparent;
  color: #ffffff;
  gap: 8px;
}

.task-time-btn-plan .small {
  color: rgba(255, 255, 255, 0.72) !important;
  margin: 0;
}

.task-time-btn-plan .estimate-label {
  font-size: 0.95rem;
  color: #ffffff;
}

.task-subtask-add {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: #999999 !important;
  font-size: 11px;
  text-decoration: none !important;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-subtask-add:hover {
  color: #a8c2e1;
}

.subtasks-list {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.subtask-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtask-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: #9db2cb;
  line-height: 1.35;
}

.subtask-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #537191;
  background: #1a2c40;
  cursor: pointer;
  position: relative;
}

.subtask-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 7px;
  border-right: 1.5px solid #e6f3ff;
  border-bottom: 1.5px solid #e6f3ff;
  transform: rotate(45deg);
}

.subtask-item input[type="checkbox"]:checked {
  background: #2e4a69;
  border-color: #7798bd;
}

.subtask-item.done .txt {
  text-decoration: line-through;
  opacity: 0.55;
}

.subtask-delete-btn {
  width: 24px;
  min-width: 24px;
  height: 24px;
  line-height: 1;
  padding: 0;
  border-radius: 7px;
}

.subtask-delete-btn svg {
  width: 11px;
  height: 11px;
}

.task-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 10px;
  background: #242527;
}

.timer-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.week-task.done .timer-toggle {
  pointer-events: none;
}

.timer-live {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.timer-live.tiny {
  font-size: 0.72rem;
  border: 1px solid #496685;
  border-radius: 7px;
  padding: 1px 6px;
  background: #152739;
}

.week-task .timer-toggle {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  border-radius: 7px;
  border-color: #4a6889;
  background: #1a2b3e;
  color: #d9ebff;
}

.week-task .timer-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.week-task .timer-toggle.timer-off {
  border-color: #4a6889;
  background: #1a2b3e;
  color: #d9ebff;
}

.week-task .timer-toggle.timer-off:hover {
  background: #22384f;
  border-color: #6a87a8;
  color: #ffffff;
}

.task-card .timer-toggle {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  border-radius: 7px;
  border: 0;
  background: #242527;
  color: #ffffff;
}

.task-card .timer-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.task-card .timer-toggle.timer-off:hover {
  background: #2f3234;
}

.task-card .timer-toggle.timer-on,
.task-card .timer-toggle.timer-on:hover {
  background: #8f6734;
  color: #fff4dd;
}

.task-card .timer-live {
  margin-left: 4px;
}

.task-card .timer-live.tiny {
  border: 0;
  border-radius: 10px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.task-card .timer-live.is-running {
  background: #8f6734;
  color: #fff4dd;
}

.task-card .task-metric-btn {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

.task-card .task-metric-btn-fact {
  background: rgba(253, 198, 147, 0.22) !important;
  color: rgba(255, 255, 255, 0.82) !important;
}

.task-card .task-metric-btn-fact-over {
  background: rgba(255, 149, 149, 0.22) !important;
  color: rgba(255, 255, 255, 0.82) !important;
}

.week-task .timer-toggle.timer-on {
  border-color: #c7832d;
  background: #8e4f08;
  color: #ffe7c8;
}

.week-task .timer-live.is-running {
  border-color: #c7832d;
  color: #ffd8ad;
  background: #3b2a16;
}

.task-done-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}

.task-done-toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.done-indicator {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid #95abc4;
  background: #ffffff16;
  color: transparent;
  font-weight: 800;
  transition: all 0.18s ease;
}

.done-indicator svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.fp-task-btn {
  border: 1px solid #4d4d4d;
  background: #242527;
  color: #ffffff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fp-task-btn.is-on {
  border-color: #7f94a7;
  color: #ffffff;
  background: #5f7d95;
}

.modal-anchored {
  overflow: visible;
}

.modal-anchored .modal-dialog {
  max-width: min(360px, calc(100vw - 24px));
}

.modal-anchored .modal-content {
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.mini-field-modal .modal-dialog {
  max-width: min(260px, calc(100vw - 24px));
}

.mini-field-modal .modal-dialog,
.mini-field-modal .modal-content {
  transition: none !important;
}

.mini-field-modal .modal-content {
  max-height: calc(100vh - 24px);
  overflow: visible;
}

.mini-field-modal .modal-body {
  overflow: visible;
}

.mini-field-modal .modal-header,
.mini-field-modal .modal-body,
.mini-field-modal .modal-footer {
  padding: 0.55rem 0.65rem;
}

.mini-field-modal .modal-title {
  font-size: 1rem;
}

.mini-field-modal .modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
}

.mini-field-modal .btn {
  font-size: 0.82rem;
}

.mini-field-modal .modal-head-actions .btn-close {
  margin: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  opacity: 0.85;
}

.mini-field-modal .modal-head-actions .btn-close:hover {
  opacity: 1;
}

.modal-wide-form {
  max-width: min(760px, calc(100vw - 28px));
}

.modal-compact-form {
  max-width: min(560px, calc(100vw - 28px));
}

.project-form-grid .form-control-color {
  width: 100%;
  min-width: 0;
}

.project-form-grid > [class*="col-"] {
  min-width: 0;
}

.modal-edit-task .modal-dialog {
  max-width: min(560px, calc(100vw - 28px));
}

.modal-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.modal-edit-task .modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.modal-edit-task .modal-title {
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-edit-task .modal-head-actions .btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.modal-edit-task .modal-head-actions .btn-close {
  margin: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  opacity: 0.85;
}

.modal-edit-task .modal-head-actions .btn-close:hover {
  opacity: 1;
}

.modal-icon-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-icon-action {
  width: 40px;
  height: 36px;
  padding: 0 !important;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.crm-deal-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.crm-deal-head-actions .crm-icon-action {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.crm-deal-head-actions .btn-icon-accent-success {
  color: #52d98c !important;
}

.crm-deal-head-actions .btn-icon-accent-success:hover,
.crm-deal-head-actions .btn-icon-accent-success:focus-visible {
  color: #7cf0ad !important;
  transform: scale(1.06);
}

.crm-deal-head-actions .btn-icon-accent-danger {
  color: #ff6b78 !important;
}

.crm-deal-head-actions .btn-icon-accent-danger:hover,
.crm-deal-head-actions .btn-icon-accent-danger:focus-visible {
  color: #ff98a2 !important;
  transform: scale(1.06);
}

.crm-deal-head-actions .crm-icon-action .sidebar-link-icon {
  width: 36px;
  height: 36px;
}

.crm-deal-head-actions .crm-icon-action svg {
  width: 36px !important;
  height: 36px !important;
  display: block;
}

.crm-deal-head-actions .crm-icon-action:hover,
.crm-deal-head-actions .crm-icon-action:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
}

.modal-compact-form .form-control,
.modal-compact-form .form-select {
  min-width: 0;
}

.modal-saving-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #cfd3d7;
}

.modal-saving-indicator[hidden] {
  display: none !important;
}

.modal-saving-indicator::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  opacity: 0.85;
  animation: modalSavingSpin 0.8s linear infinite;
}

@keyframes modalSavingSpin {
  to { transform: rotate(360deg); }
}

.modal-compact-form .modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.modal-compact-form .modal-title {
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-compact-form .modal-head-actions .btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.modal-compact-form .modal-head-actions .btn-close {
  margin: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  opacity: 0.85;
}

.modal-compact-form .modal-head-actions .btn-close:hover {
  opacity: 1;
}

.mini-field-modal .form-control,
.mini-field-modal .form-select,
.mini-field-modal .form-label {
  font-size: 0.85rem;
}

.delete-x {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  line-height: 1;
  padding: 0;
  font-size: 12px;
  color: #88a1be;
  border-color: #4c6480;
  background: #1a2a3c;
}

.delete-x:hover {
  color: #d9e7f8;
  border-color: #7791b0;
  background: #22384f;
}

.day-col.drop-hover {
  border-color: #7aa8ff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent);
}

.alert {
  border-radius: 10px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

input[type="date"],
input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.js-estimate-trigger {
  cursor: pointer;
}

.modal .btn-close {
  filter: none !important;
  opacity: 0.95 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 0 1 .293 14.293L6.586 8 .293 1.707a1 1 0 0 1 0-1.414Z'/%3e%3c/svg%3e") !important;
}

.modal .btn-close:hover {
  opacity: 1 !important;
}

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

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: block;
  }

  .sidebar-projects-list {
    max-height: none;
    overflow: visible;
  }
}

/* R-next.3 final palette and UI normalization (no gradients/borders/shadows) */
:root {
  --bg: #111315;
  --panel: #1a1d1f;
  --text: #ffffff;
  --muted: #cfd3d7;
  --border: #1a1d1f;
  --brand: #c0dbef;
  --card-bg: #353839;
  --success-soft: #67a986;
  --danger-soft: #c5878f;
  --warning-soft: #d2aa75;
}

body,
:root[data-theme="dark"] body,
body.dark-theme {
  background: #111315 !important;
  color: var(--text);
}

.app-sidebar {
  background: #242527 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}

.app-main {
  background: #111315 !important;
}

.panel,
.card.panel,
.stat.panel,
.project-info-item,
.week-day-col,
.week-task,
.task-card,
.task-subtask-row,
.subtask-item {
  border: 0 !important;
  box-shadow: none !important;
}

.panel,
.card.panel,
.stat.panel,
.project-info-item,
.modal-content.panel {
  background: #1a1d1f !important;
}

.task-card,
.week-task,
.sidebar-link.active,
.sidebar-project-link.active,
.sidebar-project-link:hover {
  background: #353839 !important;
}

.sidebar-link:hover {
  background: #353839 !important;
}

.form-control,
.form-select,
body.dark-theme .form-control,
body.dark-theme .form-select {
  background: #242527 !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
  background: #353839 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.btn,
.btn:focus,
.btn:active,
.btn:hover {
  box-shadow: none !important;
}

.btn-outline-secondary {
  background: #1a1d1f !important;
  border: 1px solid #4d4d4d !important;
  color: #fff !important;
  padding: 5px 7px 5px 3px;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background: #242527 !important;
  border-color: #5c5c5c !important;
}

.btn-secondary-ghost {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #cfd3d7 !important;
  padding: 5px 10px !important;
}

.btn-secondary-ghost:hover,
.btn-secondary-ghost:focus,
.btn-secondary-ghost:active {
  background: transparent !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

.btn-icon-only,
.btn-icon-text {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.btn-icon-only {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0 !important;
  border-radius: 10px;
}

.btn-sm.btn-icon-only {
  width: 30px;
  min-width: 30px;
  height: 22px;
  border-radius: 8px;
}

.btn-icon-only svg,
.btn-icon-text svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.btn-sm.btn-icon-only svg,
.btn-sm.btn-icon-text svg {
  width: 14px;
  height: 14px;
}

.btn-icon-text {
  justify-content: flex-start;
  padding: 5px 10px !important;
}

.btn-sm.btn-icon-text {
  padding: 5px 9px !important;
}

.btn-icon-text .btn-label {
  line-height: 1.1;
}

.btn-primary {
  background: #5f7d95 !important;
  border: 0 !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: #6f8ea6 !important;
}

.btn-success {
  background: #5e8a70 !important;
  border: 0 !important;
  color: #fff !important;
}

.btn-success:hover {
  background: #6d9a7f !important;
}

.btn-danger {
  background: #996774 !important;
  border: 0 !important;
  color: #fff !important;
}

.btn-warning {
  background: #b99a72 !important;
  border: 0 !important;
  color: #fff !important;
}

.priority-select {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 0.9rem !important;
  padding-right: 2rem !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 12px 10px !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10' fill='none'%3e%3cpath d='M2 2l6 6 6-6' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3e%3c/svg%3e") !important;
}

.priority-select.priority-high {
  background-color: #4b3434 !important;
  color: #ffd8d8 !important;
}

.priority-select.priority-medium {
  background-color: #4a4332 !important;
  color: #ffe9bf !important;
}

.priority-select.priority-low {
  background-color: #33463a !important;
  color: #c5ecd2 !important;
}

.priority-select option[value="high"] {
  background: #4b3434;
  color: #ffd8d8;
}

.priority-select option[value="medium"] {
  background: #4a4332;
  color: #ffe9bf;
}

.priority-select option[value="low"] {
  background: #33463a;
  color: #c5ecd2;
}

.priority-select option {
  background-image: none !important;
}

.priority-select-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.priority-select-ui {
  position: relative;
}

.priority-select-trigger {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #242527;
  color: #ffffff;
  min-height: 40px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.priority-select-trigger .label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.priority-select-trigger .caret {
  width: 12px;
  height: 12px;
  opacity: 0.85;
}

.priority-select-trigger .caret svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.priority-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 2000;
  background: #1a1d1f;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.38);
  display: none;
}

.priority-select-ui.open .priority-select-menu {
  display: block;
}

.priority-select-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.priority-select-item:hover {
  background: #242527;
}

.priority-select-item .label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.priority-select-item .check {
  width: 14px;
  height: 14px;
  opacity: 0;
}

.priority-select-item .check svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.priority-select-item.active .check {
  opacity: 1;
}

.priority-swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.priority-swatch.high { background: rgb(255, 149, 149); }
.priority-swatch.medium { background: rgb(255, 238, 152); }
.priority-swatch.low { background: rgb(192, 219, 239); }

.priority-select-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.priority-select-icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.priority-select-icon.high { color: rgb(255, 149, 149); }
.priority-select-icon.medium { color: rgb(255, 238, 152); }
.priority-select-icon.low { color: rgb(192, 219, 239); }

.crm-create-contact-link {
  font-size: 12px;
  text-decoration: none;
  color: #cfd3d7;
}

.crm-create-contact-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.btn svg,
.btn .sidebar-link-icon svg,
.sidebar-link-icon svg,
.project-info-icon svg,
.metric-icon,
.task-time-btn svg,
.task-subtask-add svg {
  fill: currentColor !important;
  color: currentColor !important;
}

.project-info-strip {
  background: #1a1d1f !important;
  border: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-info-strip .close-project-form {
  margin-left: auto !important;
}

.project-info-item {
  color: #fff !important;
}

.project-info-item strong,
.stage-inline-edit,
.task-title {
  color: #fff !important;
}

.project-page-breadcrumbs,
.text-muted,
.small,
.form-label,
.stage-progress-label,
.task-date-badge,
.stage-date-badge {
  color: #cfd3d7 !important;
}

.stage-col {
  background: #1a1d1f !important;
}

.stage-progressbar {
  background: #242527 !important;
}

.stage-progressbar > span {
  background: var(--stage-accent, #c0dbef) !important;
}

.stage-metric {
  background: #242527 !important;
  border: 0 !important;
  color: #fff !important;
}

.modal-content.panel {
  border: 1px solid #2a2d31 !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34) !important;
}

.modal-header {
  border-bottom: 1px solid #242527 !important;
}

.modal-footer {
  border-top: 1px solid #242527 !important;
}

.modal-body {
  border: 0 !important;
}

.task-subtask-add {
  text-decoration: none !important;
  color: #999999 !important;
}

.task-subtask-add:hover {
  color: #ffffff !important;
}

.task-card.done,
.week-task.done,
.task-card.is-done {
  opacity: 0.52 !important;
}

/* Tasks tab alignment with project/stage/task color system */
.tasks-board .week-task {
  background: #2e3033 !important;
}

.tasks-board .task-controls {
  gap: 5px;
}

.tasks-board .week-task .timer-toggle,
.tasks-board .week-task .timer-toggle.timer-off,
.tasks-board .week-task .timer-toggle.timer-on {
  background: #353839 !important;
  border: 0 !important;
  color: #ffffff !important;
}

.tasks-board .week-task .timer-toggle.timer-off:hover,
.tasks-board .week-task .timer-toggle.timer-on:hover {
  background: #353839 !important;
  color: #ffffff !important;
}

.tasks-board .week-task .timer-toggle.timer-on,
.tasks-board .week-task .timer-toggle.timer-on:hover {
  background: #8f6734 !important;
  color: #fff4dd !important;
}

.tasks-board .timer-live,
.tasks-board .timer-live.tiny,
.tasks-board .week-task .timer-live.is-running {
  background: #353839 !important;
  border: 0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.project-header-actions {
  position: relative;
}

.project-actions-toggle {
  background: #242527;
  border-color: #3a3d40;
  color: #ffffff;
}

.project-actions-toggle:hover,
.project-actions-toggle:focus-visible {
  background: #2d3033;
  border-color: #4a4d50;
  color: #ffffff;
}

.project-actions-dropdown {
  min-width: 230px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #1f2123;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.project-actions-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  color: #ffffff;
  padding: 9px 10px;
}

.project-actions-item:hover,
.project-actions-item:focus {
  background: #2a2d30;
  color: #ffffff;
}

.project-actions-item:disabled {
  opacity: 0.45;
}

.project-actions-item-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b9d5f2;
  flex: 0 0 auto;
}

.project-actions-item-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* P.2 + P.11 + P.15 visual system */
.stat .label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-trend {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.2;
  color: #b2b8be;
}

.stat-trend.up {
  color: #8dc39f;
}

.stat-trend.down {
  color: #d39aa3;
}

.stat-trend.flat {
  color: #9ba2aa;
}

.task-summary-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d7dbe0;
  font-size: 12px;
}

.summary-item strong {
  color: #ffffff;
  font-weight: 700;
}

.summary-item-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.summary-item-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

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

.month-day-cell {
  min-height: 110px;
  background: #1a1d1f;
  border-radius: 10px;
  padding: 9px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.month-day-cell.today {
  background: #242527;
}

.month-day-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.month-day-title {
  font-size: 11px;
  color: #ffffff;
  font-weight: 600;
}

.month-day-date {
  font-size: 11px;
  color: #c1c6cc;
}

.month-day-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.month-day-count {
  font-size: 11px;
  color: #aeb4bb;
}

@media (max-width: 1200px) {
  .month-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

.tasks-board .week-task .timer-live.is-running {
  background: #8f6734 !important;
  color: #fff4dd !important;
}

.tasks-board .subtask-item,
.tasks-board .subtask-item .txt {
  color: #ffffff !important;
}

.tasks-board .subtask-item input[type="checkbox"] {
  border: 0 !important;
  background: #242527 !important;
}

.task-day-add {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px dashed #4a5158;
  background: #242527;
  color: #b9b9b9;
  font-size: 12px;
}

.task-day-add-icon {
  color: inherit;
}

.task-day-add:hover:not(:disabled) {
  border-color: #6f7a84;
  color: #ffffff;
}

.task-day-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.task-day-add-icon,
.task-day-add-icon svg {
  width: 14px;
  height: 14px;
  display: inline-flex;
}

.task-day-add-icon svg {
  fill: currentColor;
}

.tasks-board .week-task.priority-high {
  border: 1px solid #d46a6a !important;
  box-shadow: inset 0 0 0 1px rgba(212, 106, 106, 0.28) !important;
}

.tasks-board .week-task.priority-low {
  border: 1px solid #6a98d4 !important;
  box-shadow: inset 0 0 0 1px rgba(106, 152, 212, 0.28) !important;
}

.tasks-board .week-task.priority-medium {
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

.tasks-board .subtask-item input[type="checkbox"]:checked {
  background: #5e8a70 !important;
  border: 0 !important;
}

/* Force dark calendar in all contexts (including anchored mini modals) */
.flatpickr-calendar,
.flatpickr-calendar.open,
.flatpickr-calendar.inline {
  background: #1a1d1f !important;
  color: #ffffff !important;
  border: 1px solid #303236 !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34) !important;
  box-sizing: border-box !important;
  width: min(320px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  overflow: auto !important;
  padding: 10px 10px 9px !important;
}

.flatpickr-calendar.fp-has-quick-actions {
  width: min(500px, calc(100vw - 24px)) !important;
}

.flatpickr-calendar.fp-has-quick-actions:not(.fp-range-mode) .flatpickr-rContainer,
.flatpickr-calendar.fp-has-quick-actions:not(.fp-range-mode) .flatpickr-weekdays,
.flatpickr-calendar.fp-has-quick-actions:not(.fp-range-mode) .flatpickr-days,
.flatpickr-calendar.fp-has-quick-actions:not(.fp-range-mode) .dayContainer {
  width: 308px !important;
  min-width: 308px !important;
  max-width: 308px !important;
}

.flatpickr-calendar.fp-range-mode {
  width: min(820px, calc(100vw - 24px)) !important;
}

.flatpickr-calendar.fp-range-mode .flatpickr-innerContainer {
  min-width: 0;
}

.flatpickr-calendar.fp-range-mode .flatpickr-rContainer {
  flex: 1 1 auto;
  width: 616px !important;
  min-width: 616px !important;
}

.flatpickr-calendar.fp-range-mode .flatpickr-weekdays {
  width: 616px !important;
}

.flatpickr-calendar.fp-range-mode .dayContainer,
.flatpickr-calendar.fp-range-mode .flatpickr-days {
  min-width: 0;
}

.flatpickr-calendar.fp-range-mode .dayContainer {
  width: 308px !important;
  min-width: 308px !important;
  max-width: 308px !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months,
span.flatpickr-weekday,
.flatpickr-weekday,
.flatpickr-day,
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
  color: #ffffff !important;
}

.flatpickr-calendar::before,
.flatpickr-calendar::after {
  display: none !important;
}

.flatpickr-months {
  margin-bottom: 8px;
}

.flatpickr-current-month {
  padding-top: 3px !important;
}

.flatpickr-weekdays {
  margin-bottom: 4px;
}

.flatpickr-days {
  padding-bottom: 2px;
}

.flatpickr-day {
  border-radius: 10px !important;
  width: 14.2857143% !important;
  max-width: none !important;
  flex-basis: 14.2857143% !important;
  line-height: 38px;
}

.flatpickr-day:hover {
  background: #353839 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #5f7d95 !important;
  border-color: transparent !important;
}

.flatpickr-day.inRange {
  background: #2a3136 !important;
  border-color: transparent !important;
}

.flatpickr-calendar.hasTime .flatpickr-time {
  border-top: 1px solid #2d3034 !important;
  margin-top: 8px;
  padding-top: 8px;
}

.fp-body-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fp-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #2d3034;
  display: grid;
  gap: 8px;
}

.fp-quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 132px;
  flex: 0 0 132px;
}

.flatpickr-calendar:not(.fp-has-quick-actions) .fp-body-row {
  display: block;
}

.flatpickr-calendar:not(.fp-has-quick-actions) .fp-quick-actions {
  display: none;
}

.fp-quick-btn {
  border: 1px solid #33373b;
  background: #202225;
  color: #f1f3f5;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}

.fp-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fp-action-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fp-action-btn {
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1.2;
  border: 1px solid transparent;
}

.fp-action-btn-primary {
  background: #5f7d95;
  border-color: #5f7d95;
  color: #ffffff;
}

.fp-action-btn-secondary {
  background: transparent;
  border-color: transparent;
  color: #b9b9b9;
  padding-right: 2px;
}

.fp-range-toggle {
  justify-self: start;
}

.fp-quick-btn:hover,
.fp-task-btn:hover,
.fp-action-btn:hover {
  filter: brightness(1.08);
}

@media (max-width: 640px) {
  .flatpickr-calendar.fp-range-mode {
    width: min(360px, calc(100vw - 24px)) !important;
  }

  .fp-body-row {
    flex-direction: column;
  }

  .fp-quick-actions {
    width: 100%;
    flex-basis: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fp-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .fp-action-main {
    justify-content: space-between;
  }

  .fp-range-toggle {
    width: 100%;
  }
}

/* Analytics page */
.analytics-filters .form-label {
  margin-bottom: 4px;
}

.analytics-presets-row .btn {
  min-width: 96px;
}

.analytics-metric .label {
  font-size: 12px;
  color: #cfd3d7;
}

.analytics-metric .value {
  margin-top: 4px;
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
}

.analytics-chart-wrap {
  position: relative;
  height: 320px;
}

.analytics-table {
  color: #ffffff;
}

.analytics-table > :not(caption) > * > * {
  border-bottom: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.analytics-table thead th {
  color: #cfd3d7 !important;
  font-weight: 600;
  font-size: 12px;
}

/* CRM */
.crm-metric .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.crm-metric .value {
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
}

.crm-pipeline-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  padding: 10px 12px;
  border-radius: 10px;
}

.crm-pipeline-link .title {
  font-weight: 700;
  margin-bottom: 2px;
}

.crm-pipeline-link .meta {
  color: var(--muted);
  font-size: 12px;
}

.crm-pipeline-link.active {
  background: color-mix(in srgb, var(--brand) 18%, var(--card-bg));
}

.crm-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #242527;
  color: #cfd3d7;
  font-size: 12px;
  font-weight: 600;
}

.crm-board-wrap {
  overflow-x: auto;
}

.crm-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 10px;
}

.crm-col {
  background: var(--panel);
  border-radius: 12px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.crm-col-head {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.crm-col-head .title {
  font-weight: 700;
  color: var(--text);
}

.crm-col-head .meta {
  font-size: 12px;
  color: var(--muted);
}

.crm-col-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  min-height: 300px;
}

.crm-stage-add-wrap {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
}

.crm-deal-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  cursor: grab;
  display: grid;
  gap: 7px;
}

.crm-deal-card.dragging {
  opacity: 0.55;
}

.deal-title {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}

.deal-meta {
  color: var(--muted);
  font-size: 12px;
}

.deal-primary-meta {
  min-height: 18px;
}

.deal-amount {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.deal-finance-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-inline-link {
  color: #ffffff;
  text-decoration: none;
}

.crm-inline-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.crm-inline-link.muted {
  color: #cfd3d7;
}

.crm-inline-link.muted:hover {
  color: #ffffff;
}

.crm-status-chip {
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  padding: 5px 8px;
  font-weight: 700;
  white-space: nowrap;
}

.crm-status-lead {
  background: color-mix(in srgb, #fdc693 26%, #242527);
  color: #f3d1b0;
}

.crm-status-order {
  background: color-mix(in srgb, #9B6DFF 28%, #242527);
  color: #d8c6ff;
}

.crm-status-payment {
  background: color-mix(in srgb, #6ec08e 26%, #242527);
  color: #bce7cc;
}

.crm-status-chip.active {
  outline: 1px solid color-mix(in srgb, #ffffff 22%, transparent);
}

/* R-next visual unification: priority/fact/overdue */
.priority {
  background: transparent !important;
  border: 0 !important;
  color: #ffffff !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.priority .priority-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.priority .priority-icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.priority.high .priority-icon { color: rgb(255, 149, 149); }
.priority.medium .priority-icon { color: rgb(255, 238, 152); }
.priority.low .priority-icon { color: rgb(192, 219, 239); }

.priority-select {
  color: #ffffff !important;
}

.priority-select.priority-high {
  background-color: rgb(255, 149, 149) !important;
  color: #ffffff !important;
}

.priority-select.priority-medium {
  background-color: rgb(255, 238, 152) !important;
  color: #111315 !important;
}

.priority-select.priority-low {
  background-color: rgb(192, 219, 239) !important;
  color: #111315 !important;
}

.priority-select option[value="high"] {
  background: rgb(255, 149, 149) !important;
  color: #ffffff !important;
}

.priority-select option[value="medium"] {
  background: rgb(255, 238, 152) !important;
  color: #111315 !important;
}

.priority-select option[value="low"] {
  background: rgb(192, 219, 239) !important;
  color: #111315 !important;
}

.task-metric-btn-fact,
.stage-metric-fact,
.day-stat-fact,
.fact-chip {
  background: rgba(253, 198, 147, 0.22) !important;
  color: #f8eadf !important;
}

.task-metric-btn-fact-over,
.stage-metric-over,
.day-stat-over,
.fact-chip-over {
  background: rgba(255, 149, 149, 0.22) !important;
  color: #ffd3d8 !important;
}

.overdue-mark {
  margin-bottom: 4px;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: rgb(255, 149, 149) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.overdue-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  line-height: 1;
  overflow: visible;
}

.overdue-icon:empty::before {
  content: "⚠";
  font-size: 16px;
  color: currentColor;
  line-height: 1;
}

.overdue-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}

.done-indicator {
  background: #242527 !important;
  border: 0 !important;
  color: transparent !important;
  box-shadow: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease !important;
}

.task-done-toggle input:checked + .done-indicator {
  background: #5e8a70 !important;
  border-color: #5e8a70 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(94, 138, 112, 0.18) !important;
}

.task-card.done .task-done-toggle input:checked + .done-indicator,
.week-task.done .task-done-toggle input:checked + .done-indicator {
  background: #2f654b !important;
  border-color: #2f654b !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.task-card:not(.done) .task-done-toggle:hover .done-indicator,
.task-card:not(.done) .task-done-toggle:focus-within .done-indicator,
.week-task:not(.done) .task-done-toggle:hover .done-indicator,
.week-task:not(.done) .task-done-toggle:focus-within .done-indicator {
  background: #1ca168 !important;
  border-color: #1ca168 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(28, 161, 104, 0.18) !important;
}

.crm-stage-add-deal {
  margin: 0;
  align-self: flex-start;
  min-height: 38px;
}

.crm-deal-open-btn {
  justify-self: flex-start;
}

.crm-col-head {
  min-height: 78px;
}

.admin-svg-preview {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1a1d1f;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.admin-svg-preview svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Dashboard */
.dashboard-morning-hero {
  background: linear-gradient(135deg, #1a1d1f 0%, #16191b 100%) !important;
}

.dashboard-morning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.dashboard-morning-main .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #97a0a8;
  margin-bottom: 10px;
}

.dashboard-morning-main .value {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
}

.dashboard-morning-main .delta {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #cfd3d7;
}

.dashboard-morning-main .delta.up {
  color: #8fd5aa;
}

.dashboard-morning-main .delta.down {
  color: #ff9ca5;
}

.dashboard-morning-side {
  display: grid;
  gap: 10px;
}

.dashboard-mini-stat {
  border-radius: 14px;
  background: #171a1c;
  border: 1px solid rgba(255,255,255,0.05);
  padding: 12px 14px;
}

.dashboard-mini-stat .label {
  display: block;
  font-size: 12px;
  color: #97a0a8;
  margin-bottom: 6px;
}

.dashboard-mini-stat strong {
  font-size: 1.2rem;
  color: #ffffff;
}

.dashboard-period-note {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.dashboard-period-total {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.dashboard-kpi {
  min-height: 124px;
}

.dashboard-kpi .meta {
  margin-top: 8px;
  font-size: 12px;
  color: #97a0a8;
}

.project-summary-card {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}

.project-summary-card:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.progress-line-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #1a1d1f;
  overflow: hidden;
}

.progress-line-fill {
  height: 100%;
  border-radius: 999px;
}

.project-summary-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #aab2b9;
}

.dashboard-weekly-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-summary-card {
  border-radius: 14px;
  background: #171a1c;
  border: 1px solid rgba(255,255,255,0.05);
  padding: 12px;
}

.dashboard-summary-card .label {
  font-size: 12px;
  color: #97a0a8;
  margin-bottom: 4px;
}

.dashboard-summary-card .value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.dashboard-crm-total {
  text-align: right;
}

.dashboard-crm-total .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

.dashboard-focus-list {
  display: grid;
  gap: 10px;
}

.dashboard-focus-card {
  display: block;
  text-decoration: none;
  color: #ffffff;
  background: #171a1c;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 12px 14px;
}

.dashboard-focus-card:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.dashboard-focus-card .topline,
.dashboard-focus-card .bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-focus-card .title {
  font-weight: 700;
}

.dashboard-focus-card .meta {
  margin-top: 5px;
  font-size: 12px;
  color: #aab2b9;
}

.dashboard-focus-card .bottomline {
  margin-top: 10px;
  font-size: 12px;
  color: #d9dee2;
}

.dashboard-focus-card .payment-state {
  color: #fdc693;
}

@media (max-width: 991px) {
  .dashboard-weekly-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-period-note {
    justify-items: start;
  }

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

  .stage-head-row,
  .project-empty-stage .card-body {
    align-items: flex-start;
  }
}
