:root {
  --page: #eef2f8;
  --sidebar: #0d1530;
  --sidebar-2: #111b3c;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --ink: #172033;
  --muted: #6b7280;
  --line: #dce3ef;
  --line-strong: #c6d1e2;
  --violet: #4c1d95;
  --violet-2: #6d28d9;
  --blue: #1d4ed8;
  --blue-2: #2563eb;
  --green: #047857;
  --orange: #c2410c;
  --red: #dc2626;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  z-index: 140;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  background: linear-gradient(180deg, var(--sidebar), #080d1f);
  color: #dbe5ff;
  padding: 22px 18px;
}

.brand,
.topbar,
.topbar-actions,
.view-tabs,
.section-head,
.board-switch,
.toolbar,
.stats,
.column-head,
.card-meta,
.tag-row,
.drawer-header,
.form-actions,
.row-actions,
.check-row,
.calendar-date,
.gantt-range {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-toggle {
  margin-left: auto;
  color: #e5edff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet-2), var(--blue-2));
  color: #fff;
  font-weight: 900;
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 20px;
}

.brand small,
.sidebar-footer,
.board-switch small,
.manager-item small,
.muted-text {
  color: #94a3b8;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.sidebar-action,
.view-tab,
.add-task-row,
.calendar-add,
.mini-task,
.gantt-title-button,
.gantt-bar {
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--violet-2), var(--blue-2));
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
}

.timer-button {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(109, 40, 217, 0.2);
  border-radius: 12px;
  background: #fff;
  color: var(--violet);
  padding: 0 12px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.timer-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ede9fe;
}

.timer-button em {
  color: var(--muted);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.timer-button.is-active {
  border-color: rgba(4, 120, 87, 0.35);
  background: #ecfdf5;
  color: var(--green);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  padding: 0 14px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fee2e2;
  color: #b91c1c;
  padding: 0 14px;
}

.danger-button.mini,
.ghost-button.mini {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #e5edff;
  font-size: 22px;
}

.full {
  width: 100%;
}

.sidebar-tools {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
}

.sidebar-tools .timer-button,
.sidebar-tools .ghost-button {
  width: 100%;
}

.sidebar-tools .timer-button {
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  text-align: left;
}

.sidebar-tools .theme-menu,
.sidebar-tools .management-menu {
  width: 100%;
}

.sidebar-tools .theme-popover,
.sidebar-tools .management-popover {
  left: 0;
  right: auto;
  width: min(260px, calc(100vw - 32px));
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 22px;
}

.view-tab {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 0 10px;
}

.view-tab.is-active {
  background: #fff;
  color: var(--violet);
}

.sidebar-section {
  min-height: 0;
  margin-bottom: 18px;
}

.sidebar-section:first-of-type {
  flex: 1 1 auto;
  overflow: hidden;
}

.section-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.section-head .icon-button {
  width: 30px;
  min-height: 30px;
  border-radius: 8px;
}

.board-list {
  display: grid;
  gap: 8px;
  max-height: 100%;
  overflow: auto;
  padding-right: 4px;
}

.board-switch {
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #dbeafe;
  padding: 10px;
  text-align: left;
}

.board-switch:hover,
.board-switch.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.board-dot,
.color-dot {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--board-color, var(--violet-2));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.board-switch strong,
.board-switch small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar-collapsed .brand {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
}

.sidebar-collapsed .brand div,
.sidebar-collapsed .section-head span,
.sidebar-collapsed .board-switch span:not(.board-dot),
.sidebar-collapsed .sidebar-footer span,
.sidebar-collapsed .sidebar-footer form,
.sidebar-collapsed .sidebar-tools,
.sidebar-collapsed .primary-button.full {
  display: none;
}

.sidebar-collapsed .sidebar .view-tabs {
  grid-template-columns: 1fr;
}

.sidebar-collapsed .sidebar .view-tab {
  min-width: 0;
  padding: 0;
  font-size: 12px;
}

.sidebar-collapsed .board-switch {
  justify-content: center;
  padding: 8px 0;
}

.sidebar-collapsed .board-dot {
  width: 34px;
  height: 34px;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
}

.sidebar-actions[hidden] {
  display: none;
}

.sidebar-action {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  text-align: left;
  padding: 0 12px;
}

.sidebar-action:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  background: var(--page);
}

.topbar {
  position: relative;
  z-index: 120;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 24px 28px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.board-heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--violet-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-heading h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.board-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 520px;
}

.topbar .view-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.topbar .view-tab {
  min-width: 82px;
  min-height: 36px;
  border-radius: 10px;
}

.management-menu,
.theme-menu {
  position: relative;
}

.menu-button,
.compact-button {
  min-width: 108px;
  font-weight: 900;
}

.compact-button.is-active {
  border-color: rgba(109, 40, 217, 0.36);
  background: #f3efff;
  color: var(--violet);
}

.management-popover,
.theme-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 220;
  display: grid;
  gap: 6px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.theme-popover {
  width: 260px;
  gap: 10px;
  padding: 12px;
}

.management-popover[hidden],
.theme-popover[hidden] {
  display: none;
}

.theme-popover label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.theme-popover input[type="color"] {
  width: 46px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 3px;
}

.theme-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 4px;
}

.theme-mode-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.theme-mode-toggle button.is-active {
  background: linear-gradient(135deg, var(--violet-2), var(--blue-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.25);
}

.theme-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.theme-presets button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.management-popover button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  text-align: left;
  font-weight: 850;
}

.management-popover button:hover {
  background: var(--surface-soft);
  color: var(--violet);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 12px;
}

.search-panel {
  position: relative;
  width: min(520px, 100%);
}

.search-panel .search-field {
  width: 100%;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-filter-button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.search-filters-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 240;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.search-filters-panel[hidden] {
  display: none;
}

.search-filters-panel label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.search-filters-panel .full {
  grid-column: 1 / -1;
}

.square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.period-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.period-button {
  min-width: 148px;
}

.toolbar {
  position: relative;
  z-index: 20;
  gap: 10px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.toolbar select {
  min-height: 40px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
}

.stats {
  gap: 12px;
  padding: 18px 28px 0;
}

.stats article {
  display: grid;
  gap: 2px;
  min-width: 136px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
}

.stats strong {
  color: var(--violet);
  font-size: 24px;
}

.stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.view-root {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px 28px 28px;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 340px);
  gap: 16px;
  align-items: start;
  min-height: 100%;
}

.board-column {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--status-color, var(--blue-2));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.board-column.is-over {
  outline: 3px solid rgba(109, 40, 217, 0.28);
  outline-offset: 2px;
}

.column-head {
  justify-content: space-between;
  gap: 10px;
}

.column-head h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 18px;
}

