:root{
  --bg: #0b0f17;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.7);
  --muted2: rgba(255,255,255,.55);
  --accent: #7c5cff;
  --accent2: #00d4ff;
  --danger: #ff4d6d;
  --ok: #35d07f;
  --warn: #ffb020;
  --shadow: 0 18px 55px rgba(0,0,0,.45);
  --radius: 14px;
  --radius2: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color-scheme: dark;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
html{
  background:
    radial-gradient(1200px 700px at 20% 15%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(1100px 650px at 90% 20%, rgba(0,212,255,.18), transparent 55%),
    radial-gradient(900px 650px at 65% 85%, rgba(53,208,127,.10), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}
body{
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: transparent;
}

.app{ min-height: 100%; display: flex; flex-direction: column; }

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}
.brand__title{
  font-weight: 750;
  letter-spacing: .2px;
  font-size: 16px;
}
.brand__subtitle{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted2);
}
.topbar__controls{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.segmented{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  display: inline-flex;
  gap: 3px;
  box-shadow: var(--shadow);
}
.segmented__btn{
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}
.segmented__btn[aria-selected="true"]{
  background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(0,212,255,.20));
  color: var(--text);
}

.btn{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: var(--shadow);
}
.btn:hover{ border-color: rgba(255,255,255,.22); }
.btn:active{ transform: translateY(1px); }
.btn--ghost{
  background: transparent;
  box-shadow: none;
}
.btn--danger{ border-color: rgba(255,77,109,.35); color: rgba(255,170,185,.95); }

.layout{
  display: grid;
  grid-template-columns: var(--sidebar-w, 260px) 8px 1fr 8px var(--detail-w, 420px);
  gap: 0;
  padding: 0 14px 14px;
  flex: 1;
  min-height: 0;
}

.sidebar,.content,.detail{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  min-height: 0;
}

.splitter{
  border-radius: 999px;
  cursor: col-resize;
  position: relative;
}
.splitter::after{
  content:"";
  position:absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 -7px 0 rgba(255,255,255,.16), 0 7px 0 rgba(255,255,255,.16);
}
.splitter:hover::after{
  background: rgba(124,92,255,.55);
  box-shadow: 0 -7px 0 rgba(124,92,255,.38), 0 7px 0 rgba(124,92,255,.38);
}

.layout--sidebarCollapsed{
  grid-template-columns: 0px 0px 1fr 8px var(--detail-w, 420px);
}
.layout--sidebarCollapsed .sidebar{
  display: none;
}
.layout--sidebarCollapsed #splitterSidebar{
  display: none;
}

.sidebar{ padding: 12px; }
.sidebar__header{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
  padding: 6px 6px 10px;
}
.sidebar__title{ font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.tree{ padding: 2px; }

.treeNode{ margin: 4px 0; }
.treeRow{
  display:flex;
  align-items:center;
  gap: 8px;
  border-radius: 12px;
  padding: 6px 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.treeRow:hover{ background: rgba(255,255,255,.06); }
.treeRow--active{
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(0,212,255,.12));
  border-color: rgba(124,92,255,.25);
}
.treeRow__caret{
  width: 14px;
  text-align: center;
  color: var(--muted2);
  font-family: var(--mono);
}
.treeRow__name{
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}
.treeRow__count{
  font-size: 12px;
  color: var(--muted2);
  font-family: var(--mono);
}
.treeChildren{ padding-left: 10px; }
.treeRow__actions{ display:flex; gap: 6px; }
.iconBtn{
  width: 26px; height: 26px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted2);
}
.iconBtn:hover{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: var(--text); }

.content{
  display:flex;
  flex-direction: column;
  min-width: 0;
}
.content__header{
  padding: 12px;
  display:flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.filters{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.field{ display:flex; flex-direction: column; gap: 6px; }
.field__label{ font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .12em; }
.field--row{
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
}
.field--row .field__label{ margin: 0; }
.input{
  min-width: 180px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.15);
  color: var(--text);
  outline: none;
}
.input[type="date"],
.input[type="time"],
select.input{
  color-scheme: dark;
}
select.input{
  background: rgba(0,0,0,.18);
}
/* Best-effort: some browsers allow styling the option popup; others ignore it. */
select.input option,
select.input optgroup{
  background-color: #0c1019;
  color: rgba(255,255,255,.92);
}
.input--wide{
  min-width: 260px;
}
.input:focus{ border-color: rgba(124,92,255,.45); box-shadow: 0 0 0 3px rgba(124,92,255,.16); }
.pill{
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.05);
  font-weight: 650;
}

.toggle{
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.toggle input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle__track{
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.toggle__track::after{
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.85);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  transition: left .15s ease, background .15s ease;
}
.toggle input:focus-visible + .toggle__track{
  border-color: rgba(124,92,255,.45);
  box-shadow: 0 0 0 3px rgba(124,92,255,.16);
}
.toggle input:checked + .toggle__track{
  background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(0,212,255,.20));
}
.toggle input:checked + .toggle__track::after{
  left: 21px;
  background: rgba(255,255,255,.95);
}

