:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.86);
  --panel-muted: #edf2f4;
  --ink: #1d252d;
  --muted: #657281;
  --line: #dce3e8;
  --sidebar-bg: #172027;
  --sidebar-ink: #f8fbfc;
  --sidebar-muted: #aab8c2;
  --accent: #246b5f;
  --accent-strong: #174e45;
  --amber: #b56a14;
  --red: #b83d3d;
  --blue: #2f65a7;
  --green-soft: #e4f2ef;
  --amber-soft: #fff2dc;
  --red-soft: #ffe8e8;
  --blue-soft: #e8f0fb;
  --shadow: 0 12px 32px rgba(29, 37, 45, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark-theme {
  color-scheme: dark;
  --bg: #101417;
  --panel: #1a2025;
  --panel-soft: rgba(26, 32, 37, 0.9);
  --panel-muted: #24303a;
  --ink: #eef4f6;
  --muted: #9eabb5;
  --line: #2b3943;
  --sidebar-bg: #0b1014;
  --sidebar-ink: #f5f8fa;
  --sidebar-muted: #8fa0ad;
  --accent: #5ac2ad;
  --accent-strong: #83d8c8;
  --amber: #e6a84a;
  --red: #f07676;
  --blue: #78a8e8;
  --green-soft: #18342f;
  --amber-soft: #3a2a12;
  --red-soft: #3b1f23;
  --blue-soft: #1d2c42;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(36, 107, 95, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(47, 101, 167, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-ink);
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--sidebar-muted);
  margin-top: 2px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: transparent;
  object-fit: cover;
}

.nav-list,
.sidebar-footer {
  display: grid;
  gap: 8px;
}