.column-head small {
  color: var(--muted);
  font-weight: 750;
}

.count-pill {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--violet);
  font-size: 13px;
  font-weight: 900;
}

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

.add-task-row {
  width: 100%;
  background: #eef2ff;
  color: var(--violet);
  text-align: left;
  padding: 0 12px;
}

.task-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

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

.task-card.is-dragging {
  opacity: 0.55;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-id,
.card-created,
.priority-pill,
.tag,
.employee-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.card-id {
  background: #e2e8f0;
  color: #475569;
}

.card-created {
  max-width: 150px;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}

.priority-pill {
  background: #dbeafe;
  color: var(--blue);
}

.priority-high,
.priority-urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-low {
  background: #dcfce7;
  color: #166534;
}

.task-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.task-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.35;
}

.card-meta {
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.employee-chip {
  max-width: 145px;
  overflow: hidden;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tag-row {
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: #f3e8ff;
  color: var(--violet);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.mobile-tabbar,
.mobile-menu-backdrop,
.mobile-task-list,
.mobile-agenda {
  display: none;
}

.mobile-status-group,
.mobile-day-section,
.mobile-task-card {
  min-width: 0;
}

.calendar-wrap,
.gantt-wrap {
  min-height: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  min-width: 1180px;
}

.calendar-cell {
  min-height: 220px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.calendar-cell.is-muted {
  background: #f8fafc;
  color: #94a3b8;
}

.calendar-date {
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 900;
}

.calendar-add {
  width: 100%;
  margin-bottom: 10px;
  background: #eef2ff;
  color: var(--violet);
  text-align: left;
  padding: 0 12px;
}

.mini-task {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 74px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mini-color, var(--blue-2));
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.mini-task span,
.mini-task em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-task strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-task.is-done {
  border-style: dashed;
  opacity: 0.72;
}

.mini-task.is-done strong {
  text-decoration: line-through;
}

.gantt {
  min-width: 1340px;
}

.gantt-head,
.gantt-row {
  display: grid;
  grid-template-columns: 320px repeat(var(--days), 72px);
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.gantt-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  font-weight: 850;
}

.gantt-title,
.gantt-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 0 10px;
}

.gantt-cell {
  justify-content: center;
}

.gantt-cell.is-today {
  background: #eef2ff;
  color: var(--violet);
}

.gantt-title-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0;
}

.gantt-title-button span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gantt-lane {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(var(--days), 72px);
  background: #fff;
}

.gantt-bar {
  align-self: center;
  min-width: 36px;
  height: 30px;
  border-radius: 999px;
  background: var(--task-color, var(--blue-2));
  color: #fff;
  overflow: hidden;
  padding: 0 12px;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gantt-bar.is-done {
  opacity: 0.72;
  text-decoration: line-through;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.38);
}

.side-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 310;
  display: flex;
  flex-direction: column;
  width: min(520px, 100vw);
  padding: 24px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: none;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.side-drawer.compact {
  width: min(430px, 100vw);
}

.side-drawer.wide {
  width: min(640px, 100vw);
}

.side-drawer.report-drawer {
  width: min(920px, 100vw);
  overflow-y: auto;
}

#analyticsDrawer.report-drawer {
  width: min(1220px, calc(100vw - 18px));
}

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

.drawer-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 26px;
}

.task-start-badge {
  display: grid;
  gap: 2px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 8px 10px;
  text-align: right;
}

.task-start-badge span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-start-badge strong {
  color: var(--ink);
  font-size: 14px;
}

.side-drawer .icon-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.stack-form {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: visible;
  padding-bottom: 6px;
}

.manager-form {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.stack-form label,
.login-box label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.stack-form input,
.stack-form textarea,
.stack-form select,
.login-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  outline: 0;
  padding: 9px 11px;
}

.stack-form textarea {
  resize: vertical;
}

.stack-form .task-title-input {
  min-height: 150px;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.35;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row > label:only-child {
  grid-column: 1 / -1;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.check-row {
  grid-template-columns: auto 1fr !important;
  justify-content: flex-start;
  gap: 8px !important;
}

.check-row input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.access-fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0;
  padding: 12px;
}

.access-fieldset legend {
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  padding: 0 6px;
}

.compact-note {
  margin: 0;
  font-size: 12px;
}

.board-access-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.access-check {
  min-height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px;
}

.custom-field-stack {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.top-custom-fields {
  border-top: 0;
  padding-top: 0;
}

.top-custom-fields:empty {
  display: none;
}

.compact-board-list {
  max-height: 190px;
  overflow: auto;
}

.task-extra {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
}

.tag-system-field {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  padding: 12px;
}

.tag-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.tag-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-picker-chips .empty-state {
  width: 100%;
  min-height: 54px;
  padding: 10px;
}

.tag-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3e8ff;
  color: var(--violet);
  padding: 0 10px 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.tag-picker-chip i {
  font-style: normal;
  opacity: 0.72;
}

.task-extra[hidden] {
  display: none;
}

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

.section-title-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.custom-field-title,
.section-title-row h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.inline-task-form,
.comment-form {
  display: grid;
  gap: 8px;
}

.inline-task-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.link-task-form {
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1.2fr) auto;
}

.inline-task-form input,
.inline-task-form select,
.comment-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.form-field-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.form-field-option .check-row {
  min-height: 38px;
}

.subtask-list,
.task-link-list,
.task-comment-list,
.task-history-list,
.task-attachment-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.task-attachment-list {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.task-attachment-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-decoration: none;
  font-weight: 850;
}

.task-attachment-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.task-attachment-card span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
}

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

.task-transfer-grid button {
  min-height: 42px;
}

.subtask-row,
.task-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 180px) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.subtask-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
}

.subtask-row input {
  width: 18px;
  min-height: 18px;
}

.subtask-row input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.task-link-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font-weight: 850;
}

.task-link-open span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-link-open small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-link-status {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
  font-weight: 800;
}

.is-read-only .task-card {
  cursor: pointer;
}

.is-read-only-drawer .custom-field-stack,
.is-read-only-drawer .task-extra {
  opacity: 0.95;
}

@media (max-width: 760px) {
  .task-link-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .link-task-form,
  .task-transfer-grid,
  .form-field-option {
    grid-template-columns: minmax(0, 1fr);
  }
}

