/* Kanban Tracker Lite - simple gray/blue/black palette */

.ktl-app{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111827;
}

/* Prevent subtle overlap/overflow issues in grid + flex layouts.
   Some WP themes ship with different global box-sizing rules. */
.ktl-app,
.ktl-app *{
  box-sizing: border-box;
}

.ktl-topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #111827;
  color:#fff;
}

.ktl-toast{
  position: fixed;
  top: 62px;
  right: 16px;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: 360px;
  z-index: 9999;
}

.ktl-toast.is-show{
  opacity: 1;
  transform: translateY(0);
}

.ktl-brand{
  display:flex;
  align-items: baseline;
  gap: 10px;
}

.ktl-brand__name{
  font-weight: 700;
  letter-spacing: 0.2px;
}

.ktl-brand__tag{
  font-size: 12px;
  padding: 2px 8px;
  background: #1d4ed8;
  border-radius: 999px;
}

.ktl-topbar-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.ktl-btn{
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  padding: 8px 12px;
  border-radius: 8px;
  cursor:pointer;
  font-size: 14px;
  line-height: 1.1;
}

.ktl-btn--small{
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 7px;
}

.ktl-icon-btn{
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.ktl-icon-btn:hover{ background:#f9fafb; }

.ktl-btn:hover{ background:#f9fafb; }
.ktl-btn:disabled{ opacity:0.6; cursor:not-allowed; }

.ktl-btn--primary{
  background: #1d4ed8;
  border-color: #1d4ed8;
  color:#fff;
}

.ktl-btn--primary:hover{ background:#1e40af; border-color:#1e40af; }

.ktl-btn--ghost{
  background: transparent;
  border-color: transparent;
  color: #e5e7eb;
}

.ktl-btn--ghost:hover{ background: rgba(255,255,255,0.08); }

.ktl-btn--danger{
  background: #111827;
  border-color: #111827;
  color:#fff;
}

.ktl-btn--danger:hover{ background:#000; border-color:#000; }

.ktl-layout{
  display:flex;
  min-height: calc(100vh - 52px);
  background:#f3f4f6;
}

/* Template alias */
.ktl-shell{
  display:flex;
  min-height: calc(100vh - 52px);
  background:#f3f4f6;
}

.ktl-sidebar{
  width: 280px;
  background:#f9fafb;
  border-right: 1px solid #e5e7eb;
  padding: 14px;
}

.ktl-sidebar__header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ktl-sidebar__title{
  font-weight: 700;
}

.ktl-boardlist{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ktl-sidebar-header{
  font-weight: 700;
  margin-bottom: 10px;
}

.ktl-board-list{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ktl-board-item{
  width:100%;
  text-align:left;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
}

.ktl-board-item:hover{ background:#f3f4f6; }
.ktl-board-item.is-active{ border-color:#1d4ed8; box-shadow: 0 0 0 2px rgba(29,78,216,0.15); }

.ktl-main{
  flex: 1;
  padding: 16px;
  overflow-x:auto;
}

.ktl-board-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ktl-boardbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ktl-boardbar__left{ display:flex; align-items:center; }
.ktl-boardbar__right{ display:flex; gap: 10px; }

.ktl-board-title{
  font-size: 18px;
  font-weight: 800;
}

.ktl-boardbar__title{
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.ktl-board-actions{ display:flex; gap: 10px; }

.ktl-empty{
  padding: 20px;
  background:#fff;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  color:#374151;
}

.ktl-columns{
  display:flex;
  gap: 12px;
  align-items: flex-start;
}

.ktl-column{
  width: 320px;
  background:#e5e7eb;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.ktl-column-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ktl-column-title{
  font-weight: 700;
}

.ktl-col-actions{ display:flex; gap: 8px; }

.ktl-task-list{
  display:flex;
  flex-direction: column;
  gap: 8px;
  min-height: 30px;
}

.ktl-card{
  background:#fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  cursor: grab;
}

.ktl-card:active{ cursor: grabbing; }

.ktl-card-title{
  font-weight: 600;
  margin-bottom: 6px;
}

.ktl-card-meta{
  font-size: 12px;
  color:#4b5563;
}

.ktl-auth{
  max-width: 900px;
  margin: 24px auto;
  padding: 16px;
}

.ktl-auth-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ktl-panel{
  background:#fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

.ktl-panel-title{
  font-weight: 800;
  margin-bottom: 10px;
}

.ktl-field{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.ktl-field > span{
  font-size: 12px;
  color:#374151;
}

.ktl-field input, .ktl-field textarea{
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
}

.ktl-field input:focus, .ktl-field textarea:focus{
  outline: none;
  border-color:#1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}

.ktl-message{
  margin-top: 10px;
  font-size: 13px;
  color:#111827;
}

.ktl-message.is-error{ color:#991b1b; }

.ktl-modal{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.55);
  display:none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 18px;
}

.ktl-modal.is-open{ display:flex; }

.ktl-modal-card{
  width: min(1040px, 100%);
  background:#fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  position: relative;
  max-height: calc(100vh - 48px);
  display:flex;
  flex-direction: column;
}

.ktl-modal-card.ktl-file-drop::after{
  content: "Drop files to attach";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(29,78,216,0.08);
  border: 2px dashed rgba(29,78,216,0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  color:#1d4ed8;
  pointer-events:none;
}

.ktl-modal-header{
  display:flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  background:#f9fafb;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.ktl-modal-title{ font-weight: 800; font-size: 20px; }

.ktl-modal-body{ padding: 14px; overflow:auto; flex:1; min-height:0; }

.ktl-modal-grid{
  display:grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 20px;
  align-items: start;
}

.ktl-modal-grid > div{ min-width:0; }

.ktl-row{ display:flex; gap: 10px; align-items:center; }
.ktl-row--between{ justify-content: space-between; }

/* Make form fields inside flex rows shrink correctly and avoid overlap. */
.ktl-row > input,
.ktl-row > select,
.ktl-row > textarea{
  flex: 1;
  min-width: 0;
}

.ktl-section-title{
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 16px;
}

.ktl-check-item{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background:#fff;
  margin-bottom: 8px;
}

.ktl-check-left{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 1;
}

.ktl-check-text{
  flex: 1;
  font-size: 14px;
}

.ktl-muted{ color:#6b7280; font-size: 13px; }

/* Auth (login/register) */
.ktl-auth{
  max-width: 980px;
  margin: 24px auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.ktl-hint{
  background:#f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  color:#374151;
}

.ktl-tabs{
  display:flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ktl-tab{
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background:#f9fafb;
  cursor: pointer;
  font-weight: 600;
}

.ktl-tab.is-active{
  background:#1d4ed8;
  border-color:#1d4ed8;
  color:#fff;
}

.ktl-pane{ display:none; }
.ktl-pane.is-active{ display:block; }

.ktl-form label{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color:#374151;
  font-size: 13px;
}

.ktl-form input,
.ktl-field input,
.ktl-field textarea,
#ktl-comment-new,
#ktl-column-new,
#ktl-check-new{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.ktl-form select,
.ktl-field select,
#ktl-member-role,
#ktl-label-new-color{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background:#fff;
}

.ktl-role-pill{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background:#f9fafb;
  font-size: 12px;
  color:#374151;
}

.ktl-labels-row{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
}

.ktl-label-badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.08);
}

.ktl-label-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
}

.ktl-task-meta-row{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-top: 8px;
}

.ktl-due-pill{
  display:inline-flex;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  background:#f9fafb;
  color:#111827;
}

.ktl-due-pill.is-overdue{
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.08);
  color:#991b1b;
}

.ktl-list-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background:#fff;
  margin-bottom: 8px;
}

.ktl-list-left{ display:flex; align-items:center; gap: 10px; flex:1; min-width:0; }
.ktl-list-title{ font-weight: 700; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.ktl-list-sub{ font-size: 12px; color:#6b7280; }
.ktl-list-actions{ display:flex; gap: 8px; align-items:center; }

.ktl-comment{
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background:#fff;
  margin-bottom: 8px;
}

.ktl-comment__meta{ font-size: 12px; color:#6b7280; margin-bottom: 6px; }
.ktl-comment__text{ font-size: 14px; color:#111827; white-space: pre-wrap; }

.ktl-attachment{
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background:#fff;
  margin-bottom: 8px;
}

.ktl-attachment a{ color:#1d4ed8; text-decoration:none; font-weight:700; }
.ktl-attachment a:hover{ text-decoration: underline; }

.ktl-drop-target{
  outline: 2px dashed rgba(29,78,216,0.55);
  outline-offset: 4px;
}

.ktl-form textarea,
.ktl-field textarea{ resize: vertical; }

.ktl-form__msg{
  color:#b91c1c;
  font-size: 13px;
  min-height: 18px;
}

/* Columns manager */
.ktl-manage-row{
  display:flex;
  gap: 8px;
  align-items:center;
  margin-bottom: 10px;
}

.ktl-manage-row input{
  flex: 1;
}

@media (max-width: 880px){
  .ktl-sidebar{ width: 240px; }
  .ktl-auth{ grid-template-columns: 1fr; }
  .ktl-modal-grid{ grid-template-columns: 1fr; }
}


/* ------------------------------------------------------------------ */
/* KTL Trello-like board layout (v1.2)                                 */
/* ------------------------------------------------------------------ */

.ktl-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#ktl-board {
  flex: 1;
  min-height: 480px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

/* Board list items (JS uses .ktl-boarditem) */
.ktl-boarditem {
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  margin-bottom: 8px;
}
.ktl-boarditem:hover { border-color: #cbd5e1; }
.ktl-boarditem.is-active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.ktl-boarditem__title { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.ktl-boarditem__meta { font-size: 12px; color: #6b7280; }

/* Columns container: behaves like table cells / td */
.ktl-cols {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--ktl-col-width, 280px);
  gap: 12px;
  align-items: stretch;
  height: 100%;
  min-height: 100%;
  padding: 4px 2px;
}

/* Column */
.ktl-col {
  background: #e5e7eb; /* light grey */
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

.ktl-col__header {
  padding: 4px 6px 8px 6px;
}

.ktl-col__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.ktl-col__count {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(17,24,39,0.08);
  border-radius: 9999px;
  padding: 2px 8px;
}

/* List area: reserved drop zone even when empty */
.ktl-col__list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px;
  border-radius: 10px;
  min-width: 0;
}

.ktl-col__list:empty::before {
  content: "Drop cards here";
  display: block;
  font-size: 12px;
  color: #6b7280;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(17,24,39,0.18);
}

.ktl-col__list.ktl-drop-target {
  outline: 2px solid rgba(37,99,235,0.35);
  background: rgba(37,99,235,0.06);
}

.ktl-col__footer {
  padding-top: 6px;
}

.ktl-col__addcard {
  width: 100%;
  border: 0;
  background: transparent;
  color: #111827;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.ktl-col__addcard:hover {
  background: rgba(255,255,255,0.6);
}

/* Card */
.ktl-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(17,24,39,0.08);
  box-shadow: 0 1px 0 rgba(9,30,66,0.18);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.ktl-card:hover {
  background: #f9fafb;
}

.ktl-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
  word-break: break-word;
}

/* Labels on card: Trello-like color bars */
.ktl-card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.ktl-labelbar {
  display: inline-block;
  width: 32px;
  height: 8px;
  border-radius: 9999px;
}

/* Card badges row */
.ktl-card__badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ktl-due-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #e5e7eb;
  color: #111827;
}
.ktl-due-badge.is-overdue {
  background: #fee2e2;
  color: #7f1d1d;
}

/* Checklist item class names used by JS */
.ktl-checkitem {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}
.ktl-checkitem:last-child { border-bottom: 0; }
.ktl-checkitem__text { flex: 1; color: #111827; }
.ktl-checkitem.is-checked .ktl-checkitem__text {
  text-decoration: line-through;
  color: #6b7280;
}

/* Assignees pills */
#ktl-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ktl-assignee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  color: #ffffff;
  border-radius: 9999px;
  padding: 6px 10px;
  font-size: 12px;
}
.ktl-assignee__name { line-height: 1; }
.ktl-assignee__remove {
  border: 0;
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border-radius: 9999px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  line-height: 18px;
  padding: 0;
}
.ktl-assignee__remove:hover { background: rgba(255,255,255,0.25); }

