/* Commitments page — kanban в refero light */

/* .toolbar = flat secondary bar, наследуется из app.css */

/* Native select hidden — replaced by .dd component */
.dd-native { display: none !important; }

/* Custom dropdown */
.dd { position: relative; display: inline-flex; }
.modal-body .dd { display: flex; width: 100%; }
.modal-body .dd-btn { width: 100%; justify-content: space-between; border-radius: var(--r-input); padding: 8px 12px; font-size: .9rem; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px 7px 14px;
  font-family: var(--ff-sans);
  font-size: .8rem;
  cursor: pointer;
  border-radius: var(--r-pill);
  transition: border-color .12s, background-color .12s;
  line-height: 1;
  white-space: nowrap;
}
.dd-btn:hover { border-color: var(--muted-2); }
.dd-btn.open { border-color: var(--text); background: var(--surface); }
.dd-chev {
  color: var(--muted); font-size: .65rem;
  transition: transform .12s;
}
.dd-btn.open .dd-chev { transform: rotate(180deg); color: var(--text); }

.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-width: 280px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 6px 24px rgba(10,10,10,.08);
  z-index: 50;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dd-menu[hidden] { display: none; }
.dd-opt {
  background: transparent;
  border: none;
  text-align: left;
  font-family: var(--ff-sans);
  font-size: .82rem;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s, color .1s;
}
.dd-opt:hover { background: var(--surface-2); }
.dd-opt.selected {
  background: var(--text-strong);
  color: var(--bg);
}
.dd-opt.selected:hover { background: var(--text); }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--ff-sans);
  font-size: .8rem;
  cursor: pointer;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  transition: color .12s, background .12s;
  user-select: none;
}
.checkbox-label:hover { color: var(--text); background: var(--surface-2); }
.checkbox-label input { cursor: pointer; accent-color: var(--text-strong); }
.checkbox-label:has(input:checked) {
  background: var(--surface-2); color: var(--text);
}

.hint {
  margin-left: auto;
  align-self: center;
  color: var(--muted-2);
  font-family: var(--ff-mono);
  font-size: .72rem;
  padding-right: var(--sp-2);
}

/* Board layout: flex + h-scroll; widths fixed so dropped column doesn't shrink others */
.board {
  display: flex;
  gap: var(--sp-3);
  min-height: 60vh;
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-color: var(--muted-2) transparent;
  scrollbar-width: thin;
}
.column {
  flex: 0 0 calc((100% - 3 * var(--sp-3)) / 4);
  min-width: 240px;
}
@media (max-width: 1100px) {
  .column { flex: 0 0 calc((100% - var(--sp-3)) / 2); min-width: 260px; }
}
@media (max-width: 640px) {
  .column { flex: 0 0 calc(100% - 8px); min-width: 0; }
}

.column {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  display: flex;
  flex-direction: column;
  min-height: 220px;
  overflow: hidden;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-family: var(--ff-mono);
  font-size: .78rem;
  letter-spacing: -.01em;
  color: var(--text);
  background: var(--surface);
}
.column-header .count {
  font-size: .7rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-family: var(--ff-mono);
}

.column-body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-3) var(--sp-4);
  cursor: grab;
  transition: border-color .12s, background .12s;
  font-size: .9rem;
  line-height: 1.45;
}
.card:hover { border-color: var(--muted-2); }
.card.dragging { opacity: .4; }
.card-text {
  color: var(--text);
  margin-bottom: var(--sp-2);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-family: var(--ff-mono);
  font-size: .72rem;
  color: var(--muted);
}

.badge-context {
  padding: 2px 10px;
  color: #fff;
  border-radius: var(--r-badge);
  font-family: var(--ff-sans);
  font-size: .72rem;
  font-weight: 500;
}

.owner-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: var(--r-badge);
  color: var(--text);
  font-family: var(--ff-sans);
}

.deadline {
  color: var(--muted);
}
.deadline.overdue { color: var(--negative); }

.src-icon {
  margin-left: auto;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-badge);
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Modal */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, .45);
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-bg.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  width: 90%; max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-family: var(--ff-mono);
  font-size: .85rem;
  letter-spacing: -.01em;
  color: var(--text);
}
.modal-close {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: var(--r-pill);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }

.modal-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.modal-body textarea,
.modal-body input,
.modal-body select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  font-family: var(--ff-sans);
  font-size: .9rem;
  width: 100%;
  border-radius: var(--r-input);
}
.modal-body textarea { resize: vertical; }
.modal-body select { cursor: pointer; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  outline: none; border-color: var(--text);
}

.field-label {
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: -.01em;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.meta-block {
  font-family: var(--ff-mono);
  font-size: .72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
  line-height: 1.6;
}
.meta-block a { color: var(--text); text-decoration: underline; }

.modal-footer {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* Sortable placeholder */
.sortable-ghost {
  opacity: .4;
  background: var(--accent-dim);
  border-style: dashed !important;
}