.task-comment {
  display: grid;
  gap: 6px;
  border-left: 4px solid var(--comment-color, var(--violet-2));
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.task-comment div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-comment p {
  margin: 0;
  white-space: pre-wrap;
}

.task-history-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.task-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.task-history-head strong {
  color: var(--ink);
}

.task-history-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.task-history-item ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-history-item li {
  display: grid;
  grid-template-columns: minmax(100px, 0.6fr) minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-history-item li span,
.task-history-item li strong,
.task-history-item li em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-history-item li em {
  font-style: normal;
}

.task-history-item li strong {
  color: var(--ink);
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-badges span {
  border-radius: 999px;
  background: #eef2ff;
  color: var(--violet);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.custom-checkbox {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px 11px;
}

.form-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.manager-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.automation-list-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  margin-bottom: 16px;
  padding: 12px;
}

.automation-list {
  max-height: 260px;
  padding-right: 2px;
}

.manager-item.is-active {
  border-color: var(--violet);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--violet) 45%, transparent);
}

.report-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.report-controls label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.report-controls select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 11px;
}

.report-controls input,
.metric-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 11px;
}

.metric-manager {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 16px;
  padding: 14px;
}

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

.metric-form {
  display: grid;
  gap: 10px;
}

.compact-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.metric-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.metric-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
}

.metric-item strong,
.metric-item small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.metric-item small {
  color: var(--muted);
  font-size: 12px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-summary article,
.analytics-summary .analytics-metric-card,
.analytics-summary .custom-metric-card {
  display: grid;
  gap: 3px;
  align-content: center;
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 15px 16px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.analytics-summary .analytics-metric-card:hover,
.analytics-summary .custom-metric-card:hover {
  border-color: color-mix(in srgb, var(--violet) 55%, var(--line));
  transform: translateY(-1px);
}

.analytics-summary .analytics-metric-card:focus-visible,
.analytics-summary .custom-metric-card:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.analytics-summary strong {
  color: var(--violet);
  font-size: 30px;
  line-height: 1;
}

.analytics-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analytics-summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  opacity: 0.72;
}

.report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.report-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 0 14px;
  font-weight: 850;
}

.report-tab.is-active {
  border-color: transparent;
  background: var(--violet);
  color: #fff;
}

.analytics-report,
.logs-list {
  display: grid;
  gap: 10px;
  min-height: 240px;
  overflow: auto;
  padding-bottom: 28px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 190px;
  padding: 18px;
}

.chart-card h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 18px;
}

.analytics-drilldown {
  display: grid;
  gap: 16px;
}

.analytics-drilldown-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.analytics-drilldown-head h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 22px;
}

.analytics-drilldown-note {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 14px 16px;
  font-weight: 750;
}

.analytics-task-section {
  display: grid;
  gap: 10px;
}

.analytics-task-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

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

.analytics-task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.analytics-task-row:hover {
  border-color: color-mix(in srgb, var(--violet) 55%, var(--line));
  transform: translateY(-1px);
}

.analytics-task-row strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.analytics-task-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 2.4fr 40px;
  gap: 12px;
  align-items: center;
  min-height: 34px;
  color: #334155;
  font-size: 14px;
  font-weight: 750;
}

.bar-row span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar-row div {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet-2), var(--blue-2));
}

.bar-row strong {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

#analyticsDrawer .drawer-header {
  order: 1;
  margin-bottom: 12px;
}

#analyticsDrawer > .report-controls {
  order: 2;
  margin-bottom: 14px;
}

#analyticsDrawer .analytics-summary {
  order: 3;
}

#analyticsDrawer .report-tabs {
  order: 4;
}

#analyticsDrawer .analytics-report {
  order: 5;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

#analyticsDrawer .metric-manager {
  order: 6;
  margin-top: 16px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
}

.report-table th {
  background: var(--surface-soft);
  color: #475569;
  font-size: 13px;
}

.log-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px 14px;
}

.log-item span {
  color: var(--muted);
  font-size: 13px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1 1 auto;
}

.chat-sidebar,
.chat-main,
.chat-group-form,
.chat-group-list,
.chat-messages {
  min-width: 0;
}

.chat-sidebar,
.chat-main {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.chat-group-form {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
}

.chat-group-form input,
.chat-group-form select,
.chat-message-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

.chat-group-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.chat-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.chat-group-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
}

.danger-icon {
  color: #b91c1c;
}

.chat-group-item.is-active {
  border-color: rgba(109, 40, 217, 0.28);
  background: #f3efff;
}

.chat-group-item span {
  color: var(--muted);
  font-size: 12px;
}

.chat-main {
  grid-template-rows: minmax(0, 1fr) auto;
}

.chat-messages {
  display: grid;
  align-content: end;
  gap: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.chat-message {
  display: grid;
  gap: 6px;
  border-left: 4px solid var(--chat-color, var(--violet-2));
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.chat-message div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-task-chip {
  justify-self: start;
  max-width: 100%;
  border: 1px solid rgba(109, 40, 217, 0.2);
  border-radius: 999px;
  background: #f3efff;
  color: var(--violet);
  overflow: hidden;
  padding: 5px 9px;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 900;
}

.chat-message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.chat-file-button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--violet);
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.chat-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chat-file-name {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-paste-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.chat-paste-preview[hidden] {
  display: none;
}

.chat-paste-preview img {
  width: 72px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

.chat-paste-preview div {
  display: grid;
  min-width: 0;
}

.chat-paste-preview strong,
.chat-paste-preview span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-paste-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-attachment {
  display: grid;
  gap: 6px;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-decoration: none;
}

.chat-attachment img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface-soft);
}

.chat-attachment span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-attachment {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.manager-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
}

.manager-item strong,
.manager-item small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.color-dot {
  width: 14px;
  height: 38px;
  border-radius: 999px;
}

.row-actions {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.form-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.login-page,
.public-form-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(109, 40, 217, 0.22), transparent 34%),
    linear-gradient(135deg, #0d1530, #111827 54%, #1e1b4b);
}

.login-box,
.public-form-card {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #fff;
  padding: 30px;
  box-shadow: var(--shadow);
}

.public-form-card {
  width: min(620px, 100%);
}

.login-brand {
  margin-bottom: 0;
}

.login-brand strong {
  color: var(--ink);
}

.login-brand small {
  color: var(--muted);
}

.login-box h1,
.public-form-card h1 {
  margin: 0;
  font-size: 28px;
}

.login-box form {
  display: grid;
  gap: 14px;
}

.form-error {
  margin: -6px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 850;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: #dcfce7;
  color: var(--green);
  font-size: 34px;
  font-weight: 900;
}

.as-link {
  min-height: 46px;
}

.status-link-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
}

.status-link-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.status-link-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 11px;
}

.status-card {
  align-content: start;
}

.public-status-pill {
  justify-self: start;
  border-radius: 999px;
  background: color-mix(in srgb, var(--status-color, var(--blue-2)) 14%, white);
  color: var(--status-color, var(--blue-2));
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

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

.status-grid article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
}