.nav-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-section-title {
  margin: 12px 8px 2px;
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav-item,
.icon-text-button,
.import-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.nav-item span:first-child,
.icon-text-button span:first-child,
.import-label span:first-child {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.nav-icon,
.button-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.nav-item:hover,
.nav-item.active,
.icon-text-button:hover,
.import-label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  flex: 0 0 auto;
}

.import-label {
  cursor: pointer;
}

.import-label input {
  display: none;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

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

body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .icon-text-button span:not(:first-child),
body.sidebar-collapsed .import-label span:not(:first-child) {
  display: none;
}

body.sidebar-collapsed .brand-logo {
  width: 36px;
  height: 36px;
}

body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 68px;
  left: 21px;
  margin: 0;
}

body.sidebar-collapsed .nav-list {
  margin-top: 38px;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .icon-text-button,
body.sidebar-collapsed .import-label {
  justify-content: center;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.2rem;
  line-height: 1.1;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  white-space: nowrap;
}

.secondary-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.3rem;
}

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

.metric {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 12px;
}

.metric strong {
  font-size: 2rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(5, minmax(150px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
}

.search-field input,
.filters select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.search-field input {
  border: 0;
  outline: 0;
}

.filters select {
  min-height: 44px;
  padding: 0 12px;
}

.calendar-filter-button {
  min-height: 44px;
  padding: 0 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.client-kanban-stack {
  display: grid;
  gap: 22px;
}

.client-kanban {
  display: grid;
  gap: 12px;
}

.client-kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0 2px;
  border-bottom: 1px solid var(--line);
}

.client-kanban-header h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.client-kanban-header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.kanban-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--column-color);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kanban-column.drop-ready {
  outline: 2px solid var(--column-color);
  outline-offset: 2px;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.column-header h2 {
  margin: 0;
  font-size: 0.98rem;
}

.column-title span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  font-weight: 700;
}

.column-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.column-add-button {
  border: 1px dashed var(--column-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--column-color) 12%, var(--panel));
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.column-add-button.compact {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 1rem;
}

.column-add-button.empty {
  min-height: 92px;
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
}

.column-add-button:hover {
  border-style: solid;
  background: color-mix(in srgb, var(--column-color) 18%, var(--panel));
}

.column-sort-date-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.column-sort-date-button:hover {
  border-color: var(--column-color);
  background: color-mix(in srgb, var(--column-color) 12%, var(--panel));
  color: var(--ink);
}

.column-sort-date-button::after {
  content: "Ordenar por data";
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity 140ms ease 3s,
    transform 140ms ease 3s;
}

.column-sort-date-button:hover::after,
.column-sort-date-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.column-sort-date-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.color-control {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

.color-control input {
  width: 20px;
  height: 20px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.card-list {
  display: grid;
  gap: 10px;
  min-height: 120px;
  padding: 10px;
}

.demand-card {
  position: relative;
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(29, 37, 45, 0.06);
  text-align: left;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.demand-card:hover {
  border-color: #b9c8d0;
  transform: translateY(-1px);
}

.demand-card.dragging {
  opacity: 0.55;
  transform: scale(0.98);
  box-shadow: 0 18px 34px rgba(29, 37, 45, 0.16);
}

.demand-card.drop-before::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -8px;
  height: 3px;
  border-radius: 999px;
  background: var(--column-color);
  box-shadow: 0 0 0 3px rgba(47, 101, 167, 0.16);
  animation: dropPulse 800ms ease-in-out infinite;
}

.card-list.drop-at-end::after {
  content: "";
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--column-color);
  box-shadow: 0 0 0 3px rgba(47, 101, 167, 0.16);
  animation: dropPulse 800ms ease-in-out infinite;
}

@keyframes dropPulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scaleX(0.96);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.demand-card.has-subtasks {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-muted) 100%);
}

.card-open {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.demand-card.priority-alta {
  border-left-color: var(--red);
}

.demand-card.priority-media {
  border-left-color: var(--amber);
}

.demand-card.priority-baixa {
  border-left-color: var(--accent);
}

.card-topline,
.card-meta,
.list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-topline {
  justify-content: flex-start;
}

.card-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.tag.alta {
  background: var(--red-soft);
  color: var(--red);
}

.tag.media {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.baixa {
  background: var(--green-soft);
  color: var(--accent);
}

.tag.category {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid transparent;
}

.tag.client-tag {
  border: 1px solid transparent;
}

.tag.parent-task {
  background: var(--panel-muted);
  color: var(--ink);
  border: 1px solid var(--line);
}

.tag.late {
  background: var(--red);
  color: #fff;
}

.tag.due-today {
  background: var(--amber);
  color: #172027;
}

.tag.due-tomorrow {
  background: var(--blue);
  color: #fff;
}

.demand-card.is-late {
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--red-soft) 55%, var(--panel));
}

.demand-card.is-late .card-title {
  color: var(--red);
}

.demand-card.is-due-today {
  border-color: color-mix(in srgb, var(--amber) 65%, var(--line));
  border-left-color: var(--amber);
  background: color-mix(in srgb, var(--amber-soft) 60%, var(--panel));
}

.demand-card.is-due-today .card-title {
  color: #7a5200;
}

.demand-card.is-due-tomorrow {
  border-color: color-mix(in srgb, var(--blue) 75%, var(--line));
  border-left-color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 78%, var(--panel));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--blue) 16%, transparent);
}

.demand-card.is-due-tomorrow .card-title {
  color: var(--blue);
}

.subtask-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid #b7c8d6;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
}

.subtask-icon:hover {
  border-color: var(--blue);
}

.mini-action {
  margin-left: auto;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.mini-action:hover {
  border-color: #a9bac4;
  color: var(--ink);
}

.card-meta,
.list-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #bdc9d1;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.demand-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.demand-table .clickable-row {
  cursor: pointer;
}

.demand-table .clickable-row:hover {
  background: var(--panel-muted);
}

.demand-table .clickable-row.is-late {
  background: color-mix(in srgb, var(--red-soft) 48%, var(--panel));
}

.demand-table .clickable-row.is-late .table-title-button {
  color: var(--red);
}

.demand-table .clickable-row.is-due-today {
  background: color-mix(in srgb, var(--amber-soft) 55%, var(--panel));
}

.demand-table .clickable-row.is-due-today .table-title-button {
  color: #7a5200;
}

.demand-table .clickable-row.is-due-tomorrow {
  background: color-mix(in srgb, var(--blue-soft) 82%, var(--panel));
  box-shadow: inset 4px 0 0 var(--blue);
}

