/* static/styles.css */
:root {
  --bg: #0f1419;
  --panel: #1a222d;
  --border: #2d3848;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-dim: #2563c4;
  --danger: #f87171;
  --col-backlog: #6366f1;
  --col-planned: #0ea5e9;
  --col-progress: #f59e0b;
  --col-done: #22c55e;
  --radius: 10px;
  --font: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-screen[hidden] {
  display: none !important;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.layout {
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 52px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100%;
  max-height: 100vh;
  min-height: 0;
  transition: grid-template-columns 0.22s ease;
}

.layout[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .layout {
    transition: none;
  }
}

.layout.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

.layout.sidebar-collapsed .sidebar {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}

.layout.sidebar-collapsed .lang-dropdown {
  display: none;
}

.lang-dropdown {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.lang-dropdown:hover {
  border-color: var(--muted);
}

.lang-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-sidebar-toggle {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.btn-sidebar-toggle:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.layout.sidebar-collapsed .sidebar-body {
  display: none;
}

.layout.sidebar-collapsed .brand {
  display: none;
}

.layout.sidebar-collapsed .sidebar-header {
  justify-content: center;
  align-items: center;
  padding-top: 0.15rem;
}

.brand .logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.brand .sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  border-color: var(--muted);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.danger {
  border-color: #7f1d1d;
  color: var(--danger);
}

.btn.danger.ghost {
  background: transparent;
}

.btn.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn.block {
  width: 100%;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.5rem 0 0.35rem;
}

.project-mgmt-list {
  max-height: min(50vh, 420px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.65rem;
  margin-top: 0.75rem;
}

.project-mgmt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.project-mgmt-row:last-child {
  border-bottom: none;
}

.project-mgmt-name {
  flex: 1;
  min-width: 8rem;
}

.project-mgmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.product-item {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.product-item-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
}

.product-item-name {
  font-size: 0.9rem;
}

.product-item-project {
  font-size: 0.7rem;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.product-item.active {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.12);
}

.link-help {
  font-size: 0.86rem;
  line-height: 1.45;
  margin: 0 0 0.75rem;
}

.link-product-list {
  max-height: 48vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
}

.link-product-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
}

.link-product-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.link-product-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-product-cur {
  font-size: 0.75rem;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.main {
  padding: 1.5rem 2rem;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toolbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.muted {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  max-width: 56rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.main-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.main-tab {
  font: inherit;
  cursor: pointer;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}

.main-tab:hover {
  color: var(--text);
  border-color: var(--muted);
}

.main-tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.12);
}

.view-analytics {
  margin-top: 0.25rem;
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.analytics-scope {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.analytics-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.analytics-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.kpi-card .kpi-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.analytics-library {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.analytics-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.analytics-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.completion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

.bar-label {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px;
  min-width: 2px;
}

.bar-val {
  text-align: right;
  color: var(--text);
}

.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.analytics-table th,
.analytics-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.analytics-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-weight: 600;
}

.analytics-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.ai-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.ai-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-right: 0.25rem;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.board-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    max-height: none;
    min-height: 100vh;
  }

  .sidebar {
    overflow: visible;
    max-height: none;
  }

  .sidebar-body {
    overflow: visible;
  }

  .main {
    overflow: visible;
    min-height: 0;
  }

  .columns {
    grid-template-columns: 1fr;
  }
}

.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 120px;
}

.column-head {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.column-head.backlog { border-left: 3px solid var(--col-backlog); }
.column-head.planned { border-left: 3px solid var(--col-planned); }
.column-head.in_progress { border-left: 3px solid var(--col-progress); }
.column-head.done { border-left: 3px solid var(--col-done); }

.column-body {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.65rem;
  font-size: 0.88rem;
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.task-sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.task-toolbar {
  margin-bottom: 0.75rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
}

.task-empty {
  margin: 0.5rem 0;
  font-size: 0.88rem;
}

.task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.task-row-main {
  flex: 1;
  min-width: 140px;
}

.task-title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
}

.task-meta {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.task-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.task-status-sel {
  min-width: 6.5rem;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.form-group textarea {
  min-height: 72px;
  resize: vertical;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.modal-card.wide {
  max-width: 720px;
}

.modal-x {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-x:hover {
  color: var(--text);
}

.modal h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.pre {
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.modal-ai-pre {
  max-height: min(55vh, 420px);
  overflow: auto;
}

.modal-export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.modal-export-actions .small {
  margin-right: 0.25rem;
}

.ai-loading {
  padding: 0.25rem 0 0.5rem;
}

.ai-loading-title {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  text-align: center;
}

.ai-loading-visual {
  text-align: center;
  padding: 0 0.5rem;
}

.ai-loading-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.25rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-spin 0.75s linear infinite;
}

@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-loading-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 auto 1rem;
  max-width: 280px;
}

.ai-loading-bar-fill {
  width: 42%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-dim));
  animation: ai-indeterminate 1.15s ease-in-out infinite;
}

@keyframes ai-indeterminate {
  0% {
    transform: translateX(-120%);
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(320%);
    opacity: 0.85;
  }
}

.ai-loading-status {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.ai-loading-hint {
  margin: 0;
  line-height: 1.45;
}

.ai-loading-dots span {
  animation: ai-dot-blink 1.35s infinite both;
  opacity: 0.25;
}

.ai-loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-dot-blink {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

.ai-loading-pipeline {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--border);
}

.ai-loading-pipeline li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0;
  font-size: 0.86rem;
  color: var(--muted);
  animation: ai-pipe-wave 2.1s ease-in-out infinite;
}

.ai-loading-pipeline li:nth-child(1) {
  animation-delay: 0s;
}

.ai-loading-pipeline li:nth-child(2) {
  animation-delay: 0.35s;
}

.ai-loading-pipeline li:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes ai-pipe-wave {
  0%,
  100% {
    opacity: 0.38;
    color: var(--muted);
  }
  40% {
    opacity: 1;
    color: var(--text);
  }
}

.ai-pipe-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  animation: ai-pipe-dot 2.1s ease-in-out infinite;
}

.ai-loading-pipeline li:nth-child(1) .ai-pipe-icon {
  animation-delay: 0s;
}

.ai-loading-pipeline li:nth-child(2) .ai-pipe-icon {
  animation-delay: 0.35s;
}

.ai-loading-pipeline li:nth-child(3) .ai-pipe-icon {
  animation-delay: 0.7s;
}

@keyframes ai-pipe-dot {
  0%,
  100% {
    background: var(--border);
    box-shadow: 0 0 0 0 transparent;
  }
  40% {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(61, 139, 253, 0.45);
  }
}

.ai-error h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--danger);
}

.ai-error-msg {
  margin: 0 0 1rem;
  line-height: 1.5;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.toast[hidden] {
  display: none !important;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.view-teams {
  margin-top: 0.25rem;
}

.teams-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 1.25rem;
  align-items: start;
  min-height: 320px;
}

@media (max-width: 720px) {
  .teams-layout {
    grid-template-columns: 1fr;
  }
}

.teams-nav {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teams-nav-head {
  margin-bottom: 0.25rem;
}

.teams-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: min(60vh, 480px);
  overflow-y: auto;
}

.teams-nav-item {
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.teams-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.teams-nav-item.active {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.12);
}

.teams-detail {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.teams-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.teams-detail-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.teams-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.teams-detail-desc {
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}

.teams-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.teams-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.teams-section .small {
  font-size: 0.82rem;
  margin: 0 0 0.5rem;
}

.teams-members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-top: 0.65rem;
}

.teams-members-table th,
.teams-members-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.teams-members-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-weight: 600;
}

.teams-member-actions {
  white-space: nowrap;
  text-align: right;
}

.teams-member-actions .btn + .btn {
  margin-left: 0.25rem;
}

.teams-proj-row {
  align-items: flex-start;
}

.teams-empty {
  padding: 1rem;
}

.view-lifecycle {
  margin-top: 0.25rem;
}

.lifecycle-intro {
  margin-bottom: 1.25rem;
}

.lifecycle-intro h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.lifecycle-intro p {
  margin: 0.35rem 0;
  max-width: 52rem;
  line-height: 1.55;
}

.lifecycle-product-hint {
  font-size: 0.9rem;
}

.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.lifecycle-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lifecycle-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
}

.lifecycle-card .small {
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.45;
}

.lifecycle-checks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.lifecycle-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.86rem;
  cursor: pointer;
  line-height: 1.4;
}

.lifecycle-check-row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.lifecycle-card .btn-lifecycle-ai {
  align-self: flex-start;
  margin-top: 0.25rem;
}