:root {
  --bg: #eef1f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-alt: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.18);
  --accent-secondary: #f97316;
  --danger: #ef4444;
  --text: #0f172a;
  --muted: #6b7280;
  --border: rgba(148, 163, 184, 0.35);
  --radius: 18px;
  --shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 25px 45px rgba(15, 23, 42, 0.14);
  --gradient-accent: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 248, 255, 0.92) 100%);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(circle at 82% 12%, rgba(236, 72, 153, 0.16), transparent 52%),
    radial-gradient(circle at 85% 78%, rgba(34, 197, 94, 0.12), transparent 48%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-attachment: fixed;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

button {
  font: inherit;
  cursor: pointer;
}

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

button.primary {
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button.primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 24px 38px rgba(37, 99, 235, 0.32);
}

button.ghost {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

button.ghost:hover {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
  transform: translateY(-1px);
}

button.danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

button.danger:hover {
  border-color: var(--danger);
}

button.nav-button {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

button.nav-button:hover {
  color: var(--accent);
}

button.nav-button.active {
  background: rgba(37, 99, 235, 0.18);
  color: var(--accent);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-header p {
  color: var(--muted);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-hint {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.form-error {
  color: var(--danger);
  min-height: 1.25em;
  font-size: 0.9rem;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 48px 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.06);
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
}

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

.content {
  flex: 1;
  padding: 0 48px 48px;
}

.view {
  background: var(--gradient-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view.hidden {
  display: none;
}

.view + .view {
  margin-top: 32px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.view-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.empty-state {
  border: 2px dashed rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
}

.project-table {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-table li {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-alt);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.project-table li:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 20px 36px rgba(37, 99, 235, 0.18);
}

.project-row.active {
  border-color: var(--accent);
  box-shadow: 0 26px 46px rgba(37, 99, 235, 0.22);
}

.project-row:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.project-trailing {
  display: flex;
  align-items: center;
  gap: 18px;
}

.team-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 120px;
  text-align: right;
}

.avatar-stack {
  display: flex;
  align-items: center;
  gap: 6px;
}

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.85));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

.avatar-badge.overflow {
  background: rgba(15, 23, 42, 0.6);
  box-shadow: none;
}

.team-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-info h3 {
  font-size: 1.1rem;
}

.project-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.project-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-summary h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.project-summary p {
  line-height: 1.5;
}

.project-team {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.project-team-heading {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.team-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.team-chip-name {
  font-weight: 500;
}

.team-chip .chip-avatar {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(59, 130, 246, 0.75));
  color: #fff;
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.25);
}

.assignee-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.assignee-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.assignee-chip.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.assignee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.assignee-name {
  font-weight: 500;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.column {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.column.drag-over {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.18);
}

.column h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.column-count {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.column-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card {
  background: var(--surface-strong);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.16);
}

.card:active {
  cursor: grabbing;
}

.card.dragging {
  opacity: 0.6;
  transform: rotate(2deg);
  box-shadow: none;
}

.card h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card p {
  font-size: 0.92rem;
  color: var(--muted);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.task-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

button.task-action {
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

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

button.task-action:hover,
button.task-action:focus {
  text-decoration: underline;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
}

.data-table thead {
  background: var(--surface-alt);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.data-table tbody tr + tr {
  border-top: 1px solid var(--border);
}

.align-right {
  text-align: right;
}

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

.badge {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.secondary {
  background: rgba(99, 102, 241, 0.16);
  color: #4f46e5;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  padding: 32px;
  width: min(440px, 90vw);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

.modal-fieldset {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-fieldset legend {
  font-weight: 600;
  font-size: 0.95rem;
}

.helper-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-option {
  position: relative;
  display: inline-flex;
}

.chip-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-option-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.chip-option input:checked + .chip-option-label {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
}

.chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.16);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.empty-members {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-form input,
.modal-form textarea,
.modal-form select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
}

.modal-form input:focus,
.modal-form textarea:focus,
.modal-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

@media (max-width: 1100px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .content {
    padding: 0 24px 32px;
  }
}

@media (max-width: 780px) {
  .view {
    padding: 24px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .view-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .project-table li {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-trailing {
    width: 100%;
    justify-content: space-between;
  }

  .team-preview {
    align-items: flex-start;
    text-align: left;
  }

  .table-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .modal-content {
    padding: 24px;
  }

  button.primary,
  button.ghost {
    width: 100%;
  }

  .view-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}
