/* === CSS Variables === */
:root {
  --bg-primary: #fafaf8;
  --bg-secondary: #f3f2ee;
  --bg-card: #ffffff;
  --bg-hover: #f0efe8;
  --bg-active: #e8e7df;

  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-tertiary: #8a8a8a;
  --text-inverse: #ffffff;

  --border-light: #e5e4dc;
  --border-medium: #d4d3ca;

  --accent-yellow: #f5e642;
  --accent-green: #7ec87e;
  --accent-blue: #8ecae6;
  --accent-red: #e05050;
  --accent-purple: #c084fc;
  --accent-orange: #fb923c;

  --status-todo: #d4d3ca;
  --status-progress: #8ecae6;
  --status-review: #fb923c;
  --status-done: #7ec87e;
  --status-hold: #e05050;

  --priority-high: #e05050;
  --priority-mid: #fb923c;
  --priority-low: #8ecae6;

  --sidebar-w: 264px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-body: "Noto Sans JP", sans-serif;
  --font-heading: "Bricolage Grotesque", "Noto Sans JP", sans-serif;
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
#app[hidden] { display: none; }

/* === Sidebar === */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 24px 16px;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-accent {
  color: var(--accent-yellow);
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 200ms ease-out;
  width: 100%;
  text-align: left;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.nav-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
  border: 1px solid var(--border-light);
}

.sidebar-section {
  padding: 8px 16px 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.filter-count {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-filters {
  margin-top: auto;
  padding-bottom: 24px;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.sidebar-filters .section-title {
  padding: 0 8px 12px;
}

.filter-group {
  padding: 0 8px;
  margin-bottom: 8px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.filter-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.filter-group select:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

/* Project List */
.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 200ms ease-out;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.project-item:hover {
  background: var(--bg-hover);
}

.project-item.active {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}

.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-count {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-active);
  padding: 4px 8px;
  border-radius: 99px;
}

/* === Buttons === */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 200ms ease-out;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease-out;
}

.btn-primary:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease-out;
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-red);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease-out;
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-danger:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

/* === Main Content === */
#mainContent {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
}

.view.active {
  display: flex;
}

.view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 32px 16px;
  flex-shrink: 0;
}

.view-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-right: auto;
}

/* === Kanban === */
.kanban-board {
  display: flex;
  gap: 16px;
  padding: 0 32px 32px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
}

.kanban-column {
  min-width: 280px;
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 12px;
  flex-shrink: 0;
}

.kanban-column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-column-title {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.kanban-column-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.kanban-column-body {
  padding: 0 8px 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.kanban-column-body.drag-over {
  background: var(--bg-hover);
  border-radius: var(--radius-md);
}

/* Kanban Cards */
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: grab;
  transition: all 200ms ease-out;
  position: relative;
}

.kanban-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.card-project-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-project-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

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

.card-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 99px;
  line-height: 1.4;
}

.card-badge.priority-high {
  background: #fde8e8;
  color: var(--priority-high);
}

.card-badge.priority-mid {
  background: #fef3e2;
  color: #b45309;
}

.card-badge.priority-low {
  background: #e8f4fd;
  color: #0369a1;
}

.card-assignee {
  font-size: 11px;
  color: var(--text-tertiary);
}

.card-due {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.card-due.overdue {
  color: var(--accent-red);
  font-weight: 700;
}

.card-progress-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 300ms ease-out;
}

.card-subtasks {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.card-subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.card-subtask-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-medium);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease-out;
}

.card-subtask-check:hover {
  border-color: var(--accent-green);
}

.card-subtask-check.done {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.card-subtask-check.done::after {
  content: "✓";
  font-size: 10px;
  color: white;
  font-weight: 900;
}

.card-subtask-name.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* === List View === */
.list-content {
  padding: 0 32px 32px;
  overflow-y: auto;
  flex: 1;
}

.list-project-group {
  margin-bottom: 24px;
}

.list-project-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 200ms ease-out;
  border: 1px solid var(--border-light);
}

.list-project-header:hover {
  background: var(--bg-hover);
}

.list-project-chevron {
  transition: transform 200ms ease-out;
  color: var(--text-tertiary);
}

.list-project-chevron.collapsed {
  transform: rotate(-90deg);
}

.list-project-name {
  font-weight: 700;
  font-size: 15px;
  flex: 1;
}

.list-project-progress {
  width: 120px;
  height: 6px;
  background: var(--bg-active);
  border-radius: 3px;
  overflow: hidden;
}

.list-project-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-green);
  transition: width 300ms ease-out;
}

.list-project-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

.list-tasks {
  padding-left: 8px;
}

.list-task-row {
  display: grid;
  grid-template-columns: 24px 32px 1fr 80px 80px 96px 56px;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 200ms ease-out;
  border-bottom: 1px solid var(--border-light);
}

.list-task-row:hover {
  background: var(--bg-hover);
}

.list-task-row:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.list-task-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-medium);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease-out;
  flex-shrink: 0;
}

.list-task-check:hover {
  border-color: var(--accent-green);
}

