@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f7f8fb;
  --white: #ffffff;
  --blue: #2448d8;
  --blue-dark: #1735a8;
  --ink: #172039;
  --muted: #68708a;
  --line: #dde1eb;
  --periwinkle: #e7ebfa;
  --amber: #ffb000;
  --red: #c63a4a;
  --green: #1d7b5c;
  --focus: #ffb000;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Work Sans", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 34px 20px 22px;
  overflow: hidden;
  background: var(--blue);
  color: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-family: "Oswald", sans-serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  text-decoration: none;
}

.brand-mark { width: 25px; height: 25px; display: grid; align-content: center; gap: 3px; }
.brand-mark span { display: block; height: 3px; border-radius: 2px; background: var(--amber); }
.brand-mark span:nth-child(1) { width: 70%; }
.brand-mark span:nth-child(2) { width: 100%; }
.brand-mark span:nth-child(3) { width: 42%; }

.primary-nav { margin-top: 66px; }
.nav-link {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 0 11px;
  border-radius: 7px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
}
.nav-link.is-active { background: rgba(255,255,255,.14); color: var(--white); font-weight: 650; }
.nav-link svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-count { min-width: 24px; padding: 2px 7px; border-radius: 12px; background: var(--white); color: var(--blue-dark); font-size: 12px; text-align: center; }

.team-block { position: relative; z-index: 1; margin-top: 37px; padding: 0 11px; }
.team-block h2 { margin: 0 0 13px; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 550; }
.avatar-stack { display: flex; flex-wrap: wrap; max-width: 125px; }
.avatar-stack .avatar { margin-right: -7px; border: 2px solid var(--blue); }

.avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #172039;
  background: #dae0f2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.avatar-maya { background: #f6c4d0; }
