* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f3f6fb;
  color: #1f2937;
}

.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.panel {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 1.25rem;
  width: min(480px, 100%);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.07);
}

.error {
  color: #b91c1c;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #dbe3ef;
  background: #ffffff;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 1.3rem;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.92rem;
}

.board-stats {
  font-size: 0.85rem;
  color: #475569;
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  border: 1px solid #d6e0ec;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.5rem 0.55rem;
  min-width: 180px;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
  overflow-x: auto;
}

.sidepanel {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.panel-card {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.panel-card h3 {
  margin: 0 0 0.65rem;
}

.create-form label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
  color: #64748b;
}

.create-form input,
.create-form select {
  width: 100%;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #d6e0ec;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
}

.create-form input:focus,
.create-form select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.create-form .checkbox {
  margin: 0.2rem 0 0.45rem;
}

.create-form .btn-primary {
  margin-top: 0.15rem;
}

.activity-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.activity-list li {
  border: 1px solid #e5edf7;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}

.activity-id {
  color: #64748b;
  font-size: 0.82rem;
  margin-right: 0.35rem;
}

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

.activity-meta {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.column {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 0.75rem;
  min-height: 70vh;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.column h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.count {
  font-size: 0.82rem;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
}

.card {
  background: #ffffff;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  padding: 0.7rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.card.dragging {
  opacity: 0.5;
}

.column.drag-over {
  outline: 2px dashed #3b82f6;
  outline-offset: -6px;
  background: #f8fbff;
}

.card label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

.label-compact {
  letter-spacing: 0.01em;
}

.card input,
.card select,
button {
  width: 100%;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #d6e0ec;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
}

.card input:focus,
.card select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

button {
  cursor: pointer;
  border: 0;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.row-tight label {
  margin-bottom: 0.35rem;
}

.row label {
  flex: 1;
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.task-id {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

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

.task-name {
  margin: 0 0 0.45rem;
  font-size: 0.96rem;
  font-weight: 600;
  color: #0f172a;
}

.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: #64748b;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.btn-link {
  background: transparent;
  color: #2563eb;
  border: none;
  width: auto;
  padding: 0.2rem 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.editor {
  display: none;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5edf7;
}

.editor.is-open {
  display: block;
}

.save-indicator {
  min-height: 1rem;
  margin: 0.15rem 0 0.2rem;
  font-size: 0.78rem;
  color: #2563eb;
}

.checkbox {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  color: #334155;
  font-size: 0.85rem;
}

.checkbox input {
  width: auto;
}

.priority {
  font-size: 0.75rem;
  padding: 0.18rem 0.52rem;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid transparent;
}

.p1 {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.p2 {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.p3 {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.empty {
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1.5rem;
}

.btn-primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #ffffff;
  margin-top: 0.35rem;
}

.btn-secondary {
  background: #eef2f7;
  color: #1f2937;
  border: 1px solid #dbe3ef;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
}

.paginated-hidden {
  display: none !important;
}

.show-more {
  margin-top: 0.3rem;
}

.undo-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  display: none;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.28);
  z-index: 30;
}

.undo-toast .btn-link {
  color: #93c5fd;
}

.undo-toast.is-open {
  display: flex;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .toolbar {
    width: 100%;
  }
  .toolbar input,
  .toolbar select {
    min-width: 0;
    width: 100%;
  }
  .sidepanel {
    grid-template-columns: 1fr;
  }
  .meta-line,
  .card-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}
