* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  background: #160d08 url('bg-heritage.svg') center center / cover no-repeat fixed;
  color: #f0e6da;
  margin: 0;
  padding: 24px;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

.app-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
}

.app-title-main {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #a78bfa, #60a5fa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-title-sub {
  font-size: 0.9rem;
  color: #888;
  letter-spacing: 0.02em;
}

h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
}

.dashboard {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-item {
  flex: 1;
  background: rgba(20, 12, 8, 0.55);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(244, 201, 120, 0.25);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.dashboard-label {
  display: block;
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 6px;
}

.dashboard-value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: #f4c978;
}

.columns {
  display: flex;
  gap: 20px;
}

.panel {
  flex: 1;
  position: relative;
  border: 1px solid rgba(244, 201, 120, 0.25);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  min-width: 0;
  background: rgba(15, 9, 6, 0.6);
  backdrop-filter: blur(3px);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form input,
.form textarea {
  padding: 8px;
  border: 1px solid rgba(244, 201, 120, 0.3);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  background: rgba(10, 6, 4, 0.6);
  color: #f0e6da;
}

.form input::placeholder,
.form textarea::placeholder {
  color: #a8998a;
}

.form button {
  align-self: flex-start;
  padding: 8px 16px;
  background: #c96a2f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.form button:hover {
  background: #a8551f;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
}

.item {
  border: 1px solid rgba(244, 201, 120, 0.18);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(10, 6, 4, 0.55);
  backdrop-filter: blur(2px);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.item-title {
  font-weight: bold;
  word-break: break-word;
}

.item-body {
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #bbb;
  font-size: 0.9rem;
}

.item-meta {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #888;
}

.item.done .item-title {
  text-decoration: line-through;
  color: #777;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* 緊急度・重要度フラグ */

.flag-checks {
  display: flex;
  gap: 14px;
}

.flag-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: #d8c9ba;
  cursor: pointer;
}

.flag-check input {
  accent-color: #c96a2f;
}

.item[class*="quadrant-"] {
  border-left: 4px solid transparent;
}

.item.quadrant-critical {
  border-left-color: #ef4444;
}

.item.quadrant-important {
  border-left-color: #f4c978;
}

.item.quadrant-urgent {
  border-left-color: #fb923c;
}

.item.quadrant-normal {
  border-left-color: rgba(244, 201, 120, 0.18);
}

.flag-badges {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.flag-badge {
  border: 1px solid rgba(244, 201, 120, 0.3);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  background: transparent;
  color: #a8998a;
  cursor: pointer;
}

.flag-badge.flag-urgent.active {
  background: #fb923c;
  border-color: #fb923c;
  color: #1a0f08;
  font-weight: bold;
}

.flag-badge.flag-important.active {
  background: #f4c978;
  border-color: #f4c978;
  color: #1a0f08;
  font-weight: bold;
}

/* 期限日 */

.due-date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #d8c9ba;
}

.due-date-field input[type="date"] {
  padding: 6px 8px;
  border: 1px solid rgba(244, 201, 120, 0.3);
  border-radius: 6px;
  background: rgba(10, 6, 4, 0.6);
  color: #f0e6da;
  font-family: inherit;
  color-scheme: dark;
}

.due-date-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #a8998a;
  border: 1px solid rgba(244, 201, 120, 0.3);
  border-radius: 999px;
  padding: 2px 10px;
}

.due-date-edit input[type="date"] {
  border: none;
  background: transparent;
  color: #f0e6da;
  font-family: inherit;
  font-size: 0.75rem;
  color-scheme: dark;
}

.due-date-edit.overdue {
  color: #ef4444;
  border-color: #ef4444;
}

.item-actions button {
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-complete {
  background: #22c55e;
  color: #fff;
}

.btn-undo {
  background: #eab308;
  color: #fff;
}

.btn-delete {
  background: #ef4444;
  color: #fff;
}

.empty {
  color: #777;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 0;
}

@media (max-width: 700px) {
  .columns {
    flex-direction: column;
  }
  .dashboard {
    flex-direction: column;
  }
}