.avatar-theo { background: #b9e6d2; }
.avatar-asha { background: #ffd28b; }
.avatar-jon { background: #c8c5f4; }
.avatar-luis { background: #b9dbf5; }
.avatar-sam { background: #ead0a9; }
.avatar-user { color: var(--blue-dark); background: var(--amber); }

.sidebar-user {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(255,255,255,.2);
}
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: 13px; font-weight: 650; }
.sidebar-user small { margin-top: 1px; color: rgba(255,255,255,.64); font-size: 11px; }

.workspace { min-width: 0; }
.mobile-bar { display: none; }
.workspace-inner { width: min(1150px, 100%); margin: 0 auto; padding: 56px 54px 70px; }

.inbox-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.inbox-heading h1 { margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.055em; font-weight: 690; }
.inbox-heading p { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

.queue-total { display: flex; align-items: flex-end; gap: 10px; padding-right: 2px; }
.queue-total strong, .queue-total > span:first-child {
  font-family: "Oswald", sans-serif;
  color: var(--blue);
  font-size: 56px;
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.045em;
}
.queue-total > span:last-child { width: 58px; padding-bottom: 3px; color: var(--muted); font-size: 12px; line-height: 1.2; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 210px;
  gap: 14px;
  margin-top: 42px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(40,50,90,.04);
}
.search-field, .filter-field { position: relative; }
.search-field label, .filter-field label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.search-field input, .filter-field select {
  width: 100%;
  height: 46px;
  border: 1px solid #cfd4e2;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
.search-field input { padding: 0 45px 0 43px; }
.search-field input::-webkit-search-cancel-button { appearance: none; }
.search-field > svg { position: absolute; left: 15px; top: 13px; width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }
.clear-search { position: absolute; right: 7px; top: 7px; width: 32px; height: 32px; padding: 7px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.clear-search:hover { background: var(--periwinkle); color: var(--ink); }
.clear-search svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.filter-field select { appearance: none; padding: 0 42px 0 14px; cursor: pointer; }
.filter-field > svg { position: absolute; right: 14px; top: 12px; width: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }

.task-region { margin-top: 33px; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.list-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.list-heading span { color: var(--muted); font-size: 12px; }
.column-headings, .task-row { display: grid; grid-template-columns: minmax(285px, 1fr) 150px 92px 105px 28px; column-gap: 18px; }
.column-headings { padding: 0 22px 8px 27px; color: var(--muted); font-size: 11px; font-weight: 600; }
.task-list { border-top: 1px solid var(--line); }
.task-row {
  position: relative;
  align-items: center;
  min-height: 86px;
  padding: 14px 22px 14px 27px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.55);
}
.task-row:hover { background: var(--white); }
.status-rail { position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 3px 3px 0; background: #9da4b7; }
.task-row.status-in-progress .status-rail { background: var(--blue); }
.task-row.status-blocked .status-rail { background: var(--red); }
.task-row.status-done .status-rail { background: var(--green); }
.task-title-line { display: flex; align-items: center; gap: 9px; }
.task-open { max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 625; line-height: 1.3; text-align: left; cursor: pointer; }
.task-open:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.priority-mark { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.task-row.priority-high .priority-mark { background: var(--amber); box-shadow: 0 0 0 3px rgba(255,176,0,.15); }
.task-context { display: flex; gap: 9px; align-items: center; margin-top: 7px; color: var(--muted); font-size: 11px; }
.project { font-weight: 600; color: #545d78; }
.tags::before { content: "/"; margin-right: 9px; color: #b2b7c6; }
.owner-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.owner-cell .avatar { width: 29px; height: 29px; }
.owner-name { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.due-cell { color: #525b74; font-size: 12px; }
.status-cell { justify-self: start; font-size: 12px; font-weight: 600; }
.status-in-progress .status-cell { color: var(--blue); }
.status-blocked .status-cell { color: var(--red); }
.status-done .status-cell { color: var(--green); }
.row-arrow { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #8a91a4; cursor: pointer; }
.row-arrow:hover { background: var(--periwinkle); color: var(--blue); }
.row-arrow svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.empty-state { padding: 62px 20px; border-top: 1px solid var(--line); text-align: center; }
.empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--periwinkle); color: var(--blue); }
.empty-icon svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.empty-state h2 { margin: 17px 0 6px; font-size: 21px; }
.empty-state p { margin: 0 auto; color: var(--muted); }
.empty-state button { margin-top: 20px; padding: 10px 15px; border: 0; border-radius: 6px; background: var(--blue); color: white; font-weight: 650; cursor: pointer; }
.empty-state button:hover { background: var(--blue-dark); }

.task-dialog {
  width: min(620px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: auto 20px auto auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(15,25,60,.24);
  overflow: auto;
}
.task-dialog::backdrop { background: rgba(20,29,54,.44); backdrop-filter: blur(2px); }
.detail { min-height: min(700px, calc(100vh - 40px)); padding: 30px 36px 36px; }
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.detail-project { color: var(--blue); font-size: 13px; font-weight: 650; }
.close-detail { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); cursor: pointer; }
.close-detail:hover { background: var(--periwinkle); }
.close-detail svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.detail h2 { max-width: 520px; margin: 36px 0 14px; font-size: clamp(29px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 28px; }
.detail-tag { padding: 5px 9px; border-radius: 4px; background: var(--periwinkle); color: #455071; font-size: 11px; font-weight: 600; }
.detail-body { max-width: 64ch; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #3e475f; font-size: 16px; line-height: 1.65; }
.detail-body p { margin: 0 0 18px; }
.detail-body p:last-child { margin-bottom: 0; }
.detail-body strong { color: var(--ink); }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; padding: 26px 0 29px; }
.meta-item { min-width: 0; }
.meta-item > span, .status-field label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.meta-value { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.meta-value .avatar { width: 29px; height: 29px; }
.status-field { grid-column: 1 / -1; padding-top: 3px; }
.status-select-wrap { position: relative; }
.status-field select { appearance: none; width: 100%; height: 50px; padding: 0 44px 0 15px; border: 1px solid #bfc6d9; border-radius: 6px; background: var(--paper); color: var(--ink); font-weight: 620; cursor: pointer; }
.status-select-wrap svg { position: absolute; right: 14px; top: 14px; width: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }
.status-feedback { min-height: 21px; margin: 8px 0 0; color: var(--green); font-size: 12px; font-weight: 600; }
.detail-comments { display: flex; align-items: center; gap: 8px; padding-top: 21px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.detail-comments svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.toast {
  position: fixed;
  z-index: 20;
  right: 30px;
  bottom: 28px;
  transform: translateY(20px);
  padding: 12px 16px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 10px 30px rgba(15,25,60,.22);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 16px; }
  .workspace-inner { padding-inline: 30px; }
  .column-headings, .task-row { grid-template-columns: minmax(250px, 1fr) 88px 100px 28px; column-gap: 14px; }
  .column-headings span:nth-child(2), .owner-cell { display: none; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 66px;
    padding: 0 20px;
    background: var(--blue);
    color: var(--white);
  }
  .mobile-bar .brand { font-size: 22px; }
  .workspace-inner { padding: 29px 18px 50px; }
  .inbox-heading { align-items: flex-start; }
  .inbox-heading h1 { font-size: 34px; }
  .inbox-heading p { max-width: 240px; margin-top: 9px; font-size: 14px; }
  .queue-total { gap: 6px; }
  .queue-total strong, .queue-total > span:first-child { font-size: 43px; }
  .queue-total > span:last-child { display: none; }
  .toolbar { grid-template-columns: 1fr; gap: 9px; margin-top: 30px; padding: 9px; }
  .task-region { margin-top: 28px; }
  .list-heading { margin-bottom: 10px; }
  .column-headings { display: none; }
  .task-list { border-top: 1px solid var(--line); }
  .task-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "main arrow" "due status";
    gap: 14px 12px;
    min-height: 0;
    padding: 18px 10px 17px 19px;
  }
  .task-main { grid-area: main; min-width: 0; }
  .row-arrow { grid-area: arrow; }
  .due-cell { grid-area: due; }
  .status-cell { grid-area: status; justify-self: end; }
  .owner-cell { display: none; }
  .status-rail { top: 17px; bottom: 17px; width: 3px; }
  .task-open { font-size: 15px; }
  .task-context { margin-top: 7px; }
  .due-cell::before { content: "Due "; color: var(--muted); }
  .task-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .detail { min-height: 0; padding: 23px 21px 30px; }
  .detail h2 { margin-top: 28px; font-size: 31px; }
  .detail-body { font-size: 15px; }
  .detail-meta { gap: 20px; }
  .toast { left: 18px; right: 18px; bottom: 18px; text-align: center; }
}

@media (max-width: 380px) {
  .inbox-heading p { max-width: 210px; }
  .detail-meta { grid-template-columns: 1fr; }
  .status-field { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { transition: none; }
}
