:root {
  color-scheme: light;
  --ink: #242432;
  --muted: #777785;
  --line: #e5e5ec;
  --surface: #ffffff;
  --canvas: #f7f7fa;
  --sidebar: #252431;
  --sidebar-muted: #aaa8b8;
  --primary: #6c5ce7;
  --primary-dark: #5848d1;
  --shadow: 0 8px 28px rgba(37, 36, 49, 0.08);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.auth-screen {
  align-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(108, 92, 231, .16), transparent 30%),
    radial-gradient(circle at 84% 82%, rgba(43, 155, 165, .13), transparent 28%),
    #f5f5f9;
  display: grid;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

.auth-card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(224, 223, 234, .9);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(37, 36, 49, .14);
  justify-self: center;
  max-width: 100%;
  padding: 34px;
  width: 420px;
}

.auth-brand {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 18px;
  font-weight: 750;
  gap: 11px;
  letter-spacing: -.02em;
  margin-bottom: 37px;
}

.auth-brand > span:last-child > span { color: #8d8b99; font-weight: 450; margin-left: 3px; }
.auth-card h1 { font-size: 28px; margin-bottom: 7px; }
.auth-copy { color: var(--muted); margin-bottom: 25px; }
.auth-error { background: #fff0f0; border: 1px solid #f5d2d2; border-radius: 9px; color: #ad3f48; font-size: 12px; margin: 0 0 14px; padding: 9px 11px; }
.auth-submit { width: 100%; }
.auth-note { color: #9896a3; font-size: 10px; margin: 17px 0 0; text-align: center; }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

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

.sidebar {
  background: var(--sidebar);
  color: white;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 18px 18px;
}

.brand {
  align-items: center;
  color: white;
  display: flex;
  font-size: 18px;
  font-weight: 750;
  gap: 11px;
  letter-spacing: -0.02em;
  margin: 0 8px 38px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(145deg, #8b7cf5, #6656dd);
  border-radius: 9px;
  box-shadow: 0 7px 18px rgba(108, 92, 231, 0.35);
  display: inline-flex;
  font-size: 15px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.brand-light { color: #aaa8b8; font-weight: 450; margin-left: 3px; }

.sidebar-heading {
  align-items: center;
  color: var(--sidebar-muted);
  display: flex;
  font-size: 11px;
  font-weight: 750;
  justify-content: space-between;
  letter-spacing: 0.11em;
  padding: 0 8px 10px;
  text-transform: uppercase;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: inherit;
  display: inline-flex;
  font-size: 20px;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.icon-button:hover { background: rgba(255, 255, 255, 0.1); }
.project-list { display: grid; gap: 4px; }

.project-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: #dad9e2;
  display: flex;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  text-align: left;
  transition: 150ms ease;
  width: 100%;
}

.project-item:hover { background: rgba(255,255,255,0.06); color: white; }
.project-item.active { background: rgba(255,255,255,0.11); color: white; }

.project-icon {
  align-items: center;
  border-radius: 8px;
  color: white;
  display: flex;
  flex: 0 0 34px;
  font-size: 12px;
  font-weight: 750;
  height: 34px;
  justify-content: center;
}

.color-violet { background: #735fe5; }
.color-cyan { background: #2b9ba5; }
.color-orange { background: #da843e; }
.color-green { background: #3a9b70; }
.color-pink { background: #c65d89; }

.project-copy { display: grid; min-width: 0; }
.project-copy strong { font-size: 13px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-copy small { color: #9795a5; font-size: 11px; }

.sidebar-footer {
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.09);
  color: #92909f;
  display: flex;
  font-size: 11px;
  gap: 8px;
  margin-top: auto;
  padding: 18px 8px 2px;
}

.account-footer { gap: 9px; }
.account-avatar { background: #4a475b; border: 0; color: #e5e3ef; flex: 0 0 27px; }
.account-copy { display: grid; line-height: 1.25; min-width: 0; }
.account-copy strong { color: #dedce7; font-size: 11px; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: #8f8d9d; font-size: 9px; }
.logout-button { background: transparent; border: 0; color: #aaa8b8; font-size: 10px; margin-left: auto; padding: 5px 0 5px 5px; }
.logout-button:hover { color: white; }
.main-content { min-width: 0; overflow: hidden; padding: 32px 34px; }

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .1em; margin-bottom: 3px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(24px, 2.3vw, 32px); letter-spacing: -.035em; margin-bottom: 0; }
.project-title-row { align-items: center; display: flex; gap: 10px; }
.project-settings-button { background: transparent; border: 1px solid transparent; border-radius: 8px; color: #888694; font-size: 11px; padding: 5px 7px; }
.project-settings-button:hover { background: white; border-color: var(--line); color: var(--ink); }
.topbar-actions { align-items: center; display: flex; gap: 11px; }

.search-box {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  padding: 0 11px;
}

.search-box input { background: transparent; border: 0; height: 40px; outline: 0; width: 180px; }

.primary-button, .secondary-button, .danger-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  font-weight: 650;
  gap: 5px;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  transition: 150ms ease;
}

.primary-button { background: var(--primary); box-shadow: 0 6px 16px rgba(108,92,231,.18); color: white; }
.primary-button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.secondary-button { background: white; border-color: var(--line); color: var(--ink); }
.secondary-button:hover { background: #f4f4f8; }
.danger-button { background: #fff2f2; border-color: #f6d4d4; color: #c74343; }
.danger-button:hover { background: #ffe9e9; }

.project-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 22px;
  padding: 13px 16px;
}

.summary-copy { color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; margin-bottom: 8px; }
.summary-percent { color: var(--ink); font-weight: 700; }
.progress-track { background: #ececf2; border-radius: 10px; height: 5px; overflow: hidden; }
.progress-track progress { appearance: none; background: transparent; border: 0; display: block; height: 5px; width: 100%; }
.progress-track progress::-webkit-progress-bar { background: transparent; }
.progress-track progress::-webkit-progress-value { background: linear-gradient(90deg, #7868e8, #8a7bef); border-radius: 10px; transition: width .3s ease; }
.progress-track progress::-moz-progress-bar { background: linear-gradient(90deg, #7868e8, #8a7bef); border-radius: 10px; }

.board {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  overflow-x: auto;
  padding-bottom: 18px;
}

.board-column { min-width: 0; }
.column-header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; padding: 0 5px; }
.column-header > div { align-items: center; display: flex; gap: 8px; }
.column-header h2 { font-size: 13px; font-weight: 720; margin: 0; }
.column-dot { border-radius: 50%; height: 7px; width: 7px; }
.dot-backlog { background: #a5a5b3; }
.dot-progress { background: #6187df; }
.dot-review { background: #da994c; }
.dot-done { background: #48ac7b; }
.task-count { background: #e9e9ef; border-radius: 20px; color: #6e6e7a; font-size: 10px; font-weight: 700; min-width: 20px; padding: 2px 6px; text-align: center; }
.column-add { background: transparent; border: 0; border-radius: 6px; color: #8a8995; font-size: 19px; height: 28px; line-height: 1; width: 28px; }
.column-add:hover { background: #e9e9ef; color: var(--ink); }

.task-list {
  border: 1px solid transparent;
  border-radius: 13px;
  display: grid;
  gap: 10px;
  min-height: 146px;
  padding: 2px;
  transition: background 150ms, border-color 150ms;
}

.task-list.drag-over { background: rgba(108,92,231,.05); border-color: rgba(108,92,231,.35); }
.task-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 7px rgba(37,36,49,.025);
  cursor: grab;
  min-width: 0;
  padding: 15px;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.task-card:hover, .task-card:focus { border-color: #ccc9e7; box-shadow: var(--shadow); outline: 0; transform: translateY(-2px); }
.task-card.dragging { opacity: .42; transform: rotate(1.5deg); }
.task-card h3 { font-size: 14px; line-height: 1.4; margin: 10px 0 6px; }
.task-card p { color: var(--muted); display: -webkit-box; font-size: 12px; line-height: 1.55; margin-bottom: 16px; min-height: 37px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-card footer { align-items: center; border-top: 1px solid #eeeeF3; display: flex; justify-content: space-between; padding-top: 12px; }

.priority { border-radius: 5px; display: inline-flex; font-size: 9px; font-weight: 750; letter-spacing: .06em; padding: 3px 7px; text-transform: uppercase; }
.priority-low { background: #f0f0f4; color: #6f6f7c; }
.priority-medium { background: #edf3ff; color: #5472b2; }
.priority-high { background: #fff3e5; color: #bd7428; }
.priority-urgent { background: #ffeded; color: #c84e4e; }
.avatar { align-items: center; background: #e9e5fb; border: 2px solid white; border-radius: 50%; color: #5d4fc4; display: inline-flex; font-size: 9px; font-weight: 750; height: 27px; justify-content: center; width: 27px; }
.avatar-empty { background: #f1f1f4; color: #aaaab3; }
.due-date { color: #8b8a96; font-size: 10px; font-weight: 600; }
.due-date.overdue { color: #c84e4e; }
.drop-placeholder { align-items: center; border: 1px dashed #dad9e3; border-radius: 12px; color: #aaa9b5; display: flex; font-size: 11px; justify-content: center; min-height: 82px; }

.modal { background: white; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(20,18,35,.25); color: var(--ink); max-height: calc(100vh - 32px); max-width: calc(100vw - 32px); padding: 0; width: 620px; }
.modal::backdrop { background: rgba(22,21,31,.52); backdrop-filter: blur(3px); }
.modal form { padding: 25px; }
.modal-small { width: 460px; }
.modal-header { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 22px; }
.modal-header h2 { font-size: 22px; letter-spacing: -.025em; margin-bottom: 0; }
.modal-close { color: #777785; }
.modal-close:hover { background: #f1f1f5; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-field { display: grid; gap: 7px; margin-bottom: 17px; }
.form-field label { color: #585765; font-size: 11px; font-weight: 720; }
.form-field input, .form-field textarea, .form-field select {
  background: #fbfbfd;
  border: 1px solid #dddde5;
  border-radius: 9px;
  color: var(--ink);
  outline: 0;
  padding: 10px 11px;
  width: 100%;
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: #8a7deb; box-shadow: 0 0 0 3px rgba(108,92,231,.1); }
.modal-actions { align-items: center; display: flex; gap: 9px; justify-content: flex-end; margin-top: 7px; }
.action-spacer { flex: 1; }

.empty-state { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 60vh; text-align: center; }
.empty-state h2 { margin-bottom: 5px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.empty-icon { align-items: center; background: #e9e5fb; border-radius: 18px; color: var(--primary); display: flex; font-size: 26px; height: 66px; justify-content: center; margin-bottom: 18px; width: 66px; }

.toast { background: #262532; border-radius: 10px; bottom: 24px; box-shadow: var(--shadow); color: white; left: 50%; opacity: 0; padding: 11px 16px; pointer-events: none; position: fixed; transform: translate(-50%, 12px); transition: 180ms ease; z-index: 20; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a33f47; }
.hidden { display: none !important; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(4, 260px); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 14px 16px 10px; }
  .brand { margin: 0 0 13px; }
  .sidebar-heading { padding: 0; position: absolute; right: 16px; top: 15px; }
  .sidebar-heading > span { display: none; }
  .project-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; }
  .project-item { flex: 0 0 auto; padding: 7px 9px; width: auto; }
  .project-icon { flex-basis: 30px; height: 30px; width: 30px; }
  .project-copy small { display: none; }
  .sidebar-footer { margin-top: 9px; padding-top: 10px; }
  .main-content { padding: 21px 16px; }
  .topbar { align-items: flex-start; gap: 17px; }
  .topbar-actions { align-items: stretch; flex-direction: column-reverse; }
  .search-box input { width: 130px; }
  .primary-button { min-height: 40px; }
  .project-summary { margin-bottom: 18px; }
  .board { margin-right: -16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .modal form { padding: 20px; }
}

@media (max-width: 480px) {
  .auth-screen { padding: 14px; }
  .auth-card { border-radius: 17px; padding: 25px 21px; }
  .topbar { display: grid; }
  .topbar-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .search-box input { min-width: 0; width: 100%; }
  .primary-button { padding-inline: 10px; }
}