.demand-table .clickable-row.is-due-tomorrow .table-title-button {
  color: var(--blue);
}

.demand-table th {
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-transform: inherit;
}

.sort-button:hover {
  color: var(--ink);
}

.sort-arrow {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.72rem;
}

.table-title-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.inline-edit-cell {
  position: relative;
  display: inline-grid;
  gap: 6px;
  min-width: 120px;
}

.inline-edit-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 30px;
  width: max-content;
  max-width: 220px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 7px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.inline-edit-trigger:hover {
  border-color: var(--line);
  background: var(--panel-muted);
}

.inline-edit-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: inlineMenuOpen 120ms ease-out;
}

.inline-edit-menu input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
}

.inline-option-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.inline-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.inline-option:hover,
.inline-option.active {
  border-color: var(--line);
  background: var(--panel-muted);
}

.inline-option.active {
  font-weight: 800;
}

@keyframes inlineMenuOpen {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reports-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.report-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-panel h2 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--panel-muted);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

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

.owner-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.my-space-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.my-space-header h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.my-space-header p {
  margin: 0;
  color: var(--muted);
}

.compact-field {
  min-width: 240px;
}

.my-space-panels {
  display: grid;
  gap: 20px;
}

.my-space-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.my-space-panel.dragging-panel {
  opacity: 0.5;
  transform: scale(0.99);
  border-color: var(--accent);
  box-shadow: 0 18px 34px rgba(29, 37, 45, 0.16);
}

.my-space-panel.drop-before-panel::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: -11px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 107, 95, 0.14);
  animation: panelDropPulse 800ms ease-in-out infinite;
}

.my-space-panels.drop-at-panel-end::after {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 107, 95, 0.14);
  animation: panelDropPulse 800ms ease-in-out infinite;
}

@keyframes panelDropPulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scaleX(0.96);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.my-space-panel-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease;
}

.my-space-panel-header:hover {
  background: var(--panel-muted);
}

.my-space-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.my-space-panel-actions,
.inline-calendar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.my-space-panel-body {
  padding: 12px;
}

.my-space-panel.collapsed .my-space-panel-body {
  display: none;
}

.drag-handle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
}

.compact-table th,
.compact-table td {
  padding: 12px 10px;
}

.calendar-modal {
  width: min(1120px, calc(100vw - 28px));
}

