:root {
  --text: #1f2430;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --page: #f7f8fa;
  --accent: #2f6fed;
  --ok-bg: #e8f6ee;
  --ok-text: #11663a;
  --error-bg: #fdecec;
  --error-text: #9b1c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.page { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }

h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 24px 0 8px; }

a { color: var(--accent); }

code { font: 12.5px ui-monospace, Consolas, monospace; background: #eef0f4; padding: 1px 4px; border-radius: 4px; }

.hint { color: var(--muted); font-size: 13px; }

.notice { padding: 10px 12px; border-radius: 8px; background: #eef2ff; margin: 0 0 12px; }
.notice-ok { background: var(--ok-bg); color: var(--ok-text); }
.notice-error { background: var(--error-bg); color: var(--error-text); }

.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.grid th, .grid td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.grid thead th { font-weight: 600; color: var(--muted); font-size: 12.5px; }
.grid tr:last-child td, .grid tr:last-child th { border-bottom: 0; }

.button {
  display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-decoration: none;
}
.button:hover { border-color: #c5cad3; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-row input, .form-row select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 180px; }

.logout { margin-top: 32px; }

/* --- Доска ---------------------------------------------------------------- */

.page-wide { max-width: none; padding: 14px 16px 24px; }

.input {
  font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); min-width: 0;
}
input.input[type="search"] { width: 200px; }
select.input { max-width: 200px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.toolbar .counter { margin-left: auto; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segment { font: inherit; padding: 6px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.segment-active { background: var(--accent); color: #fff; }

.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 12px; }
.project-item {
  font: inherit; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.project-item:hover { border-color: var(--accent); }

.kanban { display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.column {
  flex: 1 0 230px; max-width: 340px; background: #eef0f4; border-radius: 10px; padding: 8px;
  border: 2px solid transparent;
}
.column-over { border-color: var(--accent); background: #e4ecff; }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.column-title { font-weight: 600; font-size: 13px; }
.column-count { font-size: 12px; color: var(--muted); background: var(--surface); border-radius: 10px; padding: 0 7px; }
.column-body { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.column-empty { margin: 0; padding: 10px 4px; font-size: 12.5px; color: var(--muted); text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.card[draggable="true"] { cursor: grab; }
.card-dragging { opacity: 0.45; }
.card-pending { opacity: 0.6; }
.card-title { color: var(--text); text-decoration: none; font-size: 13.5px; line-height: 1.35; word-break: break-word; }
.card-title:hover { color: var(--accent); text-decoration: underline; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.card-link { font-size: 12px; }

.chip { font-size: 12px; line-height: 1.5; padding: 0 7px; border-radius: 10px; background: #eef0f4; color: #475467; }
.chip-file-yes { background: var(--ok-bg); color: var(--ok-text); font-weight: 600; }
.chip-file-yes::before { content: "✓ "; }
.chip-file-no { background: transparent; color: #b54708; border: 1px dashed #f0b27a; }
.chip-file-unknown { background: transparent; color: var(--muted); border: 1px dotted var(--line); }
.chip-status { background: #e4ecff; color: #1d4ed8; white-space: nowrap; }

.move { font: inherit; font-size: 12px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--muted); max-width: 100%; }

.table-wrap { overflow-x: auto; }
.board-table td { font-size: 13px; word-break: normal; overflow-wrap: break-word; }
.board-table td:first-child { min-width: 240px; }
.status-wrap { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; white-space: nowrap; }
.row-pending { opacity: 0.6; }
.sort { font: inherit; font-weight: 600; font-size: 12.5px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.sort-active { color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: min(560px, 92vw);
  padding: 9px 14px; border-radius: 8px; background: #1f2430; color: #fff; font-size: 13px; z-index: 10;
}
.toast-error { background: #9b1c1c; }
.toast[hidden] { display: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.head-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.head-row h1 { margin: 0; }

/* Узкая боковая панель портала (пункт меню): компактная раскладка без горизонтальной прокрутки страницы. */
@media (max-width: 720px) {
  .page-wide { padding: 10px 10px 16px; }
  h1 { font-size: 17px; }
  .toolbar { gap: 6px; }
  .toolbar > * { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .toolbar input.input[type="search"], .toolbar .check, .toolbar .counter { flex-basis: 100%; width: auto; }
  .toolbar select.input { max-width: none; }
  .toolbar .counter { margin-left: 0; }
  .segmented { justify-content: stretch; }
  .segment { flex: 1 1 auto; padding: 6px 8px; }
  .column { flex: 0 0 240px; }
  .project-list { grid-template-columns: 1fr; }
}
