:root {
  --bg: #0f1115;
  --surface: #171a21;
  --border: #262b35;
  --text: #e6e8eb;
  --text-dim: #9aa1ac;
  --accent: #4f8cff;
  --danger: #e5544d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
}

header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

/* у логотипа чёрная подложка — растворяем её на тёмном фоне */
header .brand img { mix-blend-mode: screen; }

header nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-right: 16px;
}

header nav a:hover { color: var(--text); }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px;
}

h1 { margin-top: 0; }

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

th { color: var(--text-dim); font-weight: 500; font-size: 13px; text-transform: uppercase; }

tbody tr { cursor: pointer; }
tbody tr:hover { background: #1d212b; }
tbody tr:last-child td { border-bottom: none; }

td.nowrap { white-space: nowrap; }

/* главная колонка списков встреч */
td.td-title { width: 100%; }
td.td-title .title { font-weight: 500; }
td.td-title .untitled { color: var(--text-dim); font-style: italic; }
td.td-title .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

th.td-id, td.td-id {
  color: var(--text-dim);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* статус встречи */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-created { background: #262b35; color: var(--text-dim); }
.badge-held { background: rgba(79, 140, 255, 0.18); color: #8ab4ff; }
.badge-transcribed { background: rgba(62, 190, 120, 0.18); color: #5fd48f; }

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  margin-bottom: 24px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-dim);
}

input[type="text"], select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

textarea { width: 100%; resize: vertical; }

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  width: fit-content;
}

button:hover, .btn:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); }

.btn-link {
  background: none;
  color: var(--text-dim);
  padding: 0;
  font-size: 13px;
  text-decoration: underline;
}
.btn-link:hover { color: var(--text); opacity: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.card pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  color: var(--text);
}

.meta {
  color: var(--text-dim);
  font-size: 13px;
}

/* ————— задачи, цели, канбан ————— */

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

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); opacity: 1; }

/* панель фильтров */
.filters {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: none;
  margin-bottom: 16px;
}
.filters select { min-width: 150px; }

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* формы задач/целей — шире стандартных 480px */
.form-wide { max-width: 720px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > label { flex: 1 1 200px; }

.inline { display: inline; margin: 0; }
.inline-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: none;
}
.inline-form input[type="text"] { min-width: 260px; }
.push-right { margin-left: auto; }

input[type="number"], input[type="date"], input[type="datetime-local"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

tr.no-hover { cursor: default; }
tr.no-hover:hover { background: transparent; }

.done { text-decoration: line-through; color: var(--text-dim); }
.overdue { color: var(--danger); }

/* важность задачи (1..3) */
.imp-1 { background: #262b35; color: var(--text-dim); }
.imp-2 { background: rgba(79, 140, 255, 0.18); color: #8ab4ff; }
.imp-3 { background: rgba(240, 160, 60, 0.18); color: #f0a03c; }

/* статусы целей */
.goal-active { background: rgba(79, 140, 255, 0.18); color: #8ab4ff; }
.goal-done { background: rgba(62, 190, 120, 0.18); color: #5fd48f; }
.goal-archived { background: #262b35; color: var(--text-dim); }

/* мелкие метки в строках и карточках */
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #1d212b;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}
.chip-goal { color: #c8b3ff; }
.chip.overdue { color: var(--danger); border-color: rgba(229, 84, 77, 0.4); }

/* чеклист */
.checklist { list-style: none; padding: 0; margin: 0 0 12px; max-width: 720px; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
}
.check {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: transparent;
  line-height: 1;
}
.check.checked { background: rgba(62, 190, 120, 0.2); border-color: #5fd48f; color: #5fd48f; }

/* канбан */
.board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
}
.board-column {
  flex: 0 0 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.board-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.board-dropzone { min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.board-dropzone.dragover { outline: 1px dashed var(--accent); outline-offset: 4px; border-radius: 6px; }

.board-card {
  background: #1d212b;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  cursor: grab;
}
.board-card:hover { border-color: var(--text-dim); }
.board-card.dragging { opacity: 0.4; }
.board-card.done .board-card-title { text-decoration: line-through; color: var(--text-dim); }
.board-card-title { font-size: 14px; margin-bottom: 8px; word-break: break-word; }
.board-card-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* доска шире основной колонки контента */
body:has(.board) main { max-width: 1440px; }
