:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-2: #0d0e12;
  --panel: rgba(15, 16, 20, 0.84);
  --panel-solid: #0f1014;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.065);
  --surface-3: rgba(255, 255, 255, 0.095);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f8f8;
  --muted: #8a8f98;
  --muted-2: #62666d;
  --brand: #7170ff;
  --brand-2: #5e6ad2;
  --brand-glow: rgba(113, 112, 255, 0.34);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-feature-settings: "cv01", "ss03";
  background:
    radial-gradient(circle at 18% 0%, rgba(113,112,255,.22), transparent 29rem),
    radial-gradient(circle at 78% 8%, rgba(16,185,129,.12), transparent 24rem),
    linear-gradient(180deg, #0b0c10 0%, #08090a 48%, #050506 100%);
  color: var(--text);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 72%);
}
button, input, textarea, select { font: inherit; font-size: 16px; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, .project-item, .card, dialog, input, textarea, select { transition: transform .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease), opacity .22s var(--ease); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(113,112,255,.18), 0 0 0 1px var(--brand); border-color: var(--brand); }

.shell { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; animation: page-in .45s var(--ease) both; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 24px;
  background: linear-gradient(180deg, rgba(15,16,20,.93), rgba(8,9,10,.86));
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset -1px 0 rgba(255,255,255,.03);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.brand strong { letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 16px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, #f7f8f8, #7170ff 46%, #10111a 100%);
  color: white; font-weight: 800; letter-spacing: -.04em;
  box-shadow: 0 18px 45px var(--brand-glow), inset 0 1px rgba(255,255,255,.42);
  animation: float-in .55s var(--ease) both;
}
.section-title, .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: #a7adff; font-weight: 700; }
.project-list { display: grid; gap: 10px; overflow: auto; padding-right: 4px; scrollbar-color: rgba(255,255,255,.18) transparent; }
.project-item {
  position: relative;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  animation: list-in .34s var(--ease) both;
}
.project-item::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background: var(--brand); opacity:0; transition: opacity .22s var(--ease); }
.project-item:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-2); }
.project-item.active { transform: translateY(-1px); border-color: rgba(113,112,255,.55); background: linear-gradient(135deg, rgba(113,112,255,.16), rgba(255,255,255,.04)); box-shadow: 0 18px 46px rgba(0,0,0,.28); }
.project-item.active::before { opacity: 1; }
.project-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }

.workspace { padding: 30px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.topbar h1 { font-size: clamp(32px, 5vw, 62px); margin: 4px 0; line-height: .96; font-weight: 590; letter-spacing: -1.1px; }
.muted { color: var(--muted); line-height: 1.55; }
.actions, .modal-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.primary, .ghost, .danger, .chip {
  min-height: 40px;
  border-radius: 12px;
  padding: 10px 15px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 1px 0 rgba(0,0,0,.2);
}
.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: rgba(255,255,255,.16); box-shadow: 0 14px 35px var(--brand-glow), inset 0 1px rgba(255,255,255,.22); }
.ghost { background: rgba(255,255,255,.025); color: #d0d6e0; }
.danger { background: rgba(251,113,133,.12); color: #fecdd3; border-color: rgba(251,113,133,.28); }
.chip { min-height: 30px; padding: 6px 10px; border-radius: 999px; font-size: 12px; color: #d0d6e0; }
button:hover { transform: translateY(-2px); border-color: var(--line-strong); }
button:active, .button-burst { transform: translateY(0) scale(.97); }
.wide { width: 100%; justify-content: center; }
.status-chooser { display: none; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.column {
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  padding: 15px;
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.05);
  animation: column-in .44s var(--ease) both;
}
.column:nth-child(2) { animation-delay: .06s; }
.column:nth-child(3) { animation-delay: .12s; }
.column.drag-over { transform: translateY(-3px) scale(1.01); border-color: rgba(113,112,255,.62); background: linear-gradient(180deg, rgba(113,112,255,.16), rgba(255,255,255,.04)); }
.column header { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 13px; }
.column h2 { margin: 0; font-size: 16px; font-weight: 590; letter-spacing: -.02em; }
.count { min-width: 28px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; color: #d0d6e0; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 12px; }
.cards { display: grid; gap: 12px; }
.card {
  position: relative;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8,9,10,.62);
  box-shadow: 0 12px 32px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.04);
  animation: card-in .32s var(--ease) both;
  cursor: grab;
}
.card::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; opacity:0; background: radial-gradient(circle at top right, rgba(113,112,255,.22), transparent 42%); transition: opacity .22s var(--ease); }
.card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.18); background: rgba(20,21,27,.82); }
.card:hover::after { opacity: 1; }
.card.dragging { opacity: .45; transform: rotate(1deg) scale(.98); cursor: grabbing; }
.card.moving { animation: task-move .42s var(--ease) both; }
.card-top { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; margin-bottom: 7px; }
.drag-handle { display: inline-grid; place-items: center; width: 22px; height: 24px; border-radius: 8px; color: var(--muted-2); background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); cursor: grab; line-height: 1; letter-spacing: -5px; padding-right: 5px; user-select: none; }
.card:hover .drag-handle { color: #d0d6e0; border-color: var(--line-strong); background: rgba(255,255,255,.07); }
.card h3 { margin: 1px 0 0; font-size: 16px; line-height: 1.25; font-weight: 590; letter-spacing: -.02em; }
.card p { color: var(--muted); margin: 0 0 13px; line-height: 1.45; font-size: 14px; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.move-chip { display: inline-flex; align-items: center; gap: 6px; }
.empty-drop { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 22px 14px; border: 1px dashed rgba(255,255,255,.12); border-radius: 18px; color: var(--muted); background: radial-gradient(circle at top, rgba(113,112,255,.10), rgba(255,255,255,.025) 58%); animation: card-in .34s var(--ease) both; }
.empty-drop span { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px; color: #c7d2fe; background: rgba(113,112,255,.12); border: 1px solid rgba(113,112,255,.24); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.empty-drop strong { color: #d0d6e0; font-weight: 590; letter-spacing: -.02em; }
.empty-drop small { max-width: 190px; line-height: 1.45; color: var(--muted); }
.template-card {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px dashed rgba(255,255,255,.14);
  border-style: dashed;
  border-radius: 18px;
  color: #d0d6e0;
  text-align: left;
  background: linear-gradient(135deg, rgba(113,112,255,.08), rgba(255,255,255,.025));
  box-shadow: inset 0 1px rgba(255,255,255,.04);
  animation: card-in .32s var(--ease) both;
}
.template-card:hover { border-color: rgba(113,112,255,.5); background: linear-gradient(135deg, rgba(113,112,255,.16), rgba(255,255,255,.045)); }
.template-copy { display: grid; gap: 4px; }
.template-copy strong { font-size: 14px; font-weight: 590; letter-spacing: -.02em; color: #f7f8f8; }
.template-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.template-plus { flex: 0 0 auto; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 999px; color: #fff; font-size: 22px; line-height: 1; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 10px 24px var(--brand-glow), inset 0 1px rgba(255,255,255,.2); }

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(460px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 15px;
  color: #eafff6;
  background: rgba(16,185,129,.16);
  border: 1px solid rgba(16,185,129,.32);
  box-shadow: var(--shadow);
  animation: toast-in .28s var(--ease) both;
}
.notice.error, .error { color: #fecdd3; background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.28); }
.empty { display: grid; place-items: center; text-align: center; min-height: 420px; border: 1px dashed var(--line-strong); border-radius: 26px; background: rgba(255,255,255,.025); animation: float-in .4s var(--ease) both; }
.empty h2 { margin: 0 0 8px; }

.stack { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #d0d6e0; font-size: 13px; font-weight: 510; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 12px 13px;
  min-height: 44px;
}
textarea { resize: vertical; }
select option { background: #101116; color: var(--text); }

.modal { width: min(560px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 24px; padding: 0; background: rgba(16,17,22,.96); color: var(--text); box-shadow: 0 40px 120px rgba(0,0,0,.66); }
.modal::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(8px); animation: fade-in .18s ease both; }
.modal[open] { animation: modal-in .26s var(--ease) both; }
.modal form { padding: 22px; }
.modal h2 { margin: 0 0 4px; font-weight: 590; letter-spacing: -.03em; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.08);
  animation: login-in .48s var(--ease) both;
}
.login-card h1 { margin: 8px 0; font-size: clamp(30px, 7vw, 44px); line-height: 1; letter-spacing: -.9px; }
.login-card .brand-mark { margin-bottom: 18px; }
.error { margin: 0; padding: 10px 12px; border: 1px solid rgba(251,113,133,.28); border-radius: 12px; animation: shake .32s var(--ease) both; }
.skeleton { height: 62px; border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.10), rgba(255,255,255,.04)); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes float-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes list-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes column-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes task-move { 0% { transform: scale(.96); opacity: .72; } 55% { transform: scale(1.025); } 100% { transform: none; opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes login-in { from { opacity: 0; transform: translateY(22px) scale(.98); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace { padding: 20px; }
  .topbar { flex-direction: column; }
  .status-chooser {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 14px;
    margin: -4px 0 10px;
    background: linear-gradient(180deg, rgba(8,9,10,.96), rgba(8,9,10,.72) 72%, transparent);
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }
  .status-chooser::-webkit-scrollbar { display: none; }
  .status-tab {
    flex: 0 0 auto;
    min-width: 136px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 999px;
    color: #d0d6e0;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.04);
    scroll-snap-align: start;
  }
  .status-tab strong {
    min-width: 26px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #f7f8f8;
    background: rgba(255,255,255,.08);
    font-size: 12px;
  }
  .status-tab.active {
    color: #fff;
    border-color: rgba(113,112,255,.55);
    background: linear-gradient(135deg, rgba(94,106,210,.72), rgba(113,112,255,.46));
    box-shadow: 0 14px 34px var(--brand-glow), inset 0 1px rgba(255,255,255,.18);
  }
  .board { grid-template-columns: 1fr; }
  .column { min-height: 240px; }
  .column:not(.active-mobile-status) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
