@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #6b7a8a;
  --border: #d7dde6;
  --brand: #3c50e0;
  --brand-soft: #ecf3ff;
  --warn: #d35400;
  --shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  --radius: 10px;
  --cal-gap: 6px;
  --cal-min-height: calc(100vh - 220px);
  --cal-day-header-height: 16px;
  --cal-band-top: 24px;
  --cal-band-height: 40px;
  --cal-grid-border: #e0e3eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.app-name {
  font-size: 16px;
}

.badge {
  font-size: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 999px;
}

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

.user {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 56px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f9fafb;
}

.nav-item {
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item.active {
  background: #e9f1ff;
  color: #1f5ca8;
  border-color: #c9d8f1;
  box-shadow: inset 0 0 0 1px rgba(31, 92, 168, 0.05);
}

.nav-item.active .nav-icon svg {
  stroke: #1f5ca8;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content {
  padding: 16px 20px 28px;
  position: relative;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.card-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.kpi-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #c9d8f1;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);
}

.kpi {
  font-size: 24px;
  font-weight: 700;
}

.kpi.warn {
  color: var(--warn);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.status-chart {
  display: grid;
  gap: 8px;
}

.status-item {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.status-label {
  color: var(--muted);
  font-weight: 600;
}

.status-bar {
  height: 10px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.status-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  opacity: 0.7;
}

.status-count {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.u-mt-10 {
  margin-top: 10px;
}

.u-ml-8 {
  margin-left: 8px;
}

.cal-max-bands-select {
  margin-left: 8px;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.history-toolbar {
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.history-search-input {
  flex: 1;
  min-width: 200px;
}

.archive-toolbar {
  margin-bottom: 12px;
}

.suggestion-list-container {
  margin-top: 12px;
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.new-suggestion-input {
  flex: 1;
}

.suggestion-master-binding {
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #dbe4f3;
  border-radius: 8px;
  background: #f8fbff;
}

.export-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.assignee-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.assignee-chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.assignee-chip:hover {
  border-color: #c9d8f1;
  background: #f4f8ff;
}

.assignee-chip.active {
  border-color: #c9d8f1;
  background: #e9f1ff;
  color: #1f5ca8;
  font-weight: 600;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.field-row input {
  flex: 1;
}

.btn-icon {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.search,
select,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  font-size: 14px;
}

input[readonly] {
  background-color: #f0f2f5 !important;
  color: var(--muted);
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
}

.seg-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.seg-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.calendar {
  background: #ffffff;
  border: 1px solid var(--cal-grid-border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 4px;
  min-height: var(--cal-min-height);
  position: relative;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(6, minmax(90px, 1fr));
  gap: var(--cal-gap);
  height: var(--cal-min-height);
  grid-auto-rows: minmax(90px, 1fr);
}

.calendar-grid-banded {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  column-gap: 0;
  row-gap: 0;
  border-left: 1px solid var(--cal-grid-border);
  border-top: 1px solid var(--cal-grid-border);
}

.month-week {
  display: grid;
  gap: 0;
  grid-column: 1 / -1;
  position: relative;
}

.month-week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  position: relative;
  z-index: 1;
}

.month-week-bands {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  column-gap: 0;
  row-gap: 4px;
  position: absolute;
  top: var(--cal-band-top);
  left: 4px;
  right: 4px;
  z-index: 2;
  pointer-events: none;
  grid-auto-rows: auto;
  align-content: start;
}

.month-week-bands .range-band {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto 12px;
  align-items: stretch;
  gap: 5px;
  padding: 4px 8px 5px 8px;
}

.month-week-bands .range-band .range-content-row {
  justify-content: flex-start;
  gap: 6px;
}

.month-week-bands .range-band .range-title {
  flex: 0 1 auto;
  max-width: 58%;
}

.month-week-bands .range-band .range-customer {
  flex: 0 1 auto;
  max-width: 36%;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.5);
  opacity: 0.95;
}

.month-week-bands .range-band .range-progress {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.16);
  overflow: visible;
}

.month-week-bands .range-band .range-progress .range-progress-label {
  display: inline-block;
  left: 6px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(29, 39, 51, 0.55);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.2;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.month-week-bands .range-band .range-meta-line {
  font-size: 11px;
  line-height: 1.2;
  color: rgba(29, 39, 51, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-header {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  text-align: center;
  padding: 8px 0;
  border-right: 1px solid var(--cal-grid-border);
  border-bottom: 1px solid var(--cal-grid-border);
  background: #ffffff;
}

.calendar-grid-banded .cal-header:nth-child(7) {
  border-right: none;
}

.cal-cell {
  min-height: 92px;
  border: none;
  border-right: 1px solid var(--cal-grid-border);
  border-bottom: 1px solid var(--cal-grid-border);
  border-radius: 0;
  padding: calc(var(--cal-day-header-height) + 8px) 8px 6px;
  display: grid;
  gap: 4px;
  background: #ffffff;
  cursor: pointer;
  position: relative;
}

.month-week-days .cal-cell:last-child {
  border-right: none;
}

.cal-cell.muted {
  background: #f9fafb;
  color: #94a3b8;
  opacity: 1;
}

.cal-cell.today {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(47, 116, 192, 0.28);
}

.cal-cell.today .cal-day {
  color: #1f5ca8;
  font-weight: 700;
}

.cal-day {
  font-size: 11px;
  font-weight: 600;
  color: #5f6368;
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 1;
  height: var(--cal-day-header-height);
  line-height: var(--cal-day-header-height);
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.range-item {
  font-size: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-item.with-progress {
  display: grid;
  gap: 2px;
}

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

.range-item.start {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.range-item.end {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.range-item.cont-left {
  margin-left: calc(var(--cal-gap) * -1);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.range-item.cont-right {
  margin-right: calc(var(--cal-gap) * -1);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.range-item.color-0 {
  background: #e7f2ff;
  color: #1f5ca8;
}

.range-item.color-1 {
  background: #e9f8ee;
  color: #1b7a3d;
}

.range-item.color-2 {
  background: #fff4e0;
  color: #a15a12;
}

.range-item.color-3 {
  background: #f4e8ff;
  color: #6a3bb2;
}

.range-item.color-4 {
  background: #ffe9ef;
  color: #a21d3c;
}

.range-item.color-5 {
  background: #e6f7f6;
  color: #0f6f6a;
}

.range-band.color-0 {
  background: #e8f0fe;
  color: #1967d2;
}

.range-band.color-1 {
  background: #e6f4ea;
  color: #137333;
}

.range-band.color-2 {
  background: #fef7e0;
  color: #b06000;
}

.range-band.color-3 {
  background: #f3e8fd;
  color: #9334e6;
}

.range-band.color-4 {
  background: #fde7e9;
  color: #d93025;
}

.range-band.color-5 {
  background: #e6f4f1;
  color: #0b8043;
}

.range-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.range-customer {
  font-size: 10px;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40%;
}

.range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(31, 92, 168, 0.15);
  overflow: hidden;
  position: relative;
}

.range-progress .range-progress-bar {
  display: block;
  height: 100%;
  background: currentColor;
  opacity: 0.8;
}

.range-progress .range-progress-label {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  color: rgba(20, 23, 28, 0.7);
  line-height: 1;
}

.range-item.dragging {
  opacity: 0.7;
  cursor: grabbing;
}

.calendar-ghost {
  opacity: 0.5 !important;
  border: 2px dashed var(--brand) !important;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.range-band {
  font-size: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 1px 6px 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 3px solid currentColor;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  pointer-events: auto;
}

.range-band.cont-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
  margin-left: -4px;
  padding-left: 8px;
}

.range-band.cont-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -4px;
}

/* 週表示（Week View）用の詳細スタイル */
.range-deadline {
  display: none;
  font-size: 10px;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-bands .range-band {
  display: flex !important;
  /* month viewのスタイルを上書き */
  flex-direction: column;
  justify-content: center;
  align-items: stretch !important;
  gap: 2px;
  padding: 2px 6px;
}

.range-content-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.week-bands .range-band .range-title {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
  /* 勝手に伸びないようにする */
}

/* 顧客名と納期は縮小可能に */
/* 顧客名と納期は縮小可能に */
.week-bands .range-band .range-customer {
  /* 詳細度アップ */
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block !important;
  max-width: none;
  /* 上書き */
}

.week-bands .range-band .range-deadline {
  /* 詳細度アップ */
  display: block;
  flex-shrink: 0;
  margin-left: 0;
  /* 左寄せ */
}

/* 左寄せ要望に合わせて margin-left: auto は削除し、そのまま並べる */
/* ただしタイトルと顧客名の間隔はgapで制御 */

.week-bands .range-deadline,
.week-bands .range-band .range-progress {
  display: block;
}

.week-bands .range-band .range-progress {
  display: block !important;
  height: 24px;
  min-height: 24px;
  flex-shrink: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  /* 背景色を追加 */
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  margin-top: 4px;
}

.week-bands .range-band .range-progress .range-progress-label {
  font-size: 12px;
}

.week-bands .range-band .range-row {
  /* 不要になったので削除、または無効化 */
  display: none;
}

.range-band .range-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.range-band .range-customer {
  font-size: 10px;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40%;
}

.range-meta-line {
  font-size: 10px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.range-band .range-progress {
  display: none;
}

.range-band .range-progress .range-progress-bar {
  display: block;
  height: 100%;
  background: currentColor;
  opacity: 0.8;
}

.drag-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
}

.drag-handle.start {
  left: 0;
}

.drag-handle.end {
  right: 0;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  min-height: var(--cal-min-height);
}

.calendar-week-banded {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  position: relative;
  border-left: 1px solid var(--cal-grid-border);
  border-top: 1px solid var(--cal-grid-border);
  background: #ffffff;
}

.week-bands {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  column-gap: 0;
  row-gap: 4px;
  position: absolute;
  top: var(--cal-band-top);
  left: 4px;
  right: 4px;
  z-index: 2;
  pointer-events: none;
  grid-auto-rows: var(--cal-band-height);
  align-content: start;
}

.more-events-btn {
  font-size: 11px;
  color: #1a73e8;
  padding: 2px 8px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  font-weight: 500;
  height: var(--cal-band-height);
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: background 0.15s;
}

.more-events-btn:hover {
  background: rgba(26, 115, 232, 0.08);
}

.calendar-week-banded .panel {
  margin: 0;
  border: none;
  border-right: 1px solid var(--cal-grid-border);
  border-bottom: 1px solid var(--cal-grid-border);
  border-radius: 0;
  box-shadow: none;
  padding: calc(var(--cal-day-header-height) + 8px) 8px 6px;
  background: #ffffff;
  position: relative;
  min-height: 140px;
}

.calendar-week-banded .panel:last-child {
  border-right: none;
}

.calendar-week-banded .panel.today {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(47, 116, 192, 0.28);
}

.calendar-week-banded .panel-title {
  margin-bottom: 0;
  font-size: 11px;
  color: #374151;
  font-weight: 600;
  position: absolute;
  top: 6px;
  left: 8px;
}

.calendar-day {
  display: grid;
  gap: 8px;
  min-height: var(--cal-min-height);
}

.prop-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
}

.prop-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px;
}

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

.calendar-day .panel-title {
  margin-bottom: 0;
}

.gantt {
  padding: 0;
  overflow: auto;
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-width: 980px;
}

.gantt-row {
  cursor: pointer;
}

.gantt-meta-head,
.gantt-meta {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.gantt-meta-head {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.gantt-meta .gantt-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-meta .gantt-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-timeline-head,
.gantt-timeline {
  display: grid;
  grid-template-columns: repeat(21, minmax(28px, 1fr));
  position: relative;
  border-bottom: 1px solid var(--border);
}

.gantt-day,
.gantt-cell {
  border-right: 1px solid #edf1f5;
}

.gantt-day {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 10px 0;
  font-weight: 600;
  background: #f9fafb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-day.is-today {
  background: #eaf3ff;
  color: #1f5ca8;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(47, 116, 192, 0.28);
}

.gantt-cell {
  min-height: 56px;
}

.gantt-cell.is-today {
  background: rgba(47, 116, 192, 0.08);
}

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  border-radius: 999px;
  background: #dfe7f3;
  overflow: hidden;
  display: block;
}

.gantt-bar-fill {
  display: block;
  height: 100%;
  background: var(--brand);
}

.gantt-bar-text {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.column {
  background: #fdfdff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 400px;
}

.column-header {
  font-weight: 600;
  background: var(--brand-soft);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column-header h3 {
  margin: 0;
  font-size: 14px;
}

.column-header.clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.column-header.clickable .count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.column-header.active {
  background: #dbe9fb;
  color: #1f5ca8;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 12px;
  min-height: 122px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
  display: grid;
  gap: 6px;
  position: relative;
}

.card.ghost {
  border: 2px dashed #c9d8f1;
  background: #f3f7ff;
  box-shadow: none;
  min-height: 56px;
}

.card.warn {
  border-color: #f3b4b4;
  background: #fffafa;
}

.warn-icon {
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.card .title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card .card-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.card .card-customer-chip {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #d7dde6;
  background: #f5f7fb;
  color: #344256;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-head-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.card .card-priority-icon {
  font-size: 12px;
  line-height: 1;
}

.card .card-body {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.card .card-due-label {
  font-size: 10px;
  color: #6b7a8a;
  font-weight: 600;
}

.card .card-due-value {
  font-size: 21px;
  font-weight: 700;
  color: #1d2733;
  line-height: 1.2;
}

.card .card-side {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.card .card-side-top {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.card .meta-assignee {
  font-size: 11px;
  color: #4b5563;
  white-space: nowrap;
}

.card .card-side-bottom {
  display: grid;
  gap: 2px;
  color: #5f6b7a;
  min-width: 0;
}

.card .card-side-line,
.card .card-side-machine {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-progress-text {
  font-size: 11px;
  color: #4b5563;
  font-weight: 700;
  white-space: nowrap;
}

.card .meta {
  font-size: 11px;
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.card .meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .meta.meta-triple {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.progress {
  height: 15px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
  margin-top: 2px;
  position: relative;
}

.progress .progress-bar {
  display: block;
  height: 100%;
  background: var(--brand);
}

.progress .progress-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  background: rgba(29, 39, 51, 0.45);
  padding: 1px 6px;
  border-radius: 999px;
}

.tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef1f5;
  color: #4b5563;
}

.tag.warn {
  background: #ffe2cc;
  color: var(--warn);
}

.detail-panel {
  position: fixed;
  top: 56px;
  right: 0;
  width: 360px;
  min-width: 320px;
  max-width: min(760px, calc(100vw - 120px));
  height: calc(100vh - 56px);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  z-index: 4;
}

.detail-panel.hidden {
  display: none;
}

.detail-panel.fullscreen {
  top: 0;
  right: 0;
  left: 0;
  width: auto !important;
  max-width: none;
  height: 100vh;
  border-left: none;
  z-index: 8;
}

.detail-panel.fullscreen .detail-resizer {
  display: none;
}

.detail-resizer {
  position: absolute;
  top: 0;
  left: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.detail-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 3px;
  width: 2px;
  height: 100%;
  background: transparent;
  transition: background-color 0.2s;
}

.detail-panel.resizing .detail-resizer::after,
.detail-resizer:hover::after {
  background: #c9d8f1;
}

body.resizing-detail {
  cursor: col-resize;
  user-select: none;
}

body.detail-fullscreen-mode {
  overflow: hidden;
}

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

.detail-header-actions {
  margin-left: auto;
}

.detail-title {
  font-weight: 600;
}

.detail-form {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.detail-actions {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: var(--panel);
  padding: 20px;
  border-radius: 14px;
  min-width: 320px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.logo {
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.app-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.app-logo.large {
  height: 48px;
  margin-bottom: 4px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost.danger {
  background: #fff5ed;
  color: var(--warn);
  border-color: #f3c9b2;
}

.ghost.tiny {
  padding: 4px 8px;
  font-size: 11px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.placeholder {
  background: #fdfdfd;
  border: 1px dashed var(--border);
  padding: 20px;
  border-radius: var(--radius);
  color: var(--muted);
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  background: #fdfdfd;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.list-item.history {
  display: grid;
  grid-template-columns: 160px 160px 1fr;
  gap: 10px;
  align-items: center;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
}

.media-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.media-table th,
.media-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.media-table th {
  font-size: 12px;
  color: var(--muted);
  background: #f9fafb;
}

.media-table td.num {
  text-align: right;
}

.media-table tr.clickable {
  cursor: pointer;
}

.media-table tr.clickable:hover {
  background: #f3f6fb;
}

.card.media-card {
  border-color: #cfe0f5;
  background: #f7fbff;
}

.card.media-card .progress span {
  background: #6a8fcf;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
}

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

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
  }

  .detail-panel {
    width: 100%;
    max-width: 100%;
  }

  .detail-resizer {
    display: none;
  }

  .list-item.history {
    grid-template-columns: 1fr;
  }
}

/* 案件一覧用テーブル */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--muted);
  position: sticky;
  top: 0;
}

.data-table tbody tr:hover {
  background: #f4f7fc;
}

/* サジェストタグ */
#suggestion-tags .tag-suggest {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#suggestion-tags .tag-suggest .close-icon:hover {
  color: var(--warn);
}

/* 入力促し用ハイライト */
@keyframes highlight-pulse {
  0% {
    background-color: #fff9c4;
    border-color: #fbc02d;
  }

  50% {
    background-color: #ffff00;
    border-color: #fbc02d;
    box-shadow: 0 0 10px rgba(251, 192, 45, 0.8);
  }

  100% {
    background-color: #fff9c4;
    border-color: #fbc02d;
  }
}

.highlight-input {
  animation: highlight-pulse 1.5s infinite;
  border-width: 2px !important;
  outline: none;
}

/* 警告バッジ & KPI */
.tag.tag-warn {
  background-color: #ff5252;
  color: white;
  border: none;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
}

.kpi.warn {
  color: #ff5252;
}

.hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 8px;
}

/* 日付調整ボタン */
.input-with-btns {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 100%;
}

.input-with-btns input {
  flex: 1;
  min-width: 0;
}

.date-adjust-btn {
  padding: 4px 8px;
  background-color: var(--ghost);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  height: 38px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-adjust-btn:hover {
  background-color: var(--border);
}
/* 日付調整ボタン */
.input-with-btns {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  width: 100%;
}

.input-with-btns input {
  flex: 1;
  min-width: 0;
}

.date-adjust-btn {
  width: 32px;
  height: 32px;
  background-color: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  color: #333;
}

.date-adjust-btn:hover {
  background-color: #eee;
  border-color: #999;
}

/* トースト通知 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background-color: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.3s;
  animation: toast-in 0.3s ease-out;
  border-left: 5px solid #2196f3;
}

.toast.warn {
  border-left-color: #ff5252;
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* TailAdmin-like theme overrides */
body {
  background:
    radial-gradient(1200px 320px at 90% -10%, rgba(60, 80, 224, 0.08), transparent 60%),
    var(--bg);
}

.topbar {
  height: 64px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.layout {
  min-height: calc(100vh - 64px);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 16px 10px;
}

.content {
  padding: 18px 20px 28px;
}

.card-box,
.panel,
.column,
.summary-item {
  border-color: #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}

.panel-title {
  font-weight: 700;
}

.nav-item {
  border-radius: 10px;
  color: #64748b;
  font-weight: 600;
}

.nav-item:hover {
  background: #f8fafc;
  color: #334155;
}

.nav-item.active {
  background: #eef3ff;
  color: #3c50e0;
  border-color: #d8e3ff;
  box-shadow: inset 0 0 0 1px rgba(60, 80, 224, 0.08);
}

.nav-item .nav-icon svg {
  stroke-width: 1.9;
}

.primary {
  background: linear-gradient(180deg, #4a63f0 0%, #3c50e0 100%);
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(60, 80, 224, 0.24);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(60, 80, 224, 0.28);
}

.ghost {
  border-color: #d7e0ea;
  background: #ffffff;
  color: #334155;
  border-radius: 10px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ghost:hover {
  border-color: #c2cddd;
  background: #f8fafc;
}

.search,
select,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"] {
  border-color: #d7e0ea;
  border-radius: 10px;
  color: #0f172a;
  background: #ffffff;
  min-height: 40px;
}

.search:focus,
select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus {
  border-color: #8aa2ff;
  outline: 2px solid rgba(60, 80, 224, 0.18);
  outline-offset: 0;
}

.kpi {
  color: #0f172a;
}

.kpi.warn {
  color: #ef4444;
}

.badge {
  background: #eef3ff;
  color: #3c50e0;
  font-weight: 700;
}

.user {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.table-wrap {
  border-radius: 12px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(60, 80, 224, 0.32);
  outline-offset: 1px;
}

@media (max-width: 980px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .layout {
    min-height: calc(100vh - 88px);
  }

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 12px;
    white-space: nowrap;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    scrollbar-width: thin;
  }

  .nav-item {
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: fit-content;
    padding: 10px 12px;
  }

  .content {
    padding: 14px 12px 20px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
