:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --faint: #f9fafb;
  --paper: #f6f7f9;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --blue: #475f88;
  --green: #2f7d5b;
  --amber: #b7791f;
  --red: #c45b4b;
  --purple: #7a66b5;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  transform: translateY(-160%);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 22px 16px;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 1.6vw, 1.7rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 6px;
  font-size: 0.96rem;
  line-height: 1.3;
}

.side-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 4px;
}

.side-nav a {
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  padding: 10px 11px;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--faint);
  color: var(--ink);
}

.shortcut-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--faint);
  padding: 13px;
}

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

.shortcut-card strong {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 0.76rem;
}

.workspace {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 22px;
}

.view-section,
.panel,
.dashboard-stack {
  min-width: 0;
}

.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  place-items: center;
  background: #e9edf3;
  padding: 32px;
}

.login-screen::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 56, 84, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 56, 84, 0.055) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

.login-screen::after {
  position: absolute;
  z-index: -1;
  right: -28px;
  bottom: -34px;
  color: rgba(23, 34, 52, 0.045);
  content: "JAD / JAM";
  font-size: clamp(5rem, 13vw, 12rem);
  font-weight: 900;
  line-height: 0.8;
  pointer-events: none;
  white-space: nowrap;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr);
  width: min(900px, 100%);
  min-height: 590px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow:
    0 1px 1px rgba(17, 24, 39, 0.04),
    0 20px 42px rgba(17, 24, 39, 0.16),
    0 52px 112px rgba(17, 24, 39, 0.2);
  animation: login-shell-enter 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  overflow: hidden;
  background: #111319 url("/api/login-art") center / cover no-repeat;
  color: #fff;
  padding: 42px;
}

.login-brand-panel::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 14, 0.42) 0%, rgba(8, 10, 14, 0.16) 38%, rgba(8, 10, 14, 0.88) 100%),
    linear-gradient(90deg, rgba(8, 10, 14, 0.78), rgba(8, 10, 14, 0.18) 82%);
  content: "";
}

.login-brand-panel::after {
  position: absolute;
  z-index: -1;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  content: "";
  pointer-events: none;
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.login-brand-mark {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
}

.login-brand-copy p {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.login-brand-copy h2 {
  max-width: 360px;
  margin-bottom: 16px;
  color: #fff;
  font-size: 2.75rem;
  line-height: 1.06;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.48);
  text-wrap: balance;
}

.login-brand-copy > span {
  display: block;
  max-width: 310px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
  line-height: 1.55;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.58);
}

.login-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
  padding: clamp(36px, 7vw, 72px);
  background: rgba(255, 255, 255, 0.98);
}

.login-heading {
  margin-bottom: 8px;
}

.login-heading h1 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.login-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  color: #374151;
  font-size: 0.82rem;
  font-weight: 750;
}

.login-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-field input::placeholder {
  color: #9ca3af;
}

.login-field input:hover {
  border-color: #9ca3af;
}

.login-field input:focus {
  border-color: #475f88;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(71, 95, 136, 0.14);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 700;
  transition: color 150ms ease, opacity 150ms ease;
}

.login-error[data-state="pending"] {
  color: var(--muted);
  font-weight: 600;
}

.login-submit {
  min-height: 48px;
  width: 100%;
  justify-content: center;
  transition: background 150ms ease, transform 150ms ease;
}

.login-submit:hover {
  background: #243044;
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-help {
  margin: 0;
  color: #9ca3af;
  font-size: 0.76rem;
  text-align: center;
}

@keyframes login-shell-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell {
    animation: none;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -22px -22px 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.82);
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(560px, 1.3fr);
  background: rgba(255, 255, 255, 0.92);
  padding: 16px 22px;
  backdrop-filter: blur(14px);
}

.section-heading,
.modal-heading,
.drawer-header,
.team-row,
.team-card-header,
.task-meta,
.card-footer,
.topbar-actions,
.topbar-controls,
.quick-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actor-control {
  display: grid;
  gap: 3px;
  min-width: 124px;
}

