:root {
  --bg: #0f1216;
  --panel: #141922;
  --muted: #a9b1c3;
  --text: #e8ebf2;
  --accent: #5b9cff;
  --border: #222836;

  /* дедлайн түстөрү */
  --ok72plus:  #c8f7c5;  /* > 72 дней — светло-зелёный */
  --warn72:    #a6f5a2;  /* ≤ 72 часов — зелёно-сигнальный (мягкий) */
  --warn48:    #ffd1b5;  /* ≤ 48 часов — персиковый */
  --warn24:    #ffb3b3;  /* ≤ 24 часов — светло-красный */
  --overBlood: #8b0000;  /* просрочка — кроваво-красный */
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;              /* <-- центрируем содержимое */
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #141922, #121722);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
}


.app-header h1 {
  margin: 0;
  font-size: 20px;
}

#board {
  display: grid;
  gap: 14px;
  padding: 16px;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
}

.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}
.column.special {
  outline: 1px dashed #2d6a4f;
  outline-offset: -6px;
}

.column-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.column-header .left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.column-header h2 {
  margin: 0;
  font-size: 16px;
}
.count {
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover {
  border-color: #2b3244;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.column-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.column-body.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.task {
  background: #5e5e5f;
  border: 1px solid #1e2636;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s, box-shadow 0.2s;
}
/* .task.warn-3 {
  background: var(--warn3);
  color: #222;
}
.task.warn-2 {
  background: var(--warn2);
  color: #222;
}
.task.warn-1 {
  background: var(--warn1);
  color: #222;
}
.task.overdue {
  background: var(--over);
  color: #222;
  box-shadow: 0 0 0 2px #c73636 inset;
} */

/* Старая раскраска — удалить, чтобы не конфликтовала */
/* Новые классы */
.task.ok-72plus { background: var(--ok72plus); color: #1a1a1a; }
.task.warn-72   { background: var(--warn72);   color: #1a1a1a; }
.task.warn-48   { background: var(--warn48);   color: #1a1a1a; }
.task.warn-24   { background: var(--warn24);   color: #1a1a1a; }

/* Просрочка — заметная, читаемый текст */
.task.overdue {
  background: var(--overBlood);
  color: #fff;
  box-shadow: 0 0 0 2px #b22222 inset;
}

.task-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.task-title {
  margin: 0;
  outline: none;
  border-radius: 6px;
  padding: 2px 4px;
  min-height: 20px;
  word-break: break-word;
}
.task-title[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px #2c3752;
}

.icon-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 4px;
}

.icon-btn.delete svg {
  transition: transform 0.2s, color 0.2s; /* плавность */
}

.icon-btn.delete:hover svg {
  transform: scale(1.5);       /* увеличить на 20% */
}

.task-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* date и time занимают столько, сколько нужно */
.task-row input[type="date"],
.task-row input[type="time"] {
  background: #0f141f;
  border: 1px solid #27314a;
  color: var(--text);
  padding: 2px;
  border-radius: 8px;

  /* ключевые строки: */
  width: auto;
  inline-size: auto;
  min-width: 0;
}

.task-row input[type="date"] {
  &::-webkit-calendar-picker-indicator {
    filter: invert(60%) sepia(80%) saturate(300%) hue-rotate(60deg);
    cursor: pointer;
  }
}

.task-row input[type="time"] {
  &::-webkit-calendar-picker-indicator {
    filter: invert(60%) sepia(80%) saturate(300%) hue-rotate(60deg);
    cursor: pointer;
  }
}

/* задаём разумные «естественные» ширины через ch */
.task-row input[type="date"] {
  width: 12ch;
  height: 23px;
}

/* 10 символов даты + небольшой зазор */
.task-row input[type="time"] {
  width: 7ch;
  height: 23px;
} /* HH:MM */

/* === Иконки в модальном окне создания/редактирования === */
#taskForm input[type="date"]::-webkit-calendar-picker-indicator,
#taskForm input[type="time"]::-webkit-calendar-picker-indicator {
  /* Поменяйте фильтр под нужный цвет */
  filter: invert(75%) sepia(60%) saturate(400%) hue-rotate(200deg);
  opacity: 1;
  cursor: pointer;
}

/* Наведение/фокус — чуть ярче (по желанию) */
#taskForm input[type="date"]:hover::-webkit-calendar-picker-indicator,
#taskForm input[type="time"]:hover::-webkit-calendar-picker-indicator,
#taskForm input[type="date"]:focus::-webkit-calendar-picker-indicator,
#taskForm input[type="time"]:focus::-webkit-calendar-picker-indicator {
  filter: invert(85%) sepia(70%) saturate(500%) hue-rotate(200deg);
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #252525;
}
.meta .live {
  font-variant-numeric: tabular-nums;
}

dialog#taskModal {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0f141a;
  color: var(--text);
  padding: 16px;
  max-width: 520px;
  width: 92%;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
#taskForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}
#taskForm input[type="text"],
#taskForm input[type="number"],
#taskForm input[type="date"],
#taskForm input[type="time"] {
  background: #0f141f;
  border: 1px solid #27314a;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
}
.inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #1e2636;
  border-radius: 10px;
  padding: 8px;
  margin: 10px 0;
}
.inline legend {
  padding: 0 6px;
  color: #c7d2fe;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.only-bos {
  display: none;
} /* виден только у bos-задач */


/* Скрыть иконки календаря и часов внутри карточек заданий */
.task-row input[type="date"]::-webkit-calendar-picker-indicator,
.task-row input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}


.icon-btn.delete svg {
  width: 25px;
  height: 25px;
  color: #666; /* серый по умолчанию */
}

.icon-btn.delete:hover svg {
  color: #c00; /* красный при наведении */
}


/* ==================== АДАПТИВ ==================== */

/* --- телефоны (до 768px) --- */
@media (max-width: 768px) {
  body {
    font-size: 13px;
  }

  .app-header h1 {
    font-size: 18px;
  }

  #board {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px;
  }

  .column {
    min-height: auto;
  }

  .column-header h2 {
    font-size: 15px;
  }

  .task {
    padding: 8px;
    gap: 6px;
  }

  .task-title {
    font-size: 14px;
  }

  .btn {
    padding: 5px 8px;
    font-size: 13px;
  }

  dialog#taskModal {
    width: 95%;
    padding: 12px;
  }

  #taskForm input[type="text"],
  #taskForm input[type="date"],
  #taskForm input[type="time"] {
    font-size: 13px;
    padding: 6px;
  }
}

/* --- планшеты / малые ноутбуки (769–1200px) --- */
@media (min-width: 769px) and (max-width: 1200px) {
  #board {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .column {
    min-height: 50vh;
  }

  .app-header h1 {
    font-size: 19px;
  }

  .task {
    padding: 9px;
  }

  .task-title {
    font-size: 15px;
  }

  .btn {
    font-size: 14px;
  }
}

/* --- большие экраны (1201px и выше) --- */
@media (min-width: 1201px) {
  #board {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
  }
}