.views{ flex:1; min-height: 0; }
.view{ display:none; height: 100%; }
.view--active{ display:block; }
.tableWrap{ height: 100%; overflow:auto; }
.table{
  width: 100%;
  border-collapse: collapse;
}
.table thead th{
  position: sticky;
  top: 0;
  background: rgba(12,16,25,.92);
  backdrop-filter: blur(8px);
  text-align: left;
  font-size: 12px;
  color: var(--muted2);
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.thBtn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
}
.thBtn:hover{
  color: inherit;
}
.thBtn:focus-visible{
  outline: none;
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(124,92,255,.16);
}
.thBtn__arrow{
  width: 14px;
  text-align: center;
  color: var(--muted2);
  font-family: var(--mono);
}
.table tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}
.row{
  cursor:pointer;
}
.row:hover{
  background: rgba(255,255,255,.04);
}
.taskTitle{
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta{
  display:flex; gap: 8px; flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted2);
  font-size: 12px;
}
.badge{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(0,0,0,.12);
}
.badge[style*="--badge-color"]{
  border-color: color-mix(in srgb, var(--badge-color) 45%, rgba(255,255,255,.12));
  background: color-mix(in srgb, var(--badge-color) 18%, rgba(0,0,0,.12));
  color: rgba(255,255,255,.92);
}
.badge--me{ border-color: rgba(124,92,255,.32); }
.badge--them{ border-color: rgba(0,212,255,.28); }
.badge--done{ border-color: rgba(53,208,127,.30); color: rgba(200,255,225,.9); }
.badge--overdue{ border-color: rgba(255,77,109,.40); color: rgba(255,190,205,.92); }

.board{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 12px;
  height: 100%;
  overflow:auto;
}
.lane{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(0,0,0,.12);
  min-height: 0;
  display:flex;
  flex-direction: column;
}
.lane__header{
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.lane__title{ font-weight: 750; }
.lane__count{ color: var(--muted2); font-family: var(--mono); }
.lane__cards{
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  overflow:auto;
  min-height: 0;
}
.card{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 10px 10px;
  cursor:pointer;
}
.card:hover{ border-color: rgba(255,255,255,.22); }
.card__title{
  font-weight: 750;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__sub{
  margin-top: 6px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted2);
  font-size: 12px;
}

.detail{ padding: 12px; }
.detail__empty{
  height: 100%;
  display:flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  text-align: center;
  padding: 16px;
}
.detail__emptyTitle{ color: var(--text); font-weight: 800; }
.detail__panel{ height: 100%; display:flex; flex-direction: column; min-height: 0; }
.hidden{ display:none; }
.detail__header{
  display:flex;
  align-items:center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.detail__title{
  flex:1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 12px;
  outline: none;
}
.detail__title:focus{
  border-color: rgba(124,92,255,.45);
  background: rgba(0,0,0,.12);
}
.detail__headerBtns{ display:flex; gap: 8px; }
.detail__meta{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 0 10px;
}
.detail__notes{ min-height: 0; display:flex; flex-direction: column; }
.detail__sectionHeader{
  display:flex; align-items:center; justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}
.detail__sectionTitle{ font-weight: 800; }
.notes{
  min-height: 0;
  overflow:auto;
  display:flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}
.note{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.12);
  border-radius: 16px;
  padding: 10px;
}
.note__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
}
.note__date{
  font-family: var(--mono);
  color: var(--muted2);
  font-size: 12px;
}
.note__body{
  margin-top: 8px;
  width: 100%;
  min-height: 70px;
  resize: vertical;
}

.modal::backdrop{ background: rgba(0,0,0,.55); }
.modal{
  border: none;
  padding: 0;
  background: transparent;
}
.modal__card{
  width: min(560px, calc(100vw - 28px));
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12,16,25,.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 14px;
  color: var(--text);
}
.modal__title{ font-weight: 850; font-size: 15px; }
.modal__body{ margin-top: 10px; display:flex; flex-direction: column; gap: 10px; }
.modal__actions{ margin-top: 12px; display:flex; justify-content:flex-end; gap: 8px; }

.modalMenu{
  display:flex;
  flex-direction: column;
  gap: 14px;
}
.modalMenu__section{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 10px;
}
.modalMenu__title{
  font-size: 11px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  margin-bottom: 8px;
}
.menuBtn{
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
}
.menuBtn + .menuBtn{ margin-top: 8px; }
.menuBtn:hover{ border-color: rgba(255,255,255,.22); }
.menuBtn__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}
.menuBtn__hint{
  margin-top: 6px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.25;
}
.menuBtn--danger{ border-color: rgba(255,77,109,.35); }
.menuBtn--ghost{
  background: transparent;
}

@media (max-width: 1100px){
  .layout{ grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 14px; }
  .splitter{ display: none; }
  .detail{ grid-column: 1 / -1; }
}
@media (max-width: 760px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ order: 2; }
  .content{ order: 1; }
  .detail{ order: 3; }
  .input{ min-width: 160px; }
  .board{ grid-template-columns: 1fr; }
}