.topbar-identity h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

.view-description {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.actor-control span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.actor-control select {
  min-height: 36px;
  padding: 6px 28px 6px 9px;
}

.topbar,
.section-heading,
.modal-heading,
.drawer-header,
.team-row,
.team-card-header,
.card-footer {
  justify-content: space-between;
}

.topbar-actions,
.topbar-controls,
.quick-actions,
.modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.topbar-controls {
  justify-content: flex-end;
}

.logout-button {
  min-height: 36px;
  padding-inline: 8px;
}

.task-meta,
.card-footer {
  min-width: 0;
  overflow: hidden;
}

.card-footer .badge {
  overflow: hidden;
  text-overflow: ellipsis;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.metric-strip span {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 2px 10px;
}

.metric-strip span:last-child {
  border-right: 0;
  padding-right: 0;
}

.metric-strip strong {
  color: var(--ink);
}

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.mini-add,
.table-action {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 38px;
  padding: 0 13px;
  font-weight: 760;
  transition: background 140ms ease, border 140ms ease, color 140ms ease, transform 140ms ease;
}

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

.primary-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.table-action {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover,
.table-action:hover,
.mini-add:hover,
.text-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--faint);
}

.danger-action {
  color: var(--red);
}

.danger-action:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--red);
}

.text-button,
.mini-add {
  background: transparent;
  color: var(--muted);
}

.icon-button {
  width: 38px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1;
}

.filter-bar,
.panel,
.board-section,
.task-modal,
.command-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(5, minmax(120px, 0.72fr)) auto;
  gap: 10px;
  border-radius: 8px;
  padding: 14px;
}

.filter-toolbar-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.filter-toolbar-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.filter-toolbar-heading strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.filter-toolbar-heading span {
  color: var(--muted);
  font-size: 0.76rem;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.quick-filter-row button,
.clear-filters-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  padding: 0 10px;
}

.quick-filter-row button:hover,
.quick-filter-row button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.clear-filters-button {
  align-self: end;
  white-space: nowrap;
}

.clear-filters-button:disabled {
  cursor: default;
  opacity: 0.42;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  text-transform: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(71, 95, 136, 0.65);
  box-shadow: 0 0 0 3px rgba(71, 95, 136, 0.14);
  outline: 0;
}

textarea {
  resize: vertical;
}

.board-section,
.panel {
  padding: 16px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.board-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f4f6;
  padding: 12px;
}

.column-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  background: var(--faint);
}

.column-title h3 {
  margin: 0;
}

.drop-zone {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.board-column.drag-over {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f3f7ff;
}

.drop-placeholder,
.inline-create {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  min-height: 104px;
  padding: 13px;
  text-align: left;
}

.drop-placeholder:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.inline-create {
  display: grid;
  gap: 8px;
  background: #fff;
}

.inline-create input {
  min-height: 36px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.inline-actions button {
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 750;
  padding: 0 10px;
}

.task-card,
.task-row,
.team-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  transition: box-shadow 150ms ease, transform 150ms ease, border 150ms ease, background 150ms ease;
}

.task-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.07);
  transform: translateY(-1px);
}

.task-card.dragging {
  opacity: 0.88;
  transform: rotate(1.5deg) scale(1.01);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.14);
}

.priority-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--muted);
}

.priority-dot.highest,
.priority-dot.high {
  background: var(--red);
}

.priority-dot.medium {
  background: var(--blue);
}

.priority-dot.low {
  background: var(--green);
}

