@font-face{font-family:"DM Serif Display";src:url("./assets/dm-serif.ttf") format("truetype");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"DM Sans";src:url("./assets/dm-sans.ttf") format("truetype");font-weight:400 700;font-style:normal;font-display:swap}
@font-face{font-family:"Work Sans";src:url("./assets/work-sans.ttf") format("truetype");font-weight:400 600;font-style:normal;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("./assets/ibm-plex-mono.ttf") format("truetype");font-weight:400 500;font-style:normal;font-display:swap}
@font-face{font-family:"Space Grotesk";src:url("./assets/space-grotesk.ttf") format("truetype");font-weight:400 700;font-style:normal;font-display:swap}

:root{
  --bg:#F6F1E9;
  --bg-2:#EFE8DB;
  --surface:#FFFFFF;
  --surface-2:#FBFAF7;
  --ink:#1B1F24;
  --muted:#6F7683;
  --muted-2:#9AA0AE;
  --line:#E7DFD0;
  --line-2:#DDD6C7;
  --accent:#E85D2F;
  --accent-hover:#CC4F26;
  --accent-soft:#FFF0E8;
  --teal:#0F766E;
  --teal-soft:#E6F2EF;
  --amber:#9A6A1A;
  --amber-soft:#FFF4D6;
  --red:#B94A2F;
  --green:#1B7A4D;
  --green-soft:#E6F4EC;
  --shadow:0 8px 28px rgba(27,31,36,.08),0 1px 3px rgba(27,31,36,.06);
  --shadow-lg:0 18px 48px rgba(27,31,36,.14);
  --radius:14px;
  --radius-sm:10px;
  --radius-xs:8px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto} *{animation-duration:.01ms !important;transition-duration:.01ms !important}}
body{
  margin:0;
  font-family:"DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:var(--ink);
  background:var(--bg);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
button,select,input{font:inherit}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* App shell */
.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:300px 1fr;
  grid-template-rows:auto 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
}

.sidebar{
  grid-area:sidebar;
  background:#111418;
  color:#EDE9E3;
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  border-right:1px solid #1E2329;
}
.topbar{
  grid-area:topbar;
  position:sticky;
  top:0;
  z-index:5;
  background:rgba(246,241,233,.88);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  padding:14px 28px;
  display:flex;
  align-items:center;
  gap:18px;
}
.main{
  grid-area:main;
  padding:28px;
  padding-bottom:48px;
}

/* Brand */
.brand{
  padding:28px 22px 22px;
  border-bottom:1px solid #22272E;
}
.brand-top{
  display:flex;
  align-items:center;
  gap:12px;
}
.logo{
  width:38px;height:38px;
  border-radius:9px;
  background:var(--accent);
  display:grid;place-items:center;
  color:white;
  font-family:"Space Grotesk",sans-serif;
  font-weight:700;
  font-size:18px;
  letter-spacing:-.03em;
}
.brand h1{
  margin:0;
  font-family:"DM Serif Display", Georgia, serif;
  font-weight:400;
  font-size:22px;
  letter-spacing:-.02em;
  line-height:1;
}
.brand h1 span{
  display:block;
  font-family:"DM Sans",sans-serif;
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#9AA0AE;
  margin-top:4px;
  font-weight:600;
}
.brand-desc{
  margin:14px 0 0;
  font-size:13px;
  line-height:1.5;
  color:#9AA0AE;
}