.status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.public-description {
  margin: 0;
  white-space: pre-wrap;
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.select-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  text-align: left;
  font-weight: 750;
}

.toolbar .select-picker-button {
  min-width: 190px;
}

.select-picker-button span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-picker-button i {
  width: 9px;
  height: 9px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-2px) rotate(45deg);
}

.select-popover {
  position: fixed;
  z-index: 360;
  display: grid;
  gap: 4px;
  max-height: min(320px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid rgba(76, 29, 149, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 8px;
}

.select-popover[hidden] {
  display: none;
}

.select-option {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  text-align: left;
  font-weight: 800;
}

.select-option:hover {
  background: #eef2ff;
  color: var(--violet);
}

.select-option.is-selected {
  background: linear-gradient(135deg, var(--violet-2), var(--blue-2));
  color: #fff;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(76, 29, 149, 0.16);
  border-left: 5px solid var(--violet-2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.2);
  padding: 13px 14px;
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-chat {
  border-left-color: var(--blue-2);
}

.toast strong,
.toast p {
  margin: 0;
}

.toast strong {
  color: var(--ink);
  font-size: 14px;
}

.toast p {
  margin-top: 3px;
  color: #475569;
  line-height: 1.35;
}

.toast button {
  width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #475569;
  font-size: 20px;
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.48);
  padding: 18px;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-card {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.34);
  padding: 24px;
}

.confirm-card h2,
.confirm-card p {
  margin: 0;
}

.confirm-card h2 {
  font-size: 22px;
}

.confirm-card p {
  color: #475569;
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-actions button {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 900;
}

.confirm-actions .is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.automation-field-list {
  display: grid;
  gap: 10px;
}

.automation-condition-list {
  display: grid;
  gap: 10px;
}

.automation-condition-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.condition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: start;
}

.condition-grid > label {
  min-width: 0;
}

.automation-condition-body {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.8fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.automation-condition-body label {
  min-width: 0;
}

.automation-condition-row .select-picker-button {
  min-width: 0;
}

.condition-value-label {
  min-width: 0;
}

.condition-value-slot {
  display: block;
}

.condition-remove {
  align-self: end;
  width: 42px;
  grid-column: 2;
  grid-row: 1;
  border-color: var(--line);
  background: #fff;
  color: #b91c1c;
}

.task-autosave-status {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.automation-field-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.automation-clone-controls,
.automation-move-controls {
  transition: opacity 0.16s ease;
}

.automation-clone-box:has(#automationCloneEnabled:not(:checked)) .automation-clone-controls,
.automation-move-box:has(#automationMoveEnabled:not(:checked)) .automation-move-controls {
  opacity: 0.55;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.pretty-date-input {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%234c1d95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 42px !important;
}

.date-popover {
  position: fixed;
  z-index: 360;
  width: min(292px, calc(100vw - 24px));
  border: 1px solid rgba(76, 29, 149, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 12px;
}

.date-picker-head,
.date-picker-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.date-picker-head button,
.date-picker-actions button,
.date-day {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  min-height: 34px;
  font-weight: 850;
}

.date-picker-head button {
  width: 34px;
  font-size: 24px;
}

.date-weekdays,
.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-weekdays {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.date-day:hover {
  background: #eef2ff;
}

.date-day.is-muted {
  color: #94a3b8;
}

.date-day.is-today {
  color: var(--violet);
}

.date-day.is-selected {
  background: linear-gradient(135deg, var(--violet-2), var(--blue-2));
  color: #fff;
}

.date-picker-actions {
  margin-top: 10px;
}

.date-picker-actions button {
  color: var(--violet);
}

body[data-theme-mode="dark"] {
  --page: #050914;
  --sidebar: #050b1f;
  --sidebar-2: #07122c;
  --surface: rgba(17, 28, 55, 0.9);
  --surface-soft: rgba(33, 45, 78, 0.72);
  --ink: #f3f7ff;
  --muted: #9aa8c7;
  --line: rgba(151, 171, 220, 0.18);
  --line-strong: rgba(172, 190, 235, 0.34);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  background:
    radial-gradient(circle at 72% 6%, rgba(37, 99, 235, 0.28), transparent 34%),
    radial-gradient(circle at 30% 0%, rgba(124, 58, 237, 0.34), transparent 30%),
    linear-gradient(145deg, #050914 0%, #071126 48%, #050914 100%);
  color: var(--ink);
}

body[data-theme-mode="dark"] .app-shell {
  background: transparent;
}

body[data-theme-mode="dark"] .sidebar {
  border-right: 1px solid rgba(151, 171, 220, 0.18);
  background:
    linear-gradient(180deg, rgba(5, 11, 31, 0.96), rgba(7, 13, 29, 0.98)),
    radial-gradient(circle at 20% 0%, rgba(124, 58, 237, 0.24), transparent 34%);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.28);
}

body[data-theme-mode="dark"] .workspace {
  background:
    radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.24), transparent 28%),
    radial-gradient(circle at 14% 12%, rgba(124, 58, 237, 0.18), transparent 30%),
    linear-gradient(150deg, rgba(7, 13, 30, 0.96), rgba(8, 15, 34, 0.92));
}

body[data-theme-mode="dark"] .topbar,
body[data-theme-mode="dark"] .toolbar {
  border-color: rgba(151, 171, 220, 0.16);
  background: rgba(6, 12, 29, 0.72);
  backdrop-filter: blur(18px);
}

body[data-theme-mode="dark"] .view-root {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 170px),
    radial-gradient(circle at 78% 4%, rgba(37, 99, 235, 0.13), transparent 34%);
}

body[data-theme-mode="dark"] .ghost-button,
body[data-theme-mode="dark"] .timer-button,
body[data-theme-mode="dark"] .search-field,
body[data-theme-mode="dark"] .search-filter-button,
body[data-theme-mode="dark"] .toolbar select,
body[data-theme-mode="dark"] .select-picker-button,
body[data-theme-mode="dark"] input,
body[data-theme-mode="dark"] textarea,
body[data-theme-mode="dark"] select {
  border-color: rgba(151, 171, 220, 0.18);
  background: rgba(25, 36, 67, 0.72);
  color: var(--ink);
}

body[data-theme-mode="dark"] .ghost-button:hover,
body[data-theme-mode="dark"] .compact-button.is-active,
body[data-theme-mode="dark"] .timer-button.is-active {
  border-color: rgba(167, 139, 250, 0.42);
  background: rgba(81, 55, 156, 0.34);
  color: #fff;
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.2);
}

body[data-theme-mode="dark"] .primary-button {
  background: linear-gradient(135deg, #6d28d9, #2563eb);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.22);
}

body[data-theme-mode="dark"] .stats article,
body[data-theme-mode="dark"] .board-column,
body[data-theme-mode="dark"] .calendar-wrap,
body[data-theme-mode="dark"] .gantt-wrap,
body[data-theme-mode="dark"] .metric-manager,
body[data-theme-mode="dark"] .manager-item,
body[data-theme-mode="dark"] .analytics-summary article,
body[data-theme-mode="dark"] .analytics-summary .analytics-metric-card,
body[data-theme-mode="dark"] .analytics-summary .custom-metric-card,
body[data-theme-mode="dark"] .analytics-task-row,
body[data-theme-mode="dark"] .analytics-drilldown-note,
body[data-theme-mode="dark"] .analytics-report,
body[data-theme-mode="dark"] .chart-card,
body[data-theme-mode="dark"] .table-wrap,
body[data-theme-mode="dark"] .report-table,
body[data-theme-mode="dark"] .chat-sidebar,
body[data-theme-mode="dark"] .chat-main,
body[data-theme-mode="dark"] .chat-group-form,
body[data-theme-mode="dark"] .chat-group-list,
body[data-theme-mode="dark"] .chat-messages,
body[data-theme-mode="dark"] .status-grid article,
body[data-theme-mode="dark"] .task-extra,
body[data-theme-mode="dark"] .tag-system-field,
body[data-theme-mode="dark"] .task-start-badge,
body[data-theme-mode="dark"] .subtask-row,
body[data-theme-mode="dark"] .task-link-row,
body[data-theme-mode="dark"] .task-attachment-card,
body[data-theme-mode="dark"] .task-comment,
body[data-theme-mode="dark"] .task-history-item,
body[data-theme-mode="dark"] .custom-checkbox,
body[data-theme-mode="dark"] .form-field-option,
body[data-theme-mode="dark"] .automation-condition-row {
  border-color: rgba(151, 171, 220, 0.18);
  background: rgba(18, 30, 58, 0.72);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

body[data-theme-mode="dark"] .board-column {
  background: linear-gradient(180deg, rgba(20, 32, 63, 0.86), rgba(12, 22, 47, 0.78));
  border-color: color-mix(in srgb, var(--status-color, var(--blue-2)) 46%, rgba(151, 171, 220, 0.18));
  border-top-color: color-mix(in srgb, var(--status-color, var(--blue-2)) 88%, #ffffff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px color-mix(in srgb, var(--status-color, var(--blue-2)) 18%, transparent),
    0 0 22px color-mix(in srgb, var(--status-color, var(--blue-2)) 34%, transparent);
}

body[data-theme-mode="dark"] .board-column .column-head h2 {
  text-shadow: 0 0 14px color-mix(in srgb, var(--status-color, var(--blue-2)) 60%, transparent);
}

body[data-theme-mode="dark"] .calendar-cell,
body[data-theme-mode="dark"] .gantt-lane {
  border-color: rgba(151, 171, 220, 0.16);
  background: rgba(9, 17, 36, 0.64);
}

body[data-theme-mode="dark"] .calendar-cell.is-muted,
body[data-theme-mode="dark"] .gantt-head {
  background: rgba(12, 22, 45, 0.9);
  color: #9aa8c7;
}

body[data-theme-mode="dark"] .calendar-add,
body[data-theme-mode="dark"] .mini-task,
body[data-theme-mode="dark"] .gantt-cell.is-today {
  border-color: rgba(151, 171, 220, 0.18);
  background: rgba(38, 52, 92, 0.74);
  color: #dbe7ff;
}

body[data-theme-mode="dark"] .task-card {
  border-color: rgba(151, 171, 220, 0.2);
  background:
    linear-gradient(160deg, rgba(35, 48, 86, 0.92), rgba(17, 27, 54, 0.95)),
    radial-gradient(circle at 88% 0%, rgba(124, 58, 237, 0.22), transparent 30%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

body[data-theme-mode="dark"] .mobile-status-group,
body[data-theme-mode="dark"] .mobile-day-section,
body[data-theme-mode="dark"] .mobile-task-card,
body[data-theme-mode="dark"] .mobile-tabbar {
  border-color: rgba(151, 171, 220, 0.2);
  background:
    linear-gradient(160deg, rgba(35, 48, 86, 0.95), rgba(12, 22, 45, 0.98)),
    radial-gradient(circle at 92% 4%, rgba(124, 58, 237, 0.2), transparent 32%);
}

body[data-theme-mode="dark"] .mobile-task-card p,
body[data-theme-mode="dark"] .mobile-task-meta,
body[data-theme-mode="dark"] .mobile-task-range,
body[data-theme-mode="dark"] .mobile-day-head span {
  color: #aebbd3;
}

body[data-theme-mode="dark"] .task-card:hover {
  border-color: rgba(191, 219, 254, 0.38);
  box-shadow: 0 20px 54px rgba(37, 99, 235, 0.18);
}

body[data-theme-mode="dark"] .add-task-row,
body[data-theme-mode="dark"] .empty-state,
body[data-theme-mode="dark"] .count-pill,
body[data-theme-mode="dark"] .employee-chip,
body[data-theme-mode="dark"] .card-id,
body[data-theme-mode="dark"] .card-created,
body[data-theme-mode="dark"] .tag,
body[data-theme-mode="dark"] .tag-picker-chip,
body[data-theme-mode="dark"] .task-badges span,
body[data-theme-mode="dark"] .chat-task-chip,
body[data-theme-mode="dark"] .chat-file-button,
body[data-theme-mode="dark"] .chat-paste-preview {
  border-color: rgba(151, 171, 220, 0.18);
  background: rgba(38, 52, 92, 0.74);
  color: #dbe7ff;
}

body[data-theme-mode="dark"] .side-drawer,
body[data-theme-mode="dark"] .confirm-card {
  border-color: rgba(151, 171, 220, 0.2);
  background:
    radial-gradient(circle at 92% 0%, rgba(37, 99, 235, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(15, 27, 56, 0.98), rgba(9, 16, 35, 0.98));
  color: var(--ink);
  box-shadow: none;
}

body[data-theme-mode="dark"] .drawer-backdrop {
  background: rgba(1, 6, 18, 0.36);
  backdrop-filter: none;
}

body[data-theme-mode="dark"] .management-popover,
body[data-theme-mode="dark"] .theme-popover,
body[data-theme-mode="dark"] .search-filters-panel,
body[data-theme-mode="dark"] .select-popover,
body[data-theme-mode="dark"] .date-popover,
body[data-theme-mode="dark"] .toast {
  border-color: rgba(151, 171, 220, 0.2);
  background: rgba(12, 22, 45, 0.96);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
}

body[data-theme-mode="dark"] .management-popover button:hover,
body[data-theme-mode="dark"] .select-option:hover,
body[data-theme-mode="dark"] .date-day:hover,
body[data-theme-mode="dark"] .view-tab.is-active {
  background: rgba(79, 70, 229, 0.26);
  color: #fff;
}

body[data-theme-mode="dark"] .theme-mode-toggle,
body[data-theme-mode="dark"] .theme-presets button {
  border-color: rgba(151, 171, 220, 0.18);
  background: rgba(25, 36, 67, 0.78);
}

body[data-theme-mode="dark"] .search-filters-panel label,
body[data-theme-mode="dark"] .task-start-badge strong {
  color: var(--ink);
}

body[data-theme-mode="dark"] .view-tab,
body[data-theme-mode="dark"] .sidebar-action,
body[data-theme-mode="dark"] .board-switch,
body[data-theme-mode="dark"] .ghost-button,
body[data-theme-mode="dark"] .search-filter-button,
body[data-theme-mode="dark"] .compact-button,
body[data-theme-mode="dark"] .menu-button,
body[data-theme-mode="dark"] .timer-button,
body[data-theme-mode="dark"] .add-task-row,
body[data-theme-mode="dark"] .calendar-add,
body[data-theme-mode="dark"] .gantt-title-button,
body[data-theme-mode="dark"] .management-popover button,
body[data-theme-mode="dark"] .theme-presets button,
body[data-theme-mode="dark"] .date-picker-actions button,
body[data-theme-mode="dark"] .date-day.is-today,
body[data-theme-mode="dark"] .stats strong,
body[data-theme-mode="dark"] .count-pill {
  color: #f3f7ff;
}

body[data-theme-mode="dark"] .task-card p,
body[data-theme-mode="dark"] .confirm-card p,
body[data-theme-mode="dark"] .stack-form label,
body[data-theme-mode="dark"] .login-box label,
body[data-theme-mode="dark"] .report-controls label,
body[data-theme-mode="dark"] .automation-field-row,
body[data-theme-mode="dark"] .theme-popover label,
body[data-theme-mode="dark"] .toast p {
  color: var(--muted);
}

body[data-theme-mode="dark"] .stack-form label > span,
body[data-theme-mode="dark"] .stack-form label > strong {
  color: #dbe7ff;
}

body[data-theme-mode="dark"] #analyticsDrawer {
  background:
    radial-gradient(circle at 92% 0%, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(11, 21, 46, 0.99), rgba(7, 13, 29, 0.99));
}

body[data-theme-mode="dark"] .analytics-summary article,
body[data-theme-mode="dark"] .analytics-summary .analytics-metric-card,
body[data-theme-mode="dark"] .analytics-summary .custom-metric-card,
body[data-theme-mode="dark"] .analytics-task-row,
body[data-theme-mode="dark"] .analytics-drilldown-note,
body[data-theme-mode="dark"] .chart-card {
  border-color: rgba(151, 171, 220, 0.28);
  background: rgba(17, 31, 63, 0.94);
}

body[data-theme-mode="dark"] .analytics-summary strong {
  color: #ffffff;
  opacity: 1;
  text-shadow: 0 0 16px rgba(124, 58, 237, 0.38);
}

body[data-theme-mode="dark"] .analytics-summary span,
body[data-theme-mode="dark"] .analytics-summary em,
body[data-theme-mode="dark"] .analytics-drilldown-head h3,
body[data-theme-mode="dark"] .analytics-task-section h4,
body[data-theme-mode="dark"] .analytics-task-row strong,
body[data-theme-mode="dark"] .chart-card h3,
body[data-theme-mode="dark"] .bar-row,
body[data-theme-mode="dark"] .bar-row strong,
body[data-theme-mode="dark"] .report-table td {
  color: #edf4ff;
}

body[data-theme-mode="dark"] .analytics-task-row small,
body[data-theme-mode="dark"] .analytics-drilldown-note {
  color: #aebce0;
}

body[data-theme-mode="dark"] .bar-row div {
  background: rgba(214, 226, 246, 0.18);
}

body[data-theme-mode="dark"] .report-table th {
  background: rgba(33, 45, 78, 0.9);
  color: #dbe7ff;
}

body[data-theme-mode="dark"] .report-tab {
  border-color: rgba(151, 171, 220, 0.28);
  background: rgba(17, 31, 63, 0.82);
  color: #edf4ff;
}

body[data-theme-mode="dark"] .report-tab.is-active {
  border-color: rgba(255, 255, 255, 0.88);
  background: #f8fbff;
  color: #172033;
}

body[data-theme-mode="dark"] .date-day.is-muted,
body[data-theme-mode="dark"] .brand small,
body[data-theme-mode="dark"] .sidebar-footer,
body[data-theme-mode="dark"] .board-switch small,
body[data-theme-mode="dark"] .manager-item small,
body[data-theme-mode="dark"] .muted-text {
  color: #7f8fb2;
}

body[data-theme-mode="dark"] .priority-high,
body[data-theme-mode="dark"] .priority-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

body[data-theme-mode="dark"] .priority-low {
  background: rgba(16, 185, 129, 0.18);
  color: #bbf7d0;
}

body[data-theme-mode="dark"] .pretty-date-input {
  background-color: rgba(25, 36, 67, 0.72);
}

body[data-theme-mode="dark"] .eyebrow {
  color: #c4b5fd;
}

body[data-theme-mode="light"] {
  --page: #f4f7ff;
  --sidebar: #ffffff;
  --sidebar-2: #eef3ff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-soft: rgba(240, 245, 255, 0.78);
  --ink: #172033;
  --muted: #64748b;
  --line: rgba(105, 126, 170, 0.22);
  --line-strong: rgba(72, 94, 145, 0.34);
  --shadow: 0 24px 70px rgba(41, 58, 100, 0.14);
  background:
    radial-gradient(circle at 72% 6%, rgba(37, 99, 235, 0.14), transparent 34%),
    radial-gradient(circle at 30% 0%, rgba(124, 58, 237, 0.12), transparent 30%),
    linear-gradient(145deg, #f9fbff 0%, #eef4ff 52%, #ffffff 100%);
  color: var(--ink);
}

body[data-theme-mode="light"] .workspace {
  background:
    radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at 14% 12%, rgba(124, 58, 237, 0.1), transparent 30%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(237, 243, 255, 0.9));
}

body[data-theme-mode="light"] .sidebar {
  border-right: 1px solid rgba(105, 126, 170, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 245, 255, 0.86)),
    radial-gradient(circle at 20% 0%, rgba(124, 58, 237, 0.1), transparent 34%);
  color: #172033;
  box-shadow: none;
}

body[data-theme-mode="light"] .topbar,
body[data-theme-mode="light"] .toolbar {
  border-color: rgba(105, 126, 170, 0.2);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

body[data-theme-mode="light"] .brand strong,
body[data-theme-mode="light"] .view-tab,
body[data-theme-mode="light"] .sidebar-action,
body[data-theme-mode="light"] .board-switch,
body[data-theme-mode="light"] .ghost-button,
body[data-theme-mode="light"] .search-filter-button,
body[data-theme-mode="light"] .compact-button,
body[data-theme-mode="light"] .menu-button,
body[data-theme-mode="light"] .timer-button,
body[data-theme-mode="light"] .add-task-row,
body[data-theme-mode="light"] .calendar-add,
body[data-theme-mode="light"] .gantt-title-button,
body[data-theme-mode="light"] .management-popover button,
body[data-theme-mode="light"] .theme-presets button,
body[data-theme-mode="light"] .date-picker-actions button,
body[data-theme-mode="light"] .date-day.is-today,
body[data-theme-mode="light"] .stats strong,
body[data-theme-mode="light"] .count-pill {
  color: #172033;
}

body[data-theme-mode="light"] .brand small,
body[data-theme-mode="light"] .sidebar-footer,
body[data-theme-mode="light"] .board-switch small,
body[data-theme-mode="light"] .section-head {
  color: #64748b;
}

body[data-theme-mode="light"] .icon-button,
body[data-theme-mode="light"] .view-tab,
body[data-theme-mode="light"] .sidebar-action,
body[data-theme-mode="light"] .board-switch,
body[data-theme-mode="light"] .ghost-button,
body[data-theme-mode="light"] .compact-button,
body[data-theme-mode="light"] .menu-button,
body[data-theme-mode="light"] .timer-button,
body[data-theme-mode="light"] .theme-presets button {
  border: 1px solid rgba(72, 94, 145, 0.28);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 1px 2px rgba(41, 58, 100, 0.08);
}

body[data-theme-mode="light"] .view-tab {
  border-color: rgba(72, 94, 145, 0.32);
  background: rgba(255, 255, 255, 0.9);
}

body[data-theme-mode="light"] .view-tab.is-active,
body[data-theme-mode="light"] .board-switch:hover,
body[data-theme-mode="light"] .board-switch.is-active,
body[data-theme-mode="light"] .sidebar-action:hover {
  border-color: rgba(72, 94, 145, 0.42);
  background: rgba(255, 255, 255, 0.96);
  color: #172033;
}

body[data-theme-mode="light"] .stats article,
body[data-theme-mode="light"] .board-column,
body[data-theme-mode="light"] .task-card,
body[data-theme-mode="light"] .calendar-wrap,
body[data-theme-mode="light"] .gantt-wrap,
body[data-theme-mode="light"] .search-filters-panel,
body[data-theme-mode="light"] .tag-system-field,
body[data-theme-mode="light"] .task-start-badge,
body[data-theme-mode="light"] .metric-manager,
body[data-theme-mode="light"] .manager-item,
body[data-theme-mode="light"] .analytics-summary article,
body[data-theme-mode="light"] .analytics-summary .analytics-metric-card,
body[data-theme-mode="light"] .analytics-summary .custom-metric-card,
body[data-theme-mode="light"] .analytics-task-row,
body[data-theme-mode="light"] .analytics-drilldown-note,
body[data-theme-mode="light"] .analytics-report,
body[data-theme-mode="light"] .chart-card,
body[data-theme-mode="light"] .chat-sidebar,
body[data-theme-mode="light"] .chat-main,
body[data-theme-mode="light"] .chat-group-form,
body[data-theme-mode="light"] .chat-group-list,
body[data-theme-mode="light"] .chat-messages,
body[data-theme-mode="light"] .task-extra,
body[data-theme-mode="light"] .task-history-item,
body[data-theme-mode="light"] .side-drawer,
body[data-theme-mode="light"] .mobile-status-group,
body[data-theme-mode="light"] .mobile-day-section,
body[data-theme-mode="light"] .mobile-task-card,
body[data-theme-mode="light"] .mobile-tabbar {
  border-color: rgba(105, 126, 170, 0.2);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

body[data-theme-mode="light"] .board-column {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 245, 255, 0.72));
  border-color: color-mix(in srgb, var(--status-color, var(--blue-2)) 28%, rgba(105, 126, 170, 0.2));
  border-top-color: var(--status-color, var(--blue-2));
}

body[data-theme-mode="light"] .task-card {
  background: rgba(255, 255, 255, 0.86);
}

body[data-theme-mode="light"] .drawer-backdrop {
  background: rgba(222, 231, 246, 0.42);
  backdrop-filter: none;
}

body[data-theme-mode="light"] .eyebrow {
  color: #172033;
}

body[data-theme-mode="light"] .analytics-summary strong,
body[data-theme-mode="light"] .analytics-drilldown-head h3,
body[data-theme-mode="light"] .analytics-task-section h4,
body[data-theme-mode="light"] .analytics-task-row strong,
body[data-theme-mode="light"] .chart-card h3,
body[data-theme-mode="light"] .bar-row,
body[data-theme-mode="light"] .bar-row strong,
body[data-theme-mode="light"] .report-table td {
  color: #172033;
}

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

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

  .topbar-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    flex: 0 0 auto;
    max-height: none;
    overflow: auto;
    padding: 14px;
  }

  .workspace {
    flex: 1 1 auto;
    min-height: 62dvh;
    overflow: visible;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .toolbar,
  .stats,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .topbar,
  .toolbar,
  .stats,
  .view-root {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .toolbar select,
  .search-field,
  .search-panel,
  .period-controls {
    width: 100%;
    min-width: 0;
  }

  .period-controls .period-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .stats article {
    flex: 1 1 140px;
  }

  .view-root {
    min-height: 52dvh;
    overflow: auto;
    padding-bottom: 18px;
  }

  .board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .board-column {
    flex: 0 0 min(86vw, 340px);
  }

  .calendar-grid {
    min-width: 720px;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
  }

  .calendar-cell {
    min-height: 170px;
  }

  .gantt {
    min-width: 840px;
  }

  .gantt-head,
  .gantt-row {
    grid-template-columns: 220px repeat(var(--days), 52px);
  }

  .gantt-lane {
    grid-template-columns: repeat(var(--days), 52px);
  }

  .side-drawer,
  .side-drawer.compact,
  .side-drawer.wide,
  .side-drawer.report-drawer {
    width: 100vw;
    max-width: 100vw;
    padding: 16px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-height: 100dvh;
    overflow-x: hidden;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  button,
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 345;
    width: min(88vw, 340px);
    max-width: 340px;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(16px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: 24px 0 60px rgba(2, 6, 23, 0.32);
  }

  .app-shell.mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 340;
    display: block;
    border: 0;
    background: rgba(2, 6, 23, 0.52);
  }

  .mobile-menu-backdrop[hidden] {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 150;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px);
  }

  .board-heading h1 {
    font-size: 25px;
  }

  .board-heading p:last-child {
    display: none;
  }

  .topbar .view-tabs {
    display: none;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }

  .search-panel,
  .search-field,
  .period-controls {
    width: 100%;
  }

  .search-field {
    min-height: 50px;
    border-radius: 14px;
  }

  .search-filter-button,
  .period-controls .ghost-button {
    min-height: 46px;
  }

  .period-controls {
    gap: 8px;
  }

  .period-controls .period-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .search-filters-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(118px + env(safe-area-inset-top));
    width: auto;
    max-height: min(72dvh, 560px);
    overflow-y: auto;
    border-radius: 18px;
    z-index: 330;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px 0;
    overflow: visible;
  }

  .stats article {
    min-width: 0;
    min-height: 64px;
    border-radius: 14px;
    padding: 10px 8px;
  }

  .stats strong {
    font-size: 22px;
  }

  .stats span {
    font-size: 11px;
  }

  .view-root {
    min-height: auto;
    overflow: visible;
    padding: 12px 12px calc(96px + env(safe-area-inset-bottom));
  }

  .board,
  .calendar-wrap,
  .gantt-wrap {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 320;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    min-height: calc(68px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(18px);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .mobile-tabbar-button {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    padding: 0 4px;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-tabbar-button.is-active,
  .mobile-tabbar-button[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--violet-2) 46%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--violet-2) 24%, transparent), color-mix(in srgb, var(--blue-2) 18%, transparent));
    color: var(--ink);
  }

  .mobile-tabbar-add {
    background: linear-gradient(135deg, var(--violet-2), var(--blue-2));
    color: #fff;
    font-size: 24px;
    line-height: 1;
  }

  .mobile-task-list,
  .mobile-agenda {
    display: grid;
    gap: 12px;
  }

  .mobile-status-group,
  .mobile-day-section {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--status-color, var(--blue-2));
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    padding: 12px;
  }

  .mobile-status-head,
  .mobile-day-head,
  .mobile-task-top,
  .mobile-task-meta,
  .mobile-task-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-status-head h2 {
    margin: 0;
    font-size: 18px;
  }

  .mobile-status-head small,
  .mobile-day-head span {
    color: var(--muted);
    font-weight: 800;
  }

  .mobile-status-list,
  .mobile-day-tasks {
    display: grid;
    gap: 10px;
  }

  .mobile-add-task {
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--violet);
    padding: 0 14px;
    text-align: left;
    font-weight: 900;
  }

  .mobile-task-card {
    display: grid;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--line);
    border-left: 4px solid var(--status-color, var(--blue-2));
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    padding: 14px;
    text-align: left;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  }

  .mobile-task-card > strong {
    font-size: 17px;
    line-height: 1.3;
  }

  .mobile-task-card p {
    margin: 0;
    color: #475569;
    line-height: 1.35;
  }

  .mobile-task-meta,
  .mobile-task-range {
    flex-wrap: wrap;
    justify-content: flex-start;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-day-section.is-today {
    border-color: color-mix(in srgb, var(--violet-2) 46%, var(--line));
  }

  .side-drawer,
  .side-drawer.compact,
  .side-drawer.wide,
  .side-drawer.report-drawer,
  #analyticsDrawer.report-drawer {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-left: 0;
    border-radius: 0;
    padding: 0 14px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }

  .side-drawer.is-open {
    transform: translateY(0);
  }

  .drawer-header {
    position: sticky;
    top: 0;
    z-index: 4;
    align-items: flex-start;
    margin: 0 -14px 14px;
    padding: calc(14px + env(safe-area-inset-top)) 14px 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }

  .drawer-header h2 {
    font-size: 24px;
  }

  .task-start-badge {
    align-self: stretch;
    min-width: 96px;
  }

  .drawer-backdrop {
    z-index: 350;
  }

  .side-drawer {
    z-index: 360;
  }

  .field-row,
  .tag-picker-row,
  .form-actions,
  .row-actions,
  .status-grid,
  .chat-layout,
  .chat-message-form,
  .analytics-summary,
  .chart-grid,
  .report-controls,
  .condition-grid,
  .automation-condition-body,
  .compact-controls,
  .metric-item,
  .inline-task-form {
    grid-template-columns: 1fr;
  }

  .side-drawer input,
  .side-drawer textarea,
  .side-drawer select,
  .select-picker-button,
  .custom-checkbox {
    min-height: 48px;
  }
}

@media (max-width: 620px) {
  body {
    overflow-y: auto;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .stats,
  .view-root {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand strong {
    font-size: 18px;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    overflow-x: auto;
  }

  .board-heading h1 {
    font-size: 24px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    width: 100%;
  }

  .timer-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .management-menu,
  .theme-menu {
    grid-column: 1 / -1;
  }

  .menu-button,
  .compact-button {
    width: 100%;
  }

  .management-popover,
  .theme-popover {
    left: 0;
    right: auto;
    width: min(100%, 280px);
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .topbar .view-tabs,
  .search-panel {
    grid-column: 1 / -1;
  }

  .topbar .view-tabs {
    overflow-x: auto;
  }

  .search-filters-panel {
    left: 0;
    right: auto;
    grid-template-columns: 1fr;
    width: min(100%, 340px);
  }

  .field-row,
  .toggle-grid,
  .board-access-list,
  .report-controls,
  .analytics-summary,
  .chart-grid,
  .manager-item,
  .condition-grid,
  .automation-condition-body,
  .compact-controls,
  .metric-item,
  .inline-task-form {
    grid-template-columns: 1fr;
  }

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

  .condition-remove {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .status-grid,
  .chat-message-form {
    grid-template-columns: 1fr;
  }

  .public-form-page {
    place-items: start center;
    padding: 12px;
  }

  .public-form-card {
    padding: 18px;
  }

  .analytics-summary {
    max-height: 260px;
    overflow: auto;
  }

  .row-actions,
  .form-actions {
    justify-content: stretch;
  }

  .row-actions button,
  .form-actions button {
    flex: 1 1 auto;
  }

  .calendar-grid {
    min-width: 640px;
  }

  .gantt {
    min-width: 760px;
  }
}