.task-tag {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: normal;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.badge.overdue,
.pill.highest,
.pill.high,
.pill.overdue {
  background: #fef2f2;
  color: var(--red);
}

.pill.backlog {
  background: #f3f4f6;
  color: #4b5563;
}

.pill.todo {
  background: #fffbeb;
  color: var(--amber);
}

.pill.progress {
  background: #eff6ff;
  color: var(--blue);
}

.pill.review {
  background: #f5f3ff;
  color: var(--purple);
}

.pill.done {
  background: #f0fdf4;
  color: var(--green);
}

.avatar {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  overflow: hidden;
}

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

.assign-button {
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 800;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.daily-command {
  align-items: start;
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.task-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  transition: background 150ms ease, border 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.task-row p {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.task-row h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.96rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.focus-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
  transform: translateY(-1px);
}

.focus-row.is-overdue {
  border-color: #fecaca;
  background: #fff7f7;
}

.focus-row.is-overdue:hover {
  border-color: #fca5a5;
}

.focus-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.focus-meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-action {
  min-height: 31px;
  padding: 0 10px;
  font-size: 0.8rem;
}

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

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

.assignee-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

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

.compact-owners .workload-card {
  min-height: 116px;
  padding: 12px;
}

.compact-owners .member-avatar {
  width: 40px;
  height: 40px;
}

.workload-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.workload-card:hover,
.workload-card.active {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.workload-card.active {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

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

.workload-card strong {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-avatar {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef2f7;
  color: var(--blue);
  font-weight: 900;
}

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

.workload-count {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 850;
}

.workload-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
}

.workload-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f65b0;
  transition: width 150ms ease;
}

.assignee-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: grid;
  gap: 5px;
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.1);
  opacity: 0;
  padding: 9px;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.assignee-tooltip::after {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.workload-card:hover .assignee-tooltip,
.workload-card:focus-visible .assignee-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.assignee-tooltip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.team-card {
  display: grid;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.team-card:hover,
.team-card.active {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.team-card.active {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.team-card:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
}

.team-card.drag-over {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f8fbff;
}

.team-card-header h3,
.team-card-header p {
  margin: 0;
}

.team-card-header h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.team-card-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.team-health {
  display: inline-grid;
  min-width: 48px;
  min-height: 34px;
  place-items: center;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 900;
}

.team-progress,
.team-status-strip {
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.team-progress {
  height: 8px;
}

.team-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width 180ms ease;
}

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

.team-metrics span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  padding: 9px;
  font-size: 0.76rem;
  font-weight: 750;
}

.team-metrics strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.team-metrics .risk strong,
.team-risk.has-risk {
  color: var(--red);
}

.team-status-strip {
  display: flex;
  height: 7px;
}

.team-status-strip span {
  display: block;
  min-width: 8px;
}

.team-status-strip .todo {
  background: #f59e0b;
}

.team-status-strip .progress {
  background: #2563eb;
}

.team-status-strip .review {
  background: #7c3aed;
}

.team-status-strip .done {
  background: #16a34a;
}

.team-risk {
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 8px 9px;
  font-size: 0.8rem;
  font-weight: 800;
}

.team-risk.has-risk {
  background: #fef2f2;
}

.owner-analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

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

.analysis-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analysis-heading h3,
.analysis-heading p {
  margin: 0;
}

.analysis-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.analysis-heading > strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.donut-panel,
.status-dashboard {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  display: grid;
  width: 176px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  box-shadow: inset 0 0 0 22px #fff, 0 0 0 1px var(--line);
}

.donut span,
.donut small {
  grid-area: 1 / 1;
}

.donut span {
  color: var(--ink);
  font-size: 1.9rem;
  font-weight: 900;
  transform: translateY(-8px);
}

.donut small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  transform: translateY(20px);
}

.donut-legend,
.status-summary-grid,
.scorecard-grid {
  display: grid;
  gap: 8px;
}

.donut-legend-item,
.owner-scorecard {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.donut-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 9px;
}

.donut-legend-item:hover,
.donut-legend-item.active,
.owner-scorecard:hover,
.owner-scorecard.active {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.donut-legend-item i,
.status-summary-item i,
.scorecard-top > span {
  display: block;
  border-radius: 999px;
}

.donut-legend-item i,
.status-summary-item i {
  width: 10px;
  height: 10px;
}

.donut-legend-item span,
.status-summary-item span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-item strong,
.status-summary-item strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.risk-matrix {
  position: relative;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(229, 231, 235, 0.7) 1px, transparent 1px),
    linear-gradient(0deg, rgba(229, 231, 235, 0.7) 1px, transparent 1px),
    linear-gradient(135deg, #f0fdf4, #fffbeb 58%, #fef2f2);
  background-size: 50% 100%, 100% 50%, 100% 100%;
}

.delivery-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(36px, 1fr));
  gap: 10px;
  min-height: 190px;
  margin-top: 16px;
}

.delivery-day {
  display: grid;
  grid-template-rows: 22px minmax(110px, 1fr) 20px;
  gap: 6px;
  align-items: end;
  text-align: center;
}

.delivery-track {
  display: flex;
  height: 100%;
  align-items: end;
  overflow: hidden;
  border-radius: 5px;
  background: #f3f4f6;
}

.delivery-track i {
  display: block;
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: #475f88;
  transition: height 180ms ease;
}

.delivery-value,
.delivery-day small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.axis-label {
  position: absolute;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.axis-label.y {
  top: 12px;
  left: 12px;
}

.axis-label.x {
  right: 12px;
  bottom: 10px;
}

.risk-point {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  transform: translate(-50%, 50%);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
}

.risk-point.active {
  outline: 3px solid rgba(59, 130, 246, 0.25);
}

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

.owner-scorecard {
  display: grid;
  gap: 10px;
  padding: 12px;
}

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

.scorecard-top .member-avatar {
  width: 40px;
  height: 40px;
}

.scorecard-top > span {
  width: 11px;
  height: 11px;
}

.owner-scorecard > strong {
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-scorecard p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.scorecard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.scorecard-metrics span {
  display: grid;
  gap: 2px;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  padding: 7px;
  font-size: 0.7rem;
  font-weight: 800;
}

.scorecard-metrics b {
  color: var(--ink);
  font-size: 0.95rem;
}

.scorecard-metrics .risk b {
  color: var(--red);
}

.status-summary-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.team-owners {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
}

.team-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 3px 7px 3px 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.team-owner .member-avatar {
  width: 24px;
  height: 24px;
  font-size: 0.68rem;
}

.team-owner span:not(.member-avatar) {
  overflow: hidden;
  max-width: 92px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-owner strong {
  color: var(--ink);
}

.team-row {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.team-row span {
  color: var(--muted);
}

.attachment-list {
  margin-top: 10px;
}

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

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

.attachment-item img,
.file-icon {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 10;
  place-items: center;
  border-radius: 6px;
  background: var(--faint);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  object-fit: cover;
}

.attachment-item span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item small,
.empty-attachments {
  color: var(--muted);
  font-size: 0.78rem;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.work-list-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

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

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  font-size: 0.9rem;
  vertical-align: middle;
}

.work-list-table tbody tr {
  transition: background 140ms ease;
}

.work-list-table tbody tr:hover {
  background: #fafbfd;
}

td strong {
  display: block;
  margin-bottom: 4px;
}

td span {
  color: var(--muted);
}

.type-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.list-key {
  color: var(--muted);
  font-weight: 780;
}

.comment-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  padding: 0;
}

.comment-link:hover {
  color: var(--ink);
}

.task-summary-link {
  display: block;
  max-width: 380px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-summary-link:hover {
  color: #1d4ed8;
}

.task-summary-meta {
  display: block;
  max-width: 380px;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.updated-time {
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.table-action-menu {
  width: 100%;
  min-width: 128px;
  min-height: 34px;
  border-color: var(--line);
  background-color: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.table-action-menu:hover {
  border-color: var(--line-strong);
  background-color: var(--faint);
}

.create-list-row td {
  border-bottom: 0;
  background: #fff;
}

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

.section-note {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

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

.archive-tools p {
  margin: 0 6px 0 0;
}

.import-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.backup-message {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 750;
}

.backup-message.error {
  color: var(--red);
}

.archive-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.archive-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 6px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

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

.archive-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.table-action {
  min-height: 31px;
  font-size: 0.8rem;
  padding: 0 9px;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.modal-backdrop,
.command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.28);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.people-modal {
  width: min(900px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.people-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 22px;
  border-bottom: 1px solid #e8ebef;
}

.people-modal-header h2 { margin: 3px 0 5px; font-size: 24px; }
.people-modal-header p:last-child { margin: 0; color: #6b7280; }

.people-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  min-height: 430px;
}

.people-list { padding: 18px; border-right: 1px solid #e8ebef; }

.person-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eef0f3;
}

.person-row .member-avatar { width: 42px; height: 42px; }
.person-row strong, .person-row span { display: block; }
.person-row span { margin-top: 3px; color: #7a8290; font-size: 13px; }
.person-row .icon-button { width: auto; min-width: 34px; padding: 0 9px; font-size: 13px; }

.person-form { display: grid; align-content: start; gap: 15px; padding: 24px; background: #fafbfc; }
.person-form label { display: grid; gap: 7px; color: #303746; font-size: 13px; font-weight: 600; }
.person-form label small { color: #8b93a1; font-weight: 400; }
.person-form input { width: 100%; }
.person-form-preview { display: flex; justify-content: center; padding-bottom: 3px; }
.person-form-preview .member-avatar { width: 72px; height: 72px; font-size: 21px; }
.person-photo-upload input { padding: 9px; background: #fff; }
.person-photo-upload small { display: block; }
.form-message { min-height: 18px; margin: 0; color: #c55247; font-size: 13px; }
.form-message.success { color: #24834d; }
.person-form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.signed-in-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 130px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.signed-in-user:hover { border-color: #cdd4de; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); }
.signed-in-user:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.signed-in-user .member-avatar { width: 30px; height: 30px; }
.signed-in-user span, .signed-in-user strong, .signed-in-user small { display: block; }
.signed-in-user strong { font-size: 13px; }
.signed-in-user small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.account-fields { display: grid; gap: 13px; margin-top: 2px; padding: 16px; border: 1px solid #e5e9ef; border-radius: var(--radius); background: #fff; }
.account-fields > .eyebrow { margin: 0 0 -2px; }
.account-toggle { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.account-toggle input { width: 16px; height: 16px; }
.account-state { display: inline-block !important; margin-top: 5px !important; padding: 2px 6px; border-radius: 4px; background: #f1f3f6; color: #727b89 !important; font-size: 11px !important; }
.account-state.active { background: #eaf7ef; color: #24834d !important; }

.account-modal {
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  animation: modalIn 160ms ease-out;
}
.account-form { display: grid; gap: 16px; padding: 24px 30px 28px; }
.account-form label { display: grid; gap: 7px; color: #303746; font-size: 13px; font-weight: 600; }
.account-form label small { color: #8b93a1; font-weight: 400; }
.account-form input { width: 100%; }
.account-profile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #e7eaf0; border-radius: 6px; background: #f8fafc; }
.account-profile .member-avatar { width: 42px; height: 42px; }
.account-profile span, .account-profile strong, .account-profile small { display: block; }
.account-profile small { margin-top: 3px; color: var(--muted); }

.presence-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 16px; }
.presence-layout .panel { min-width: 0; }
.presence-summary { padding: 4px 8px; border-radius: 5px; background: #eef7f2; color: #27734c; font-size: 12px; font-weight: 700; }
.presence-list, .workspace-activity { display: grid; }
.presence-person, .workspace-activity-item { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 10px 2px; border-top: 1px solid #edf0f4; }
.presence-person:first-child, .workspace-activity-item:first-child { border-top: 0; }
.presence-person .member-avatar, .workspace-activity-item .member-avatar { width: 34px; height: 34px; flex: 0 0 34px; }
.presence-person > span, .workspace-activity-item > span { min-width: 0; flex: 1; }
.presence-person strong, .presence-person small { display: block; }
.presence-person strong { font-size: 13px; }
.presence-person small, .workspace-activity-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.presence-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #cbd1da; box-shadow: 0 0 0 3px #f2f4f7; }
.presence-dot.online { background: #22a566; box-shadow: 0 0 0 3px #e3f5eb; }
.presence-dot.recent { background: #e2a52b; box-shadow: 0 0 0 3px #fbf1da; }
.workspace-activity-item { align-items: flex-start; }
.workspace-activity-item p { margin: 1px 0 0; color: #3f4652; font-size: 13px; line-height: 1.4; }
.workspace-activity-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) { .presence-layout { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .people-manager-layout { grid-template-columns: 1fr; }
  .people-list { border-right: 0; border-bottom: 1px solid #e8ebef; }
  .people-modal-header { padding: 22px; }
  .person-form { padding: 20px; }
}

.command-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px;
}

.task-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 16px;
  padding: 24px;
  animation: modalIn 160ms ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-heading h2 {
  font-size: 1.6rem;
}

.title-field input {
  min-height: 50px;
  font-size: 1rem;
  font-weight: 750;
}

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

.editor-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.editor-shell:focus-within {
  border-color: rgba(71, 95, 136, 0.65);
  box-shadow: 0 0 0 3px rgba(71, 95, 136, 0.14);
}

.editor-shell textarea {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 108px;
}

.select-with-avatar {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
}

.select-with-avatar .avatar {
  width: 34px;
  height: 34px;
}

.assignee-form-field { display: grid; grid-column: 1 / -1; gap: 7px; color: #303746; font-size: 13px; font-weight: 600; }
.assignee-form-field > span small { color: #8b93a1; font-weight: 400; }
.assignee-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.assignee-option, .drawer-assignee-list label { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 9px !important; min-width: 0; padding: 8px; border: 1px solid transparent; border-radius: 5px; background: #fff; cursor: pointer; }
.assignee-option:has(input:checked), .drawer-assignee-list label:has(input:checked) { border-color: #b9cbed; background: #eef4ff; }
.assignee-option input, .drawer-assignee-list input { width: 16px !important; height: 16px; margin: 0; }
.assignee-option .member-avatar, .drawer-assignee-list .member-avatar { width: 28px; height: 28px; flex: 0 0 28px; }
.assignee-option > span:last-child, .drawer-assignee-list label > span:last-child { overflow: hidden; color: #303746; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.drawer-assignee-list { display: grid; gap: 6px; }

.avatar-group { display: inline-flex; align-items: center; min-width: 0; padding-left: 5px; }
.avatar-group .avatar { width: 30px; height: 30px; margin-left: -6px; border: 2px solid #fff; box-shadow: 0 0 0 1px #e2e6ec; }
.avatar-group.compact .avatar { width: 28px; height: 28px; }
.avatar-group .avatar-more { background: #eef2f7; color: #526071; font-size: 10px; font-weight: 800; }
.table-assignees { display: flex; align-items: center; gap: 7px; min-width: 150px; }
.table-assignees > span:last-child { max-width: 150px; overflow: hidden; color: #596273; text-overflow: ellipsis; white-space: nowrap; }

.priority-segment {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.priority-segment button {
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.priority-segment button:last-child {
  border-right: 0;
}

.priority-segment button.active {
  background: #e9eef8;
  color: #2f4265;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.date-presets button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 760;
  padding: 0 10px;
}

.more-options {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.more-options summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.modal-actions {
  margin-top: 16px;
}

.command-panel {
  width: min(640px, 100%);
}

.command-panel h2 {
  margin-bottom: 12px;
}

.command-results {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.command-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.command-item:hover {
  background: var(--faint);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 25;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(640px, 100%);
  height: 100vh;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -18px 0 50px rgba(17, 24, 39, 0.12);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

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

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  padding: 18px;
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
}

.drawer-hero,
.drawer-section {
  display: grid;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 14px;
}

.drawer-hero {
  background: transparent;
  padding-top: 4px;
}

.drawer-title-edit {
  display: grid;
  gap: 7px;
}

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

.drawer-title-edit span,
.drawer-section-heading span,
.drawer-field > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.drawer-title-edit input {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 850;
  line-height: 1.25;
  padding: 0;
}

.drawer-title-edit input:focus {
  outline: 0;
}

.drawer-chips,
.drawer-section-heading,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-chips,
.drawer-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.drawer-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  margin: 0 -18px -18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  padding: 14px 18px;
}

.status-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.status-switch button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  transition: background 150ms ease, color 150ms ease;
}

.status-switch button:last-child {
  border-right: 0;
}

.status-switch button:hover,
.status-switch button.active {
  background: #fff;
  color: var(--ink);
}

.status-switch button.active {
  box-shadow: inset 0 -2px 0 #2563eb;
}

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

.drawer-field.span-2 {
  grid-column: 1 / -1;
}

.drawer-assignee-control {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.drawer-assignee-control .member-avatar {
  width: 34px;
  height: 34px;
}

.drawer-description,
.comment-form textarea {
  resize: vertical;
}

.file-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0 10px;
}

.file-upload-button:hover {
  border-color: var(--line-strong);
  background: var(--faint);
}

.file-upload-button input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

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

.comment-form button {
  justify-self: end;
}

.comment-list,
.activity-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 9px;
}

.comment-item .member-avatar {
  width: 34px;
  height: 34px;
}

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

.comment-meta strong {
  font-size: 0.84rem;
}

.comment-meta span,
.activity-item small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.comment-item p {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.activity-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.activity-item .member-avatar {
  width: 28px;
  height: 28px;
}

.activity-item p {
  margin: 0;
  line-height: 1.45;
}

.activity-item strong {
  color: var(--ink);
}

.activity-item small {
  margin-left: 4px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .topbar-actions,
  .topbar-controls,
  .metric-strip {
    justify-content: flex-start;
  }

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

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

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

  .owner-analysis-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 900px) {
  .login-screen {
    padding: 24px;
  }

  .login-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 24;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
  }

  .side-nav {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .shortcut-card {
    margin-top: 0;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .login-screen {
    min-height: 100svh;
    padding: 12px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-brand-panel {
    min-height: 190px;
    padding: 24px;
  }

  .login-brand-copy {
    margin-top: 34px;
  }

  .login-brand-copy h2 {
    max-width: 280px;
    font-size: 2rem;
  }

  .login-brand-footer {
    display: none;
  }

  .login-card {
    padding: 30px 24px 28px;
  }

  .login-card h1 {
    font-size: 2rem;
  }

  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar {
    margin: -16px -16px 0;
    padding: 14px 16px;
  }

  .topbar,
  .section-heading,
  .modal-heading,
  .task-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

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

  .quick-filter-row {
    justify-content: flex-start;
  }

  .topbar-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .actor-control {
    grid-column: 1 / -1;
  }

  .topbar-actions,
  .quick-actions,
  .modal-actions,
  .table-actions {
    justify-content: stretch;
  }

  .topbar-actions > *,
  .quick-actions > *,
  .modal-actions > *,
  .table-actions > * {
    flex: 1;
  }

  .filter-bar,
  .compact-form,
  .side-nav,
  .team-grid,
  .owner-analysis-grid,
  .assignee-grid,
  .archive-grid,
  .drawer-detail-grid {
    grid-template-columns: 1fr;
  }

  .analysis-card.wide,
  .owner-analysis-grid .analysis-card {
    grid-column: auto;
  }

  .donut-panel,
  .status-dashboard,
  .scorecard-grid {
    grid-template-columns: 1fr;
  }

  .delivery-chart {
    gap: 5px;
  }

  .donut {
    justify-self: center;
    width: 150px;
  }

  .risk-matrix {
    min-height: 220px;
  }

  .status-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-switch button:nth-child(2) {
    border-right: 0;
  }

  .status-switch button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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