/* Nav */
.nav-section{
  padding:18px 14px;
}
.nav-label{
  font-family:"IBM Plex Mono", monospace;
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#7D8696;
  margin:0 8px 10px;
}
.nav-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.nav-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:9px;
  border:1px solid transparent;
  background:transparent;
  color:#C9D0DB;
  cursor:pointer;
  text-align:left;
  transition:background .15s, color .15s, border-color .15s;
}
.nav-btn:hover{background:#1B2128;color:#fff}
.nav-btn[aria-current="true"]{background:#1E2329;border-color:#2A3038;color:#fff}
.nav-btn-left{display:flex;align-items:center;gap:10px}
.nav-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.nav-dot.all{background:#C9D0DB}
.nav-dot.todo{background:#A08B6D}
.nav-dot.in-progress{background:#0F766E}
.nav-dot.blocked{background:#B94A2F}
.nav-dot.done{background:#1B7A4D}
.nav-count{
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  background:#242A32;
  color:#A0A9BA;
  padding:2px 7px;
  border-radius:20px;
  min-width:22px;
  text-align:center;
}
.nav-btn[aria-current="true"] .nav-count{background:#2A3038;color:#fff}
.team-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.team-item{display:flex;align-items:center;gap:10px;padding:0 8px;color:#A9B2C2;font-size:13px}
.avatar{
  width:28px;height:28px;border-radius:50%;
  display:grid;place-items:center;
  font-size:11px;font-weight:700;
  color:white;
  flex-shrink:0;
}
.sidebar-footer{
  margin-top:auto;
  padding:16px 18px;
  border-top:1px solid #22272E;
  display:flex;
  align-items:center;
  gap:12px;
  color:#9AA0AE;
  font-size:12px;
}
.sidebar-footer strong{color:#EDE9E3;font-weight:600}

/* Topbar */
.search-wrap{
  flex:1;
  max-width:560px;
  position:relative;
}
.search-wrap label{
  font-family:"IBM Plex Mono", monospace;
  font-size:10px;
  letter-spacing:.11em;
  text-transform:uppercase;
  color:var(--muted);
  position:absolute;
  top:-8px;
  left:12px;
  background:var(--bg);
  padding:0 6px;
  border-radius:4px;
  display:none;
}
.search-wrap input{
  width:100%;
  padding:11px 14px 11px 38px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--ink);
  font-size:14px;
  outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.search-wrap input:focus{border-color:var(--ink);box-shadow:0 0 0 3px rgba(27,31,36,.08)}
.search-wrap input::placeholder{color:var(--muted-2)}
.search-icon{
  position:absolute;left:12px;top:50%;transform:translateY(-50%);
  width:16px;height:16px;color:var(--muted);
  pointer-events:none;
}
.top-actions{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto;
}
.filter-wrap{
  display:flex;
  align-items:center;
  gap:8px;
}
.filter-wrap label{
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  white-space:nowrap;
}
.filter-wrap select{
  padding:8px 32px 8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  font-size:13px;
  font-weight:600;
  color:var(--ink);
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231B1F24' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
}
.sort-info{
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
}
.mobile-menu-btn{
  display:none;
  width:40px;height:40px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--ink);
  cursor:pointer;
}

/* Hero */
.hero{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:22px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
  box-shadow:0 1px 0 rgba(27,31,36,.04);
}
.hero-left h2{
  margin:0;
  font-family:"DM Serif Display", serif;
  font-weight:400;
  font-size:26px;
  letter-spacing:-.02em;
  line-height:1.1;
}
.hero-left p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:14px;
  max-width:52ch;
}
.hero-stats{
  display:flex;
  gap:10px;
  flex-shrink:0;
}
.stat{
  min-width:86px;
  padding:10px 12px;
  border-radius:12px;
  background:var(--surface-2);
  border:1px solid var(--line);
  text-align:center;
}
.stat strong{display:block;font-size:18px;line-height:1;letter-spacing:-.02em}
.stat span{font-family:"IBM Plex Mono", monospace;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.stat.accent{background:var(--accent);border-color:var(--accent);color:white}
.stat.accent span{color:rgba(255,255,255,.85)}

/* List header */
.list-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:6px 2px 12px;
}
.list-header h3{
  margin:0;
  font-size:13px;
  font-weight:600;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
}
.list-header-count{
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  color:var(--muted);
  background:var(--surface);
  border:1px solid var(--line);
  padding:4px 8px;
  border-radius:20px;
}

/* Items */
.items{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px 16px 14px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  transition:box-shadow .15s, border-color .15s, transform .15s;
  position:relative;
}
.item:hover{border-color:var(--line-2);box-shadow:var(--shadow);transform:translateY(-1px)}
.item-header{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:8px;
}
.status-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 8px;
  border-radius:999px;
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  font-weight:500;
  letter-spacing:.02em;
  border:1px solid transparent;
  line-height:1;
}
.status-badge.todo{background:#F3EEE6;color:#7A6B52;border-color:#E6DDC9}
.status-badge.in-progress{background:var(--teal-soft);color:#0F5E58;border-color:#C5E3DE}
.status-badge.blocked{background:#FDE8E0;color:#8C3A24;border-color:#F2C9B8}
.status-badge.done{background:var(--green-soft);color:#145A36;border-color:#C6E6D6}
.status-badge .dot{width:6px;height:6px;border-radius:50%;background:currentColor}

.project-chip{
  font-family:"IBM Plex Mono", monospace;
  font-size:10px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
  background:var(--surface-2);
  border:1px solid var(--line);
  padding:3px 7px;
  border-radius:999px;
}
.priority{
  font-family:"IBM Plex Mono", monospace;
  font-size:10px;
  letter-spacing:.06em;
  text-transform:uppercase;
  padding:3px 7px;
  border-radius:999px;
  border:1px solid var(--line);
}
.priority.high{background:#FFF0E8;color:#9A3B1F;border-color:#F2C9B8}
.priority.medium{background:#FFF8E6;color:#7A5A12;border-color:#F0E0B0}
.priority.low{background:#F2F3F5;color:#5A6475;border-color:#E0E4EA}

.item h4{
  margin:0 0 6px;
  font-size:15px;
  font-weight:600;
  line-height:1.35;
  letter-spacing:-.01em;
  color:var(--ink);
}
.item p.summary{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.item-meta{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  font-size:12px;
  color:var(--muted);
}
.item-meta span{display:inline-flex;align-items:center;gap:6px}
.item-meta svg{width:14px;height:14px;flex-shrink:0;color:var(--muted-2)}
.assignee{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-weight:500;
  color:var(--ink);
}
.mini-avatar{
  width:20px;height:20px;border-radius:50%;
  display:grid;place-items:center;
  font-size:9px;font-weight:700;color:white;
}
.open-wrap{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  min-width:88px;
}
.due{
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--muted);
  white-space:nowrap;
}
.due.overdue{background:#FFF0E8;color:#9A3B1F;border-color:#F2C9B8}
.open-btn{
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--ink);
  background:var(--ink);
  color:white;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:background .15s, transform .15s;
}
.open-btn:hover{background:#2A3038;transform:translateY(-1px)}
.open-btn:active{transform:translateY(0)}

/* Empty */
.empty{
  background:var(--surface);
  border:1px dashed var(--line-2);
  border-radius:16px;
  padding:40px 24px;
  text-align:center;
  display:none;
}
.empty.show{display:block}
.empty h3{
  margin:0;
  font-family:"DM Serif Display", serif;
  font-size:20px;
  font-weight:400;
}
.empty p{margin:8px auto 0;max-width:42ch;color:var(--muted);font-size:14px}
.empty-actions{margin-top:16px;display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.btn-primary{
  padding:9px 14px;
  border-radius:999px;
  border:1px solid var(--accent);
  background:var(--accent);
  color:white;
  font-weight:600;
  font-size:13px;
  cursor:pointer;
}
.btn-primary:hover{background:var(--accent-hover)}
.btn-secondary{
  padding:9px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--ink);
  font-weight:600;
  font-size:13px;
  cursor:pointer;
}
.btn-secondary:hover{background:var(--surface-2)}

/* Detail overlay */
.detail-overlay{
  position:fixed;
  inset:0;
  z-index:40;
  display:none;
}
.detail-overlay.open{display:block}
.backdrop{
  position:absolute;inset:0;
  background:rgba(17,20,24,.42);
  backdrop-filter:blur(4px);
}
.detail{
  position:absolute;
  top:0;right:0;
  width:min(560px, 92vw);
  height:100dvh;
  background:var(--surface);
  box-shadow:var(--shadow-lg);
  border-left:1px solid var(--line);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  animation:slideIn .22s ease;
}
@keyframes slideIn{from{transform:translateX(10px);opacity:.96} to{transform:none;opacity:1}}
.detail-scroll{
  overflow:auto;
  padding:0;
  flex:1;
}
.detail-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  background:var(--surface);
  position:sticky;
  top:0;
  z-index:1;
}
.detail-top-left{
  display:flex;
  align-items:center;
  gap:10px;
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
}
.close-btn{
  width:36px;height:36px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--ink);
  display:grid;place-items:center;
  cursor:pointer;
}
.close-btn:hover{background:var(--surface-2)}
.detail-hero{
  padding:22px 24px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, var(--surface-2), var(--surface));
}
.detail-hero h2{
  margin:8px 0 10px;
  font-family:"DM Serif Display", serif;
  font-weight:400;
  font-size:26px;
  line-height:1.15;
  letter-spacing:-.02em;
}
.detail-hero .meta-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}
.meta-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
}
.meta-card dt{
  font-family:"IBM Plex Mono", monospace;
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 4px;
}
.meta-card dd{
  margin:0;
  font-size:13px;
  font-weight:600;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:8px;
}
.tags{margin-top:12px;display:flex;gap:8px;flex-wrap:wrap}
.tag{
  font-family:"IBM Plex Mono", monospace;
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--muted);
}
.detail-body{
  padding:20px 24px 24px;
}
.detail-body h3{
  margin:0 0 8px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink);
}
.detail-body .body-text{
  color:#2F3542;
  font-size:14px;
  line-height:1.7;
  white-space:pre-wrap;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px 16px;
}
.status-control-wrap{
  margin-top:16px;
  padding:14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--surface);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.status-control-wrap label{
  font-size:13px;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:8px;
}
.status-control-wrap select{
  padding:8px 34px 8px 12px;
  border-radius:999px;
  border:1px solid var(--ink);
  background:var(--ink);
  color:white;
  font-weight:600;
  font-size:13px;
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
}
.feedback{
  margin-top:10px;
  font-size:13px;
  font-weight:600;
  color:var(--green);
  display:flex;
  align-items:center;
  gap:6px;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .2s, transform .2s;
}
.feedback.show{opacity:1;transform:none}
.detail-footer{
  padding:16px 24px;
  border-top:1px solid var(--line);
  background:var(--surface-2);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:12px;
  color:var(--muted);
}
.detail-footer .next-btn{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  font-weight:600;
  cursor:pointer;
}

/* Toast */
.toast{
  position:fixed;
  bottom:18px;
  left:50%;
  transform:translateX(-50%) translateY(8px);
  background:#111418;
  color:white;
  padding:10px 14px;
  border-radius:999px;
  font-size:13px;
  font-weight:500;
  display:flex;
  align-items:center;
  gap:8px;
  box-shadow:var(--shadow-lg);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s, transform .2s;
  z-index:50;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast-dot{width:8px;height:8px;border-radius:50%;background:var(--accent)}

/* Responsive */
@media (max-width: 980px){
  .app{grid-template-columns:1fr;grid-template-areas:"topbar" "main"}
  .sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:300px;
    z-index:30;
    transform:translateX(-100%);
    transition:transform .22s ease;
  }
  .sidebar.open{transform:none}
  .sidebar-backdrop{
    position:fixed;inset:0;background:rgba(0,0,0,.36);z-index:29;
    display:none;
  }
  .sidebar-backdrop.open{display:block}
  .topbar{padding:12px 14px;gap:10px;flex-wrap:wrap}
  .search-wrap{max-width:none;order:2;flex-basis:100%}
  .top-actions{order:1;width:100%;justify-content:space-between}
  .mobile-menu-btn{display:grid;place-items:center}
  .main{padding:14px}
  .hero{flex-direction:column;align-items:stretch;padding:16px}
  .hero-stats{overflow:auto;padding-bottom:2px}
  .detail{width:100vw;max-width:100vw}
}
@media (max-width: 640px){
  .item{grid-template-columns:1fr}
  .open-wrap{flex-direction:row;align-items:center;min-width:auto}
  .item-meta{gap:10px}
  .hero-left h2{font-size:22px}
  .detail-top{padding:12px 14px}
  .detail-hero{padding:18px 16px}
  .detail-body{padding:16px}
  .meta-grid{grid-template-columns:1fr !important}
  .status-control-wrap{flex-direction:column;align-items:stretch}
  .status-control-wrap select{width:100%}
}
