/* /console/css/tasks.css */

.tasksPage{
  padding: 22px;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.card{
  background: var(--card);
  border: 1px solid rgba(229,231,235,.9);
  border-radius: var(--radius2);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.tasksHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.tasksSub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tasksHeader__right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}

.miniLabel{
  font-size: 11px;
  font-weight: 950;
  color: var(--muted);
  letter-spacing: .2px;
}

.versionSelect{
  appearance: none;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 12px;
  padding: 8px 34px 8px 12px;
  font-size: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.75));
  box-shadow: 0 8px 16px rgba(15,23,42,.06);
  cursor: pointer;
  position: relative;
}

/* subtle caret */
.versionSelect{
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.75)),
    linear-gradient(45deg, transparent 50%, rgba(71,85,105,.9) 50%),
    linear-gradient(135deg, rgba(71,85,105,.9) 50%, transparent 50%);
  background-position:
    0 0,
    calc(100% - 18px) 55%,
    calc(100% - 13px) 55%;
  background-size:
    auto,
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

.filters{
  display:grid;
  grid-template-columns: 1.6fr .7fr .8fr .7fr;
  gap: 12px;
  margin-bottom: 14px;
}

.field{ display:flex; flex-direction:column; gap:6px; }

.input, .select{
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  background: rgba(255,255,255,.92);
  outline: none;
}

.input:focus, .select:focus{
  border-color: rgba(11,92,255,.28);
  box-shadow: 0 0 0 4px rgba(11,92,255,.08);
}

/* ✅ textarea alignment */
textarea.input{
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
  padding: 10px 12px;
}

/* -----------------------------
   Task Add Card (custom task form)
   ----------------------------- */
#taskAddCard .filters{
  /* Form içinde bazı field'lar inline style ile 100% yapılıyor.
     Grid'i 12 kolon gibi düşünerek daha stabil hale getiriyoruz. */
  grid-template-columns: repeat(12, 1fr);
  margin-bottom: 0;
}

#taskAddCard .field{
  /* default: full control via span rules below */
}

/* Title */
#taskAddCard #taskTitle{}

/* Grid spans (desktop) */
#taskAddCard .field:nth-of-type(1){ grid-column: span 5; } /* Title */
#taskAddCard .field:nth-of-type(2){ grid-column: span 3; } /* Owner */
#taskAddCard .field:nth-of-type(3){ grid-column: span 2; } /* Priority */
#taskAddCard .field:nth-of-type(4){ grid-column: span 2; } /* Due */
#taskAddCard .field:nth-of-type(5){ grid-column: 1 / -1; } /* Note */
#taskAddCard .field:nth-of-type(6){ grid-column: 1 / -1; } /* Button row */

/* message text */
#taskAddMsg{
  color: var(--muted);
  font-size: 12px;
}

/* -----------------------------
   Buttons (fallback styling)
   ----------------------------- */
.btn{
  appearance: none;
  border: 1px solid rgba(229,231,235,.9);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.75));
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15,23,42,.06);
}

.btn:hover{
  border-color: rgba(11,92,255,.16);
  box-shadow: 0 12px 24px rgba(15,23,42,.08);
  transform: translateY(-1px);
}

.btn:active{
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(15,23,42,.06);
}

.btn.btn-small{
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.taskList{
  display:grid;
  gap: 10px;
}

.taskItem{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(229,231,235,.9);
  background: rgba(255,255,255,.92);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.taskItem:hover{
  transform: translateY(-1px);
  border-color: rgba(11,92,255,.16);
  box-shadow: 0 12px 24px rgba(15,23,42,.08);
}

.taskMain{ flex: 1; }

.taskTitle{
  font-weight: 950;
  font-size: 13px;
  color: var(--text);
}

.taskMeta{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.taskNote{
  margin-top: 8px;
  font-size: 12px;
  color: #0f172a;
  line-height: 1.55;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(229,231,235,.9);
  background: rgba(255,255,255,.7);
}

.priority{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  border: 1px solid rgba(229,231,235,.9);
  background:#fff;
  white-space:nowrap;
  box-shadow: 0 8px 16px rgba(15,23,42,.05);
}

.priority.high{ color:#b42318; border-color: rgba(180,35,24,.22); background: rgba(180,35,24,.06); }
.priority.medium{ color:#b54708; border-color: rgba(181,71,8,.22); background: rgba(181,71,8,.06); }
.priority.low{ color:#027a48; border-color: rgba(2,122,72,.22); background: rgba(2,122,72,.06); }

.tasksEmpty{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(100,116,139,.35);
  color: var(--muted);
  font-size: 12px;
  background: rgba(255,255,255,.6);
}

.hidden{ display:none !important; }

/* Responsive */
@media (max-width: 980px){
  .tasksPage{ padding: 16px; }
  .filters{ grid-template-columns: 1fr 1fr; }

  /* Task add card grid on tablet */
  #taskAddCard .filters{
    grid-template-columns: 1fr 1fr;
  }
  #taskAddCard .field:nth-of-type(1){ grid-column: 1 / -1; }
  #taskAddCard .field:nth-of-type(2){ grid-column: 1 / -1; }
  #taskAddCard .field:nth-of-type(3){ grid-column: span 1; }
  #taskAddCard .field:nth-of-type(4){ grid-column: span 1; }
  #taskAddCard .field:nth-of-type(5){ grid-column: 1 / -1; }
  #taskAddCard .field:nth-of-type(6){ grid-column: 1 / -1; }
}

@media (max-width: 560px){
  .card{ padding: 14px; }
  .tasksHeader{ flex-direction: column; align-items:flex-start; }
  .tasksHeader__right{ align-items:flex-start; }
  .taskItem{ flex-direction: column; }
  .priority{ margin-top: 8px; }

  /* Task add card grid on mobile */
  #taskAddCard .filters{
    grid-template-columns: 1fr;
  }
  #taskAddCard .field:nth-of-type(1),
  #taskAddCard .field:nth-of-type(2),
  #taskAddCard .field:nth-of-type(3),
  #taskAddCard .field:nth-of-type(4),
  #taskAddCard .field:nth-of-type(5),
  #taskAddCard .field:nth-of-type(6){
    grid-column: 1 / -1;
  }
}

.taskBadge{
  display:inline-block;
  font-size:12px;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--line,#e5e7eb);
  color: var(--muted,#64748b);
}
.taskBadge--current{ background:#eef7ff; }
.taskBadge--latest{ background:#f2fff4; }


.statusPill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(229,231,235,.9);
  background: rgba(248,250,252,.9);
}

.status-open{ color:#334155; }
.status-in_progress{ color:#1d4ed8; }
.status-done{ color:#15803d; }
.status-blocked{ color:#b91c1c; }