.list-task-check.done {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.list-task-check.done::after {
  content: "✓";
  font-size: 12px;
  color: white;
  font-weight: 900;
}

.list-task-name {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-task-name.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.list-task-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 99px;
  text-align: center;
  white-space: nowrap;
}

.list-task-priority {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.list-task-assignee {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-task-due {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.list-task-due.overdue {
  color: var(--accent-red);
  font-weight: 700;
}

.list-task-progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.list-task-mini-bar {
  width: 32px;
  height: 4px;
  background: var(--bg-active);
  border-radius: 2px;
  overflow: hidden;
}

.list-task-mini-fill {
  height: 100%;
  border-radius: 2px;
}

/* List select checkbox */
.list-select-check {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease-out;
  flex-shrink: 0;
}

.list-select-check:hover {
  border-color: var(--accent-red);
}

.list-select-check.checked {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.list-select-check.checked::after {
  content: "✓";
  font-size: 10px;
  color: white;
  font-weight: 900;
}

/* Subtask rows */
.list-subtask-row {
  display: grid;
  grid-template-columns: 24px 32px 1fr 80px 80px 96px 56px;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 48px;
  cursor: pointer;
  transition: background 200ms ease-out;
  border-bottom: 1px solid transparent;
}

.list-subtask-row:hover {
  background: var(--bg-hover);
}

.list-subtask-row .list-task-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* === Dashboard === */
.dashboard-content {
  padding: 0 32px 32px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 24px;
  align-content: start;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.dash-card-full {
  grid-column: 1 / -1;
}

.dash-card-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* Dashboard header meta */
.dash-meta {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.dash-meta-date {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.dash-meta-group {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.dash-meta-group strong {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.dash-meta-label {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-right: 4px;
}

.dash-meta-unit {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Stats row */
.stats-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Donut chart */
.donut-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-svg {
  flex-shrink: 0;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-count {
  font-weight: 700;
  margin-left: auto;
  min-width: 24px;
  text-align: right;
}

/* Project progress bars */
.project-progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.progress-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.progress-item-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 500ms ease-out;
}

/* Timeline */
.timeline-container {
  overflow-x: auto;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.timeline-task-name {
  min-width: 160px;
  max-width: 160px;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-bar-container {
  flex: 1;
  height: 20px;
  position: relative;
}

.timeline-bar {
  position: absolute;
  height: 16px;
  top: 2px;
  border-radius: 8px;
  min-width: 16px;
}

.timeline-dates-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 2px solid var(--border-medium);
}

.timeline-dates-header .timeline-task-name {
  font-weight: 700;
  color: var(--text-tertiary);
  font-size: 11px;
}

.timeline-date-labels {
  flex: 1;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Priority chart */
.priority-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.priority-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-bar-label {
  min-width: 24px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.priority-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.priority-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 500ms ease-out;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-inverse);
  min-width: max-content;
}

[hidden] {
  display: none !important;
}

/* === Card Select Checkbox === */
.card-select {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-medium);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease-out;
  z-index: 2;
}

.card-select:hover {
  border-color: var(--accent-red);
}

.card-select.checked {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.card-select.checked::after {
  content: "✓";
  font-size: 12px;
  color: white;
  font-weight: 900;
}

.kanban-card.selected {
  border-color: var(--accent-red);
  background: #fef8f8;
}

/* === Trash Drop Zone === */
.kanban-trash {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  margin: 0 32px 16px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  transition: all 200ms ease-out;
}

.kanban-trash.visible {
  display: flex;
}

.kanban-trash.drag-over {
  border-color: var(--accent-red);
  background: #fde8e8;
  color: var(--accent-red);
}

/* === Progress Buttons === */
.progress-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.progress-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 200ms ease-out;
}

.progress-btn:hover {
  border-color: var(--border-medium);
  background: var(--bg-hover);
}

.progress-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.progress-btn.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

/* === Priority Matrix === */
.priority-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 14px;
  padding: 0 8px;
  margin-left: 8px;
}

.priority-score.score-high {
  background: #fde8e8;
  color: var(--accent-red);
}

.priority-score.score-mid {
  background: #fef3e2;
  color: #b45309;
}

.priority-score.score-low {
  background: #e8f4fd;
  color: #0369a1;
}

.priority-matrix-mini {
  display: grid;
  grid-template-columns: repeat(5, 16px);
  grid-template-rows: repeat(5, 16px);
  gap: 2px;
  transform: scaleY(-1);
}

.matrix-cell {
  border-radius: 2px;
  background: var(--bg-secondary);
}

.matrix-cell.active {
  border: 2px solid var(--text-primary);
}

.matrix-cell.zone-high { background: #fde8e8; }
.matrix-cell.zone-mid { background: #fef3e2; }
.matrix-cell.zone-low { background: #e8f4fd; }

.priority-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 0 8px;
  border-radius: 99px;
  line-height: 1.8;
  white-space: nowrap;
}

.priority-badge.score-high {
  background: #fde8e8;
  color: var(--accent-red);
}

.priority-badge.score-mid {
  background: #fef3e2;
  color: #b45309;
}

.priority-badge.score-low {
  background: #e8f4fd;
  color: #0369a1;
}

/* === Gantt Chart === */
.gantt-controls {
  display: flex;
  gap: 8px;
}

.gantt-zoom-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
}

.gantt-zoom-btn.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

.gantt-content {
  flex: 1;
  overflow: auto;
  padding: 0 32px 32px;
}

.gantt-wrapper {
  display: flex;
  min-width: max-content;
}

.gantt-sidebar {
  min-width: 240px;
  max-width: 240px;
  flex-shrink: 0;
  border-right: 2px solid var(--border-medium);
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--bg-primary);
}

.gantt-sidebar-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  border-bottom: 2px solid var(--border-medium);
  background: var(--bg-secondary);
}

.gantt-sidebar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 200ms ease-out;
}

.gantt-sidebar-row:hover {
  background: var(--bg-hover);
}

.gantt-sidebar-row.is-project {
  height: 40px;
  font-weight: 700;
  font-size: 13px;
  background: var(--bg-secondary);
}

.gantt-sidebar-row.is-subtask {
  padding-left: 40px;
  font-size: 12px;
  color: var(--text-secondary);
}

.gantt-select-check {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease-out;
  flex-shrink: 0;
}

.gantt-select-check:hover {
  border-color: var(--accent-red);
}

.gantt-select-check.checked {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.gantt-select-check.checked::after {
  content: "✓";
  font-size: 10px;
  color: white;
  font-weight: 900;
}

.gantt-sidebar-task-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 13px;
}

.gantt-sidebar-priority {
  font-size: 10px;
  font-weight: 700;
  padding: 0 8px;
  border-radius: 99px;
  line-height: 1.6;
}

.gantt-timeline {
  flex: 1;
}

.gantt-header {
  display: flex;
  height: 56px;
  border-bottom: 2px solid var(--border-medium);
  background: var(--bg-secondary);
}

.gantt-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.gantt-header-cell.is-weekend {
  background: var(--bg-hover);
}

.gantt-header-cell.is-today {
  background: var(--accent-yellow);
  color: var(--text-primary);
  font-weight: 700;
}

.gantt-header-month {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
}

.gantt-header-day {
  font-size: 10px;
}

.gantt-body {
  position: relative;
}

.gantt-row {
  height: 40px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
  display: flex;
}

.gantt-row.is-project {
  background: var(--bg-secondary);
}

.gantt-cell {
  flex-shrink: 0;
  border-right: 1px solid var(--border-light);
}

.gantt-cell.is-weekend {
  background: rgba(0, 0, 0, 0.02);
}

.gantt-bar {
  position: absolute;
  height: 24px;
  top: 8px;
  border-radius: 8px;
  min-width: 8px;
  cursor: pointer;
  transition: opacity 200ms ease-out;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.gantt-bar:hover {
  opacity: 0.85;
}

.gantt-bar-progress {
  height: 100%;
  border-radius: 8px 0 0 8px;
  opacity: 0.4;
}

.gantt-bar-label {
  position: absolute;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-inverse);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: calc(100% - 16px);
}

.gantt-bar.subtask-bar {
  height: 16px;
  top: 12px;
  border-radius: 4px;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-red);
  z-index: 5;
  pointer-events: none;
}

.gantt-today-label {
  position: absolute;
  top: -24px;
  left: -16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-red);
  white-space: nowrap;
}

.gantt-dependency {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.gantt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  color: var(--text-tertiary);
  gap: 16px;
}

/* === Modals === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 150ms ease-out;
}

.modal-overlay.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 200ms ease-out;
}

.modal-sm {
  width: 400px;
}

.modal-xs {
  width: 320px;
  text-align: center;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-full {
  flex: 1 1 100%;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.required {
  color: var(--accent-red);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color 200ms ease-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-group input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-secondary);
  outline: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
}

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

.modal-actions-right {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease-out;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  color: var(--text-tertiary);
  gap: 16px;
}

.empty-state svg {
  opacity: 0.3;
}

.empty-state p {
  font-size: 15px;
}

/* === Status Colors === */
.status-todo { background: var(--status-todo); color: var(--text-primary); }
.status-progress { background: #dbeafe; color: #1e40af; }
.status-review { background: #fef3e2; color: #b45309; }
.status-done { background: #dcfce7; color: #166534; }
.status-hold { background: #fde8e8; color: #b91c1c; }

/* === Utility Classes (for JS-rendered content) === */
.empty-state-compact {
  padding: 32px 16px;
}

.empty-state-compact p {
  font-size: 12px;
}

.stat-unit {
  font-size: 24px;
}

.text-green { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }
.text-red { color: var(--accent-red); }

.workload-label {
  min-width: 56px;
  font-size: 12px;
}

.timeline-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 24px;
  font-size: 13px;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ============================================================
 * v2 Extensions — Login / Report / Visibility / Requester
 * ============================================================ */

/* --- Login Gate --- */
.login-gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary, #ffffff);
  z-index: 9999;
  padding: 24px;
}

.login-box { width: 100%; max-width: 400px; }

.login-header { text-align: center; margin-bottom: 40px; }

.login-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 44px; font-weight: 900;
  letter-spacing: -0.02em; line-height: 1;
  color: var(--text-primary, #0f1115);
}
.login-accent { color: #2b5c8a; }
.login-sub {
  font-size: 12px; color: var(--text-secondary, #5a6270);
  margin-top: 8px; letter-spacing: 0.05em;
}

.login-form {
  background: var(--bg-secondary, #fafbfc);
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 12px;
  padding: 32px;
  display: flex; flex-direction: column; gap: 20px;
}

.login-field label {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--text-secondary, #5a6270);
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.login-field input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 8px; font-size: 14px;
  background: #ffffff;
  font-family: inherit;
  transition: border-color 180ms ease-out;
}
.login-field input:focus { outline: none; border-color: #2b5c8a; }
.login-field input::placeholder { color: #8a8a8a; }

.login-error {
  font-size: 13px; color: #c44a4a;
  background: #fdf0f0; border: 1px solid #f5d0d0;
  border-radius: 6px; padding: 10px 12px;
}

.login-submit {
  height: 44px; background: #2b5c8a; color: #ffffff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: background 180ms ease-out;
}
.login-submit:hover:not(:disabled) { background: #234b74; }
.login-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Sidebar user --- */
.sidebar-user {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border-light, #e3e7ec);
}
.user-name { font-size: 14px; font-weight: 500; color: var(--text-primary, #0f1115); }
.user-dept { font-size: 11px; color: var(--text-secondary, #5a6270); margin-top: 2px; }
.btn-logout {
  width: 100%; margin-top: 12px;
  height: 32px; background: transparent;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 6px; font-size: 12px;
  color: var(--text-secondary, #5a6270);
  cursor: pointer; transition: background 180ms ease-out;
  font-family: inherit;
}
.btn-logout:hover { background: var(--bg-secondary, #fafbfc); color: var(--text-primary); }

/* --- Kanban (v2) --- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
}
.kanban-col {
  background: #ffffff;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 10px;
  display: flex; flex-direction: column;
  min-height: 200px;
}
.kanban-col-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
  display: flex; align-items: center; gap: 8px;
}
.kanban-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kanban-col-name { font-size: 13px; font-weight: 500; flex: 1; }
.kanban-col-count {
  font-size: 11px; color: var(--text-secondary, #5a6270);
  font-family: "JetBrains Mono", monospace;
}
.kanban-col-body {
  flex: 1; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  max-height: 70vh; overflow-y: auto;
  transition: background 150ms ease-out;
  border-radius: 8px;
  min-height: 80px;
}
.kanban-col-body.drag-over {
  background: rgba(43, 92, 138, 0.08);
  outline: 2px dashed rgba(43, 92, 138, 0.35);
  outline-offset: -4px;
}
.task-card[draggable="true"] { cursor: grab; }
.task-card[draggable="true"]:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.4; }
.task-card.task-overdue {
  border-left: 3px solid var(--accent-red);
  padding-left: 10px;
}
.kanban-empty {
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: center;
  padding: 18px 10px;
  letter-spacing: 0.1em;
}

/* Date chips on task cards */
.date-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: 6px;
  letter-spacing: 0.02em;
}
.date-chip.date-today    { background: #fff4d6; color: #8a6a00; }
.date-chip.date-soon     { background: #ffe3c7; color: #a0501e; }
.date-chip.date-overdue  { background: #fde4e4; color: #a83333; }
.date-chip.date-week     { background: #e6edf4; color: #3a5a7a; }
.date-chip.date-future   { background: var(--bg-secondary); color: var(--text-secondary); }
.date-abs {
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}

/* Accessibility — Focus states */
button:focus-visible,
.nav-btn:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-blue, #2b5c8a);
  outline-offset: 2px;
}
.task-card:focus-visible {
  outline: 2px solid var(--accent-blue, #2b5c8a);
  outline-offset: 3px;
  border-color: transparent;
}

/* Prevent body scroll when modal open */
body:has(.modal-overlay.open) { overflow: hidden; }

/* === Calendar === */
.cal-nav {
  display: flex; align-items: center; gap: 6px;
}
.cal-label {
  font-size: 15px; font-weight: 600;
  min-width: 120px; text-align: center;
  color: var(--text-primary);
}
.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.btn-icon:hover { background: var(--bg-hover); border-color: var(--border-medium); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.cal-dow {
  background: var(--bg-secondary);
  padding: 8px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.08em;
}
.cal-dow.cal-sun { color: #c44a4a; }
.cal-dow.cal-sat { color: #3a7aa8; }

.cal-cell {
  background: var(--bg-card);
  min-height: 96px;
  padding: 6px 8px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
}
.cal-cell.cal-off {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}
.cal-cell.cal-today { background: #fff8e1; }
.cal-cell.cal-today .cal-day {
  color: #8a6a00; font-weight: 700;
}
.cal-day {
  font-size: 12px; font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-secondary);
}
.cal-cell.cal-sun .cal-day { color: #c44a4a; }
.cal-cell.cal-sat .cal-day { color: #3a7aa8; }

.cal-tasks {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.cal-task {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: filter 120ms ease-out;
}
.cal-task:hover { filter: brightness(0.94); }
.cal-task.cal-high { background: #fde4e4; color: #a83333; }
.cal-task.cal-mid  { background: #ffe3c7; color: #a0501e; }
.cal-task.cal-low  { background: #e6edf4; color: #3a5a7a; }
.cal-task.cal-done { background: #dff0e1; color: #2d6b3a; text-decoration: line-through; opacity: 0.8; }
.cal-more {
  font-size: 10px; color: var(--text-tertiary);
  padding: 0 6px;
}

/* Segmented toggle (report list/calendar) */
.report-controls {
  display: flex; align-items: center; gap: 12px;
}
.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
}
.seg-btn {
  padding: 6px 14px;
  font-size: 12px; font-weight: 500;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 120ms ease-out, color 120ms ease-out;
}
.seg-btn:not(:last-child) { border-right: 1px solid var(--border-light); }
.seg-btn:hover { background: var(--bg-hover); }
.seg-btn.active { background: #2b5c8a; color: #ffffff; }

.live-badge {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fff4d6; color: #8a6a00;
  letter-spacing: 0.02em;
}
.live-badge.live-confirmed {
  background: #dff0e1; color: #2d6b3a;
}
.stat-meta {
  display: flex; align-items: center;
  padding-left: 8px;
}

/* === Gantt === */
.gantt-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.gantt-scroll {
  overflow-x: auto;
  overflow-y: visible;
}
.gantt-header {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  height: 36px;
  align-items: center;
}
.gantt-name-col {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-right: 1px solid var(--border-light);
  height: 100%;
  display: flex; align-items: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-body .gantt-name-col {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  gap: 6px;
}
.gantt-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gantt-timeline {
  position: relative;
  height: 100%;
  flex-shrink: 0;
}
.gantt-month-label {
  position: absolute; top: 0;
  font-size: 11px; font-weight: 500;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
  padding-left: 4px;
  border-left: 1px solid var(--border-light);
  height: 100%;
  display: flex; align-items: center;
}
.gantt-body {
  background: var(--bg-card);
}
.gantt-row {
  display: flex;
  height: 36px;
  border-bottom: 1px solid var(--border-light);
  transition: background 120ms ease-out;
}
.gantt-row:hover { background: var(--bg-hover); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: #c44a4a;
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}
.gantt-bar {
  position: absolute;
  top: 6px; bottom: 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center;
  padding: 0 8px;
  overflow: hidden;
  transition: filter 120ms ease-out, transform 120ms ease-out;
  z-index: 2;
}
.gantt-bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gantt-bar.gantt-overdue {
  outline: 2px solid #c44a4a;
  outline-offset: -2px;
}
.gantt-bar-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.28);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
}
.gantt-bar-label {
  position: relative;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  z-index: 1;
}
.gantt-legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-secondary);
}
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.legend-today {
  color: #c44a4a;
  font-weight: 600;
}

.empty-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* === Sidebar Projects === */
.sidebar-projects {
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.sidebar-projects .section-title {
  padding: 0 8px 10px;
}
.project-add-btn {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.project-add-btn:hover {
  background: #2b5c8a; color: #ffffff; border-color: #2b5c8a;
}
.project-list {
  display: flex; flex-direction: column; gap: 1px;
  padding: 0 4px;
  max-height: 220px;
  overflow-y: auto;
}
.project-row {
  display: flex; align-items: center;
  border-radius: 6px;
  transition: background 120ms ease-out;
}
.project-row:hover { background: var(--bg-hover); }
.project-btn {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  text-align: left;
}
.project-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.project-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.project-edit {
  width: 24px; height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  margin-right: 4px;
  opacity: 0;
  transition: opacity 120ms ease-out, background 120ms ease-out;
}
.project-row:hover .project-edit { opacity: 1; }
.project-edit:hover { background: var(--border-light); color: var(--text-primary); }
.project-empty {
  padding: 12px 10px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
}

/* Project chip on task cards */
.task-project-chip {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 6px;
  font-size: 10px; font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--proj-color) 14%, transparent);
  color: color-mix(in srgb, var(--proj-color) 70%, #1a1a1a);
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-project-chip .project-dot {
  width: 7px; height: 7px;
  background: var(--proj-color);
}

/* Color swatches (project modal) */
.color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease-out, border-color 120ms ease-out;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

/* Small modal variant */
.modal.modal-sm { width: 460px; }

/* ================================================================
   SIMPLIFICATION LAYER — 統一トーン（シンプル・呼吸・軽く）
   Apple / Linear 風。装飾を削ぎ、情報階層を明確に。
   ================================================================ */

/* --- Logo: グラデをやめてソリッド・小さく --- */
.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-accent {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
  background-clip: initial;
  color: #bfa31c;
}
.sidebar-header { padding: 20px 20px 12px; }

/* --- Sidebar 全体: より軽く --- */
#sidebar {
  width: 232px;
  min-width: 232px;
  background: #fafaf8;
}
.sidebar-nav {
  padding: 0 12px 8px;
  gap: 2px;
}
.nav-btn {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 120ms ease-out, color 120ms ease-out;
}
.nav-btn.active {
  background: rgba(43, 92, 138, 0.08);
  color: #2b5c8a;
  font-weight: 600;
  border: 0;
}

/* --- Section title: 控えめに、uppercaseをやめる --- */
.section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-tertiary);
  padding: 0;
}
.sidebar-filters .section-title,
.sidebar-projects .section-title { padding: 0 8px 8px; }
.filter-count {
  background: transparent;
  padding: 0;
  font-size: 10px;
  color: var(--text-tertiary);
}
.filter-title-right {
  display: inline-flex; align-items: center; gap: 8px;
}
.filter-clear {
  font-size: 10px;
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: #2b5c8a;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 500;
  transition: background 120ms ease-out;
  text-transform: none;
  letter-spacing: 0;
}
.filter-clear:hover { background: rgba(43, 92, 138, 0.1); }
.sidebar-section { padding: 12px; }
.sidebar-projects,
.sidebar-filters {
  border: 0;
  padding: 8px 4px;
}
.sidebar-filters { margin-top: auto; }

/* --- Project rows: よりタイト --- */
.project-btn { padding: 5px 8px; font-size: 12px; }
.project-dot { width: 8px; height: 8px; }
.project-add-btn {
  width: 18px; height: 18px;
  font-size: 13px;
  border-color: transparent;
  background: transparent;
}
.project-add-btn:hover { background: rgba(43, 92, 138, 0.1); color: #2b5c8a; border-color: transparent; }

/* --- Filter groups: 枠をやめてシンプルに --- */
.filter-group label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: 0;
}
.filter-group select {
  font-size: 12px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  padding: 5px 8px;
  border-radius: 6px;
}

/* --- Sidebar user footer: 控えめ --- */
.sidebar-user { padding: 12px 16px; font-size: 12px; }
.user-name { font-weight: 500; font-size: 12px; }
.user-dept { font-size: 10px; color: var(--text-tertiary); }
.btn-logout {
  margin-top: 8px;
  font-size: 11px;
  padding: 5px 10px;
}

/* --- Main content padding --- */
#mainContent { padding: 24px 28px; }

/* --- View header: h2 を軽く --- */
.view-header {
  margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.view-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* --- Buttons: シンプル統一 --- */
.btn-primary {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  background: #2b5c8a;
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease-out;
}
.btn-primary:hover { background: #234b74; }
.btn-secondary {
  padding: 7px 14px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--bg-hover); }

/* --- Kanban: より空気感 --- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
}
.kanban-col {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex; flex-direction: column;
  min-height: 200px;
}
.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px 10px;
  border: 0;
  background: transparent;
}
.kanban-col-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.kanban-col-count {
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-tertiary);
  margin-left: auto;
}
.kanban-dot { width: 7px; height: 7px; }
.kanban-col-body {
  padding: 0;
  gap: 6px;
  max-height: none;
  background: transparent;
  border-radius: 8px;
}
.kanban-col-body.drag-over {
  background: rgba(43, 92, 138, 0.05);
  outline: 1px dashed rgba(43, 92, 138, 0.3);
}

/* --- Task cards: 情報を絞り、左の色帯でプロジェクト --- */
.task-card {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 120ms ease-out, transform 120ms ease-out;
}
.task-card:hover {
  border-color: #bfbbad;
  transform: none;
}
.task-card.task-overdue {
  border-left: 3px solid #c44a4a;
  padding-left: 10px;
}

/* Meta row: 一列にまとめる */
.task-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
}
.task-req {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}

/* Date chip: ニュートラル基調 */
.date-chip {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0;
  font-size: 11px;
  border-radius: 0;
  margin-right: 0;
}
.date-chip.date-today   { color: #8a6a00; font-weight: 600; }
.date-chip.date-soon    { color: #a0501e; font-weight: 600; }
.date-chip.date-overdue { color: #a83333; font-weight: 600; }
.date-chip.date-week    { color: var(--text-secondary); }
.date-chip.date-future  { color: var(--text-secondary); }
.date-abs {
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}

/* Progress bar: 細く */
.task-progress {
  margin-top: 8px;
  height: 3px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}
.task-progress-bar {
  height: 100%;
  background: #2b5c8a;
}
.task-progress-label { display: none; }

/* Project chip: 淡めに統一 */
.task-project-chip {
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
}
.task-project-chip .project-dot {
  width: 6px; height: 6px;
}

/* --- Empty states --- */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  background: transparent;
}
.kanban-empty {
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: center;
  padding: 8px;
  opacity: 0.5;
}

/* --- Calendar: 余白を増やし軽く --- */
.cal-cell { min-height: 80px; padding: 6px 8px; }
.cal-dow { padding: 6px 10px; font-weight: 500; letter-spacing: 0.04em; }
.cal-day { font-weight: 500; font-size: 11px; }
.cal-task {
  font-size: 11px;
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-left: 2px solid;
  border-radius: 2px;
  padding: 1px 6px;
}
.cal-task.cal-high { border-left-color: #c44a4a; }
.cal-task.cal-mid  { border-left-color: #d48a1c; }
.cal-task.cal-low  { border-left-color: #9aa3b2; }
.cal-task.cal-done { border-left-color: #3d8a4a; color: var(--text-tertiary) !important; text-decoration: line-through; }

/* --- Gantt: 背景フラット、罫線薄く --- */
.gantt-container { border: 1px solid var(--border-light); }
.gantt-header { background: var(--bg-secondary); height: 32px; }
.gantt-name-col { padding: 0 12px; font-size: 11px; }
.gantt-body .gantt-name-col { font-size: 12px; font-weight: 500; }
.gantt-row { height: 32px; }
.gantt-bar { border-radius: 3px; top: 5px; bottom: 5px; }
.gantt-legend { padding: 8px 12px; font-size: 11px; gap: 12px; }

/* --- Modal header: より軽く --- */
.modal { padding: 24px; }
.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- Forms: より統一的 --- */
.form-group label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}
.form-group input,
.form-group select,
.form-group textarea {
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  padding: 7px 10px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 0;
  border-color: #2b5c8a;
}

/* --- Segmented toggle: 軽く --- */
.seg-toggle { border-radius: 6px; }
.seg-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
}
.seg-btn.active { background: #2b5c8a; }

/* --- Report view --- */
.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-num {
  font-size: 24px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.01em;
}
.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.stat-meta { grid-column: 1 / -1; padding: 0; }
.live-badge { font-size: 10px; font-weight: 500; }

/* --- List view --- */
.task-table th {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}
.task-table td {
  font-size: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
}

/* --- Project active state --- */
.project-row.project-active {
  background: rgba(43, 92, 138, 0.08);
}
.project-row.project-active .project-btn { color: #2b5c8a; font-weight: 600; }
.project-dot-empty {
  background: transparent;
  border: 1px solid var(--border-medium);
  box-sizing: border-box;
}

/* ================================================================
   RESPONSIVE — 半分幅・タブレット・モバイル対応
   ================================================================ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 50;
  width: 36px; height: 36px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-primary);
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 40;
  animation: fadeIn 150ms ease-out;
}
.sidebar-backdrop.sidebar-open { display: block; }

/* 中間幅（1000〜1200px 程度）: カンバンを詰める */
@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 8px;
  }
  #mainContent { padding: 20px 20px; }
}

/* タブレット相当 (〜900px): カンバンは横スクロール */
@media (max-width: 900px) {
  .kanban-board {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
  }
  .kanban-col {
    flex: 0 0 260px;
  }
  #mainContent { padding: 18px 16px; }
  .view-title { font-size: 17px; }
}

/* 半分幅〜モバイル (〜768px): サイドバーをドロワー化 */
@media (max-width: 768px) {
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  #app { position: relative; }
  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 45;
    width: 260px;
    min-width: 260px;
    border-right: 1px solid var(--border-light);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.02);
  }
  #sidebar.sidebar-open { transform: translateX(0); }
  #mainContent {
    padding: 56px 16px 24px;
    width: 100%;
  }
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .view-title { font-size: 17px; }

  /* Gantt は横スクロール（既に対応済みだが固定幅を緩く） */
  .gantt-container { border-radius: 6px; }
  .report-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 12px; }
  .stat-num { font-size: 20px; }

  /* モーダル: 画面いっぱい */
  .modal { width: calc(100vw - 24px); max-width: 520px; padding: 20px; }
  .modal.modal-sm { width: calc(100vw - 24px); }
  .form-row { display: block; }
  .form-row > .form-group { margin-bottom: 8px; }

  /* カレンダー: 最小セル高さを下げる */
  .cal-cell { min-height: 60px; }
  .cal-task { font-size: 10px; padding: 1px 4px; }

  /* カンバン: 列を少し狭く */
  .kanban-col { flex: 0 0 240px; }

  /* タスクテーブル: スクロール */
  .list-content { overflow-x: auto; }
}

/* スマホ小画面 (〜480px) */
@media (max-width: 480px) {
  .kanban-col { flex: 0 0 85vw; }
  .cal-cell { min-height: 48px; padding: 4px 5px; }
  .cal-day { font-size: 10px; }
  .cal-task { display: none; }
  .cal-cell.has-tasks::after {
    content: "";
    display: block;
    width: 4px; height: 4px;
    background: #2b5c8a;
    border-radius: 50%;
    margin: 2px auto 0;
  }
  .report-stats { grid-template-columns: 1fr; }
  .view-title { font-size: 16px; }
  .btn-primary { padding: 6px 10px; font-size: 11px; }
  .modal { padding: 16px; }
  .seg-toggle { width: 100%; }
  .seg-btn { flex: 1; }
}

/* タッチ操作 (hover を無効化) */
@media (hover: none) and (pointer: coarse) {
  .task-card:hover { border-color: var(--border-light); transform: none; }
  .project-edit { opacity: 1; } /* ホバーで出す仕組みをタッチで常時表示 */
  .project-add-btn:hover { background: transparent; }
}

/* Modal enter animation enhancement */
.modal-overlay.open .modal {
  animation: modalSlideUp 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Task Card (v2) --- */
.task-card {
  background: #ffffff;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 180ms ease-out;
}
.task-card:hover { border-color: #2b5c8a; }

.task-head {
  display: flex; align-items: center; gap: 8px;
  justify-content: space-between;
}
.task-avatar {
  flex-shrink: 0; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 500;
  line-height: 1; font-family: inherit;
}
.task-name {
  font-size: 13px; font-weight: 500; line-height: 1.4;
  color: var(--text-primary, #0f1115);
  flex: 1; min-width: 0;
}
.task-owner {
  margin-top: 4px; font-size: 11px;
  color: var(--text-secondary, #5a6270);
  padding-left: 30px;
}
.task-score {
  flex-shrink: 0; font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  padding: 2px 6px; border-radius: 4px;
}
.task-score.score-high { background: #fdf0f0; color: #c44a4a; }
.task-score.score-mid { background: #faf4e4; color: #d48a1c; }
.task-score.score-low { background: var(--bg-tertiary, #f0f2f5); color: var(--text-secondary, #5a6270); }

.task-meta {
  margin-top: 6px; font-size: 11px;
  color: var(--text-secondary, #5a6270);
}
.task-meta .mono { font-family: "JetBrains Mono", monospace; }

.task-progress {
  margin-top: 8px; height: 4px;
  background: var(--bg-tertiary, #f0f2f5);
  border-radius: 2px; overflow: hidden;
}
.task-progress-bar { height: 100%; background: #2b5c8a; transition: width 200ms ease-out; }
.task-progress-label {
  margin-top: 3px; font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-secondary, #5a6270);
}

/* --- List (v2) --- */
.task-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 8px; overflow: hidden;
  margin: 0 24px 24px; width: calc(100% - 48px);
}
.task-table thead { background: var(--bg-secondary, #fafbfc); }
.task-table th {
  text-align: left; padding: 12px 14px;
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  color: var(--text-secondary, #5a6270); letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
}
.task-table td {
  padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
}
.task-table tbody tr { cursor: pointer; transition: background 180ms ease-out; }
.task-table tbody tr:hover { background: var(--bg-secondary, #fafbfc); }
.task-name-cell { font-weight: 500; }
.mono { font-family: "JetBrains Mono", monospace; font-size: 12px; }

.status-chip {
  display: inline-block; padding: 2px 8px;
  font-size: 11px; border-radius: 4px; font-weight: 500;
}
.status-todo { background: #eef0f3; color: #5a6270; }
.status-doing { background: #e9f1f8; color: #2b5c8a; }
.status-review { background: #faf4e4; color: #8a7013; }
.status-done { background: #ecf4ee; color: #3d8a4a; }
.status-hold { background: #fdf0f0; color: #c44a4a; }

/* --- Modal footer --- */
.modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border-light, #e3e7ec);
  background: var(--bg-secondary, #fafbfc);
}
.modal-footer-right { display: flex; gap: 8px; }
.modal-readonly-note { font-size: 11px; color: var(--text-secondary, #5a6270); flex: 1; padding: 0 12px; }
.btn-secondary {
  height: 38px; padding: 0 16px; background: #ffffff;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 6px;
  font-size: 13px; font-family: inherit; cursor: pointer;
  transition: background 180ms ease-out;
}
.btn-secondary:hover { background: var(--bg-secondary, #fafbfc); }
.btn-danger-outline {
  height: 38px; padding: 0 16px; background: #ffffff;
  border: 1px solid #f5d0d0; border-radius: 6px;
  color: #c44a4a; font-size: 13px;
  font-family: inherit; cursor: pointer;
  transition: background 180ms ease-out;
}
.btn-danger-outline:hover { background: #fdf0f0; }

/* --- Project Members --- */
.members-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.members-count {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: var(--bg-secondary, #fafbfc);
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 999px; font-size: 11px; color: var(--text-secondary, #6b7280);
  font-weight: 500;
}
.members-help {
  margin: 0; font-size: 11px; line-height: 1.5;
  color: var(--text-secondary, #6b7280);
}
.members-list {
  list-style: none; margin: 0 0 8px; padding: 0;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 6px;
  background: #ffffff; max-height: 200px; overflow-y: auto;
}
.members-list:empty { display: none; }
.members-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
}
.members-list li:last-child { border-bottom: none; }
.member-name { flex: 1; font-size: 13px; color: var(--text-primary, #1f2937); }
.member-meta { font-size: 11px; color: var(--text-secondary, #6b7280); }
.member-role-owner {
  padding: 2px 8px; background: #fff8e1; border: 1px solid #f3e0a0;
  border-radius: 999px; font-size: 10px; color: #8a6d00; font-weight: 600;
}
.member-remove {
  width: 24px; height: 24px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  font-size: 14px; color: var(--text-secondary, #6b7280); cursor: pointer;
  transition: all 180ms ease-out;
}
.member-remove:hover { background: #fdf0f0; border-color: #f5d0d0; color: #c44a4a; }
.members-add { display: flex; gap: 8px; align-items: center; }
.members-select {
  flex: 1; height: 36px; padding: 0 10px;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 6px;
  background: #ffffff; font-family: inherit; font-size: 13px;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 12px; }

/* --- 招待リスト（プロジェクト新規作成時） --- */
.invite-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 6px;
  background: #ffffff; max-height: 240px; overflow-y: auto;
}
.invite-list .invite-empty { padding: 12px; color: var(--text-secondary, #6b7280); font-size: 12px; text-align: center; }
.invite-row { border-bottom: 1px solid var(--border-light, #e3e7ec); }
.invite-row:last-child { border-bottom: none; }
.invite-label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 44px; }
.invite-label:hover { background: var(--bg-tertiary, #f6f7f9); }
.invite-row:has(input:checked) { background: rgba(43, 92, 138, 0.06); }
.invite-row:has(input:checked) .invite-name { font-weight: 500; }
.invite-check { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.invite-avatar {
  flex-shrink: 0; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 500;
}
.invite-name { flex: 1; font-size: 13px; color: var(--text-primary, #1f2937); }

/* サイドバーセクション見出し */
.project-section-title {
  margin: 12px 12px 4px; font-size: 11px; letter-spacing: 0.04em;
  color: var(--text-secondary, #6b7280); font-weight: 600;
  text-transform: uppercase;
}
.project-section-title:first-child { margin-top: 4px; }

/* --- Report --- */
.month-select {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 6px;
  font-size: 13px; font-family: "JetBrains Mono", monospace;
  background: #ffffff;
}
.report-content { padding: 0 24px 24px; }
.report-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.stat {
  background: #ffffff;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 10px; padding: 18px 20px;
}
.stat-num {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 36px; font-weight: 900;
  color: var(--text-primary, #0f1115);
  letter-spacing: -0.02em; line-height: 1.1;
}
.stat-label {
  font-size: 12px; color: var(--text-secondary, #5a6270);
  margin-top: 6px; letter-spacing: 0.03em;
}
.stat-done { border-left: 3px solid #3d8a4a; }
.stat-doing { border-left: 3px solid #2b5c8a; }
.stat-notdone { border-left: 3px solid #c44a4a; }

.report-section {
  background: #ffffff;
  border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 10px; padding: 18px 22px;
  margin-bottom: 16px;
}
.report-section h3 {
  font-size: 14px; font-weight: 600;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.report-count {
  font-size: 11px; font-family: "JetBrains Mono", monospace;
  color: var(--text-secondary, #5a6270); font-weight: 400;
}
.report-section ul { list-style: none; padding: 0; margin: 0; }
.report-section li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light, #e3e7ec);
  font-size: 13px;
}
.report-section li:last-child { border-bottom: none; }
.report-name { flex: 1; }
.report-progress {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--text-secondary, #5a6270);
}
.report-due {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--text-secondary, #5a6270);
}

.empty {
  padding: 60px 20px; text-align: center;
  color: var(--text-secondary, #5a6270); font-size: 13px;
}
.loading { padding: 40px 20px; text-align: center; color: var(--text-secondary, #5a6270); font-size: 13px; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f1115; color: #ffffff;
  padding: 12px 20px; border-radius: 8px;
  font-size: 13px; opacity: 0;
  transition: all 240ms ease-out;
  pointer-events: none; z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-err { background: #c44a4a; }

/* --- History --- */
.history-search {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 6px;
  font-size: 13px; background: #ffffff; min-width: 240px;
}
.history-search:focus { outline: none; border-color: #2b5c8a; }
.history-content { padding: 0 24px 24px; }
.history-meta {
  font-size: 12px; color: #6b7280; margin-bottom: 16px;
  font-family: "JetBrains Mono", monospace;
}
.history-day { margin-bottom: 24px; }
.history-day-head {
  font-size: 12px; color: #6b7280; margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace; letter-spacing: 0.04em;
}
.history-day-count { color: #aab1bb; margin-left: 6px; }
.history-list {
  list-style: none; padding: 0; margin: 0;
  background: #ffffff; border: 1px solid var(--border-light, #e3e7ec);
  border-radius: 10px; overflow: hidden;
}
.history-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
  transition: background 120ms ease-out;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: #f7f8fa; }
.history-item-main { flex: 1; min-width: 0; }
.history-item-name { font-size: 14px; font-weight: 500; }
.history-item-memo {
  font-size: 12px; color: #6b7280; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item-project {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  font-weight: 500; white-space: nowrap;
}
.history-item-hours {
  font-size: 12px; color: #6b7280; white-space: nowrap;
}

/* --- Subtasks --- */
.subtasks-label {
  display: flex; align-items: center; gap: 8px;
}
.subtask-count-chip {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  background: #f1f3f5; color: #4b5563;
  font-size: 11px; font-weight: 600; border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
}
.subtask-list {
  list-style: none; margin: 0 0 8px; padding: 0;
  border: 1px solid var(--border-light, #e3e7ec); border-radius: 8px;
  background: #ffffff; overflow: hidden;
  max-height: 300px; overflow-y: auto;
}
.subtask-empty {
  padding: 16px; color: #9aa3b2; font-size: 12px;
  text-align: center; background: #fafbfc;
}
.subtask-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
  transition: background 120ms ease-out;
}
.subtask-item:last-child { border-bottom: none; }
.subtask-item:hover { background: #f7f8fa; }
.subtask-depth-1 { padding-left: 12px; }
.subtask-depth-2 {
  padding-left: 36px; background: #fafbfc;
  font-size: 12.5px;
}
.subtask-depth-2::before {
  content: "↳"; color: #9aa3b2;
  position: absolute; margin-left: -16px;
}
.subtask-depth-2 { position: relative; }
.subtask-check {
  width: 16px; height: 16px; flex-shrink: 0;
  cursor: pointer; accent-color: #2b5c8a;
}
.subtask-check:disabled { cursor: not-allowed; }
.subtask-name {
  flex: 1; min-width: 0; font-size: 13px;
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.subtask-name:hover { color: #2b5c8a; text-decoration: underline; }
.subtask-done .subtask-name {
  color: #9aa3b2; text-decoration: line-through;
}
.subtask-owner {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #e3e7ec; color: #4b5563;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.subtask-add-grand,
.subtask-delete {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: #9aa3b2; font-size: 14px; line-height: 1;
  cursor: pointer; border-radius: 4px;
  transition: all 120ms ease-out;
  flex-shrink: 0;
}
.subtask-add-grand:hover {
  background: #e8f1fb; border-color: #b8d4ee; color: #2b5c8a;
}
.subtask-delete:hover {
  background: #fdf0f0; border-color: #f4cccc; color: #c44a4a;
}
.subtask-delete:disabled,
.subtask-check:disabled { opacity: 0.4; cursor: not-allowed; }
.subtask-input-row {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light, #e3e7ec);
  background: #f0f7ff;
}
.subtask-input-row.subtask-depth-2 { padding-left: 36px; }
.subtask-input-field {
  flex: 1; height: 30px; padding: 0 10px;
  font-size: 13px; border: 1px solid #b8d4ee;
  border-radius: 5px; background: #ffffff;
}
.subtask-input-field:focus { outline: none; border-color: #2b5c8a; }
.subtask-input-save {
  height: 30px; padding: 0 12px;
  background: #2b5c8a; color: #ffffff;
  border: none; border-radius: 5px;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.subtask-input-save:hover { background: #1f4a72; }
.subtask-input-cancel {
  width: 28px; height: 30px;
  background: transparent; border: 1px solid #d1d5db;
  border-radius: 5px; color: #6b7280;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.subtask-input-cancel:hover { background: #f3f4f6; }
.btn-add-subtask {
  width: 100%; height: 36px;
  background: #ffffff; border: 1px dashed #b8d4ee;
  color: #2b5c8a; font-size: 12.5px; font-weight: 500;
  border-radius: 6px; cursor: pointer;
  transition: all 120ms ease-out;
}
.btn-add-subtask:hover {
  background: #f0f7ff; border-color: #2b5c8a; border-style: solid;
}

/* カンバンカードのサブタスクバッジ */
.task-subtask-chip {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 2px 8px;
  background: #f1f3f5; color: #4b5563;
  font-size: 11px; font-weight: 500;
  border-radius: 10px; width: fit-content;
  font-family: "JetBrains Mono", monospace;
}
.task-subtask-chip svg { color: #6b7280; }