.calendar-dialog {
  padding: 22px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.inline-calendar-toolbar,
.modal-week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-week-toolbar {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
}

.modal-week-toolbar span,
.inline-calendar-label {
  color: var(--muted);
  font-weight: 800;
  text-transform: capitalize;
}

.week-view-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.calendar-day {
  min-height: 132px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: var(--panel);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.calendar-day.calendar-drop-ready {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-day.calendar-copy-ready {
  background: color-mix(in srgb, var(--blue) 13%, var(--panel));
  box-shadow: inset 0 0 0 2px var(--blue);
}

.calendar-day.muted-day {
  background: var(--panel-muted);
}

.calendar-day-number {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.calendar-items {
  display: grid;
  gap: 6px;
}

.calendar-item {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 6px 10px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transform-origin: center;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.calendar-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 0 0 8px 8px;
  background: var(--client-color, var(--accent));
}

.calendar-item:hover {
  transform: scale(1.025);
  border-color: var(--client-color, var(--accent));
  box-shadow: 0 10px 20px rgba(29, 37, 45, 0.12);
  z-index: 2;
}

.calendar-item.dragging-calendar-item {
  opacity: 0.5;
  transform: scale(0.98);
}

.calendar-item > span:not(.tag),
.calendar-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.calendar-category-tag {
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  padding: 0 7px;
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-item.is-late {
  border-color: var(--red);
  background: var(--red-soft);
}

.calendar-item.is-late span {
  color: var(--red);
  font-weight: 800;
}

.calendar-item.is-due-today {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.calendar-item.is-due-today > span:not(.tag) {
  color: #7a5200;
  font-weight: 800;
}

.calendar-item.is-due-tomorrow {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 84%, var(--panel));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--blue) 15%, transparent);
}

.calendar-item.is-due-tomorrow > span:not(.tag) {
  color: var(--blue);
  font-weight: 800;
}

.calendar-add-demand {
  display: grid;
  place-items: center;
  min-height: 30px;
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.calendar-add-demand:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.registry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.registry-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.registry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.registry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.registry-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.client-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex: 0 0 14px;
  margin-right: 8px;
  vertical-align: -2px;
}

.registry-table td:last-child,
.registry-table th:last-child {
  width: 96px;
  text-align: right;
}

.registry-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.registry-stats {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px;
}

.registry-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.modal {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(29, 37, 45, 0.28);
}

.modal.maximized {
  width: min(1180px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
}

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

.compact-modal.maximized {
  width: min(980px, calc(100vw - 24px));
}

.modal::backdrop {
  background: rgba(23, 32, 39, 0.45);
}

.modal form {
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

.modal-header h2 {
  margin: 0;
}

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

.task-children-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.task-children-header,
.task-progress,
.task-child-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.task-progress-bar {
  flex: 1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-muted);
}

.task-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.task-progress > span {
  min-width: 42px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: right;
}

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

.task-child-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.task-child-row:hover {
  border-color: #b9c8d0;
}

.task-child-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.task-child-main strong,
.task-child-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-child-main small {
  color: var(--muted);
}

.tag.status-backlog {
  background: var(--panel-muted);
  color: var(--muted);
}

.tag.status-progress {
  background: var(--blue-soft);
  color: var(--accent);
}

.tag.status-review {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.status-done {
  background: var(--green-soft);
  color: var(--green);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  resize: vertical;
  padding: 10px 12px;
}

.rich-field textarea {
  min-height: 220px;
  line-height: 1.55;
  font-family: inherit;
}

.html-editor {
  min-height: 260px;
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  color: var(--ink);
  line-height: 1.55;
  outline: 0;
}

.html-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 107, 95, 0.14);
}

.html-editor h2,
.html-editor h3,
.html-editor p,
.html-editor ul,
.html-editor ol {
  margin: 0 0 10px;
}

.html-editor ul,
.html-editor ol {
  padding-left: 24px;
}

.html-editor a {
  color: var(--blue);
  text-decoration: underline;
}

.modal.maximized .html-editor {
  min-height: 46vh;
}

.field-toolbar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-toolbar button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.editor-toolbar button:hover,
.mini-icon:hover {
  border-color: #b9c8d0;
}

.mini-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
}

.lock-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dialog-size-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.close-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.html-editor.locked {
  background: var(--panel-muted);
  cursor: not-allowed;
}

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

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-field.wide {
  grid-column: 1 / -1;
}

.board-modal {
  width: min(1180px, calc(100vw - 28px));
}

.board-dialog {
  padding: 22px;
}

.subtask-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-muted);
}

.subtask-toolbar strong,
.subtask-toolbar span {
  display: block;
}

.subtask-toolbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.subtask-board .kanban-column {
  min-height: 260px;
}

.subtask-card {
  border-left-style: dashed;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.action-group {
  display: flex;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  min-width: min(360px, calc(100vw - 32px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.context-menu {
  position: fixed;
  z-index: 30;
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.context-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.context-menu button:hover {
  background: var(--panel-muted);
}

.context-menu .danger-menu-item {
  color: var(--red);
}

.context-menu .danger-menu-item:hover {
  background: var(--red-soft);
}

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

  .brand div:last-child,
  .nav-item span:last-child,
  .nav-section-title,
  .icon-text-button span:last-child,
  .import-label span:last-child {
    display: none;
  }

  .nav-item,
  .icon-text-button,
  .import-label {
    justify-content: center;
  }

  .metrics,
  .kanban-board,
  .registry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
  }

  .brand {
    flex: 0 0 auto;
  }

  .nav-list,
  .sidebar-footer {
    display: flex;
    margin: 0;
  }

  .nav-section-title {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .topbar .primary-button,
  .topbar .secondary-button {
    width: 100%;
  }

  .metrics,
  .filters,
  .kanban-board,
  .reports-grid,
  .registry-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .client-kanban-header,
  .my-space-header,
  .registry-header {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field {
    min-width: 0;
  }

  .demand-table {
    display: block;
    overflow-x: auto;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

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

  .action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
