/* Cue7 — application styles */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--er-secondary); overflow: hidden; }
body { display: flex; flex-direction: column; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

/* ============ TOP BAR ============ */
.topbar {
  height: 56px; flex: 0 0 56px;
  background: var(--er-black); color: #fff;
  display: grid; grid-template-columns: 260px 1fr auto;
  align-items: center;
  padding: 0 20px 0 0;
  border-bottom: 1px solid #ffffff12;
}
.topbar-leading {
  display: flex;
  align-items: center;
  min-width: 0;
}
.mobile-nav-btn {
  display: none;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
.mobile-nav-btn:hover,
.mobile-nav-btn.active { background: rgba(255,255,255,0.12); }
.brand {
  padding-left: 20px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.01em; font-size: 15px;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent); color: #1a0000;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}

.crumbs {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.6);
}
.crumbs .sep { opacity: 0.4; }
.crumbs .proj {
  color: #fff; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.crumbs .proj .ico {
  width: 22px; height: 22px; border-radius: 5px; background: var(--accent); color: #1a0000;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}

.top-right { display: flex; align-items: center; gap: 12px; justify-content: flex-end; min-width: 0; }
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 12px;
  width: 260px;
}
.searchbox input {
  background: transparent; border: 0; outline: none; color: #fff;
  font-size: 13px; width: 100%;
}
.searchbox input::placeholder { color: rgba(255,255,255,0.4); }
.searchbox svg { color: rgba(255,255,255,0.5); flex: 0 0 auto; }

.user-switcher {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.user-switcher:hover { background: rgba(255,255,255,0.1); }
.user-switcher select {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  cursor: pointer; border: 0;
}
.user-switcher .av { border-color: var(--er-black); }

.av {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
  border: 2px solid var(--er-black);
  user-select: none;
}
.av.a { background: #111; color: #fff; }
.av.b { background: var(--accent); color: #1a0000; }
.av.c { background: #4b5563; }
.av.d { background: #10b981; }
.av.e { background: #7c3aed; }
.av.f { background: #f59e0b; color: #1a0000; }

.av-stack { display: flex; }
.av-stack .av { margin-left: -6px; }
.av-stack .av:first-child { margin-left: 0; }

/* ============ WORKSPACE (sidebar + main) ============ */
.workspace { flex: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 0; }

.sidebar {
  background: #fff;
  border-right: 1px solid var(--er-border);
  padding: 0;
  overflow: hidden;
  display: block;
}
.sidebar-panel {
  height: 100%;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 24px;
}
.side-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.side-mobile-head .brand { padding-left: 0; }
.side-mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  color: var(--er-ink);
  border: 1px solid var(--er-border);
  background: #fff;
}
.side-section h6 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-foreground); padding: 0 8px 8px; margin: 0;
}
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--er-ink);
  cursor: pointer;
  width: 100%; text-align: left; border: 0; background: transparent;
}
.side-item:hover { background: var(--er-muted); }
.side-item.active { background: var(--er-ink); color: #fff; }
.side-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.side-item .count { margin-left: auto; font-size: 11px; color: var(--muted-foreground); }
.side-item.active .count { color: rgba(255,255,255,0.7); }
.side-item .badge {
  margin-left: auto;
  background: var(--er-accent-10); color: var(--accent);
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 9999px;
}

.side-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px dashed var(--er-border); border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted-foreground);
  width: 100%; text-align: left;
}
.side-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============ MAIN ============ */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.project-head {
  padding: 20px 28px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.project-head h1 {
  font-size: 26px; letter-spacing: -0.02em; margin: 0;
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.project-head h1 .ic {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: #1a0000;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.proj-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-size: 13px; font-weight: 600;
  border-radius: 7px;
  transition: var(--transition-smooth);
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--accent); color: #1a0000; box-shadow: 0 0 20px hsl(0 100% 71% / 0.25); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-dark { background: var(--er-ink); color: #fff; }
.btn-dark:hover { background: var(--accent); color: #1a0000; }
.btn-ghost { color: var(--er-ink); border: 1px solid var(--er-border); background: #fff; }
.btn-ghost:hover { border-color: var(--er-ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }

.tabs {
  padding: 16px 28px 0;
  display: flex; gap: 4px; border-bottom: 1px solid var(--er-border);
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--muted-foreground);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; background: transparent; border-top: 0; border-left: 0; border-right: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}
.tab.active { color: var(--er-ink); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--er-ink); }
.tab.disabled { cursor: not-allowed; opacity: 0.45; }
.tab.disabled:hover { color: var(--muted-foreground); }

.toolbar {
  padding: 14px 28px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--er-border);
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.toolbar-spacer { flex: 1; min-width: 12px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  font-size: 12px; font-weight: 600; color: var(--er-ink);
  border: 1px solid var(--er-border); border-radius: 6px; background: #fff;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip-btn:hover { border-color: var(--er-ink); }
.chip-btn.active { background: var(--er-ink); color: #fff; border-color: var(--er-ink); }
.chip-btn .x { color: var(--accent); }

/* ============ BOARD ============ */
.board-wrap {
  flex: 1; overflow: auto; padding: 20px 28px;
  background: #fbfbfc;
}
.board {
  display: flex; gap: 14px; align-items: flex-start;
  min-height: 100%;
  min-width: min-content;
}
.column {
  flex: 0 0 300px; width: 300px;
  background: #f6f7f8; border-radius: 12px;
  display: flex; flex-direction: column; max-height: 100%;
}
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
}
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.col-head .col-name {
  flex: 1;
  font-family: var(--font-ui-lausanne);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: 0;
  color: #1d1f21;
  padding: 0;
  margin-left: 0;
}
.col-head .count {
  color: #7d838f;
  font-family: var(--font-ui-lausanne);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  padding: 0;
  background: transparent;
}

.cards {
  flex: 1; overflow-y: auto; padding: 0 12px 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 80px;
}
.cards.drag-over { background: #f0f2f4; }

.card {
  background: #fff; border: 1px solid #d9dde3;
  border-radius: 12px; padding: 12px 14px 10px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: grab;
  transition: border-color .2s var(--ease-smooth), transform .2s var(--ease-smooth), box-shadow .2s var(--ease-smooth);
  box-shadow: 0 1px 2px rgba(17,24,39,0.04);
}
.card:hover { border-color: #cfd5dd; box-shadow: 0 2px 6px rgba(17,24,39,0.06); }
.card.dragging { opacity: 0.4; transform: rotate(2deg); cursor: grabbing; }

.card .row1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-ui-lausanne);
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  padding: 3px 8px;
  border-radius: 6px;
}
.tag.p0 { background: #23262d; color: #fff; }
.tag.p1 { background: #fff1f1; color: #d95c66; }
.tag.p2 { background: #fff6df; color: #9a7628; }
.tag.p3 { background: #f1f2f4; color: #6d7480; }
.tag.label { background: #f3f4f6; color: #6d7480; }

.card h5 {
  margin: 0;
  font-family: var(--font-ui-lausanne);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: #1d1f21;
  cursor: pointer;
  letter-spacing: 0;
}
.card .meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-ui-lausanne);
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  color: #6f7782;
  gap: 8px;
  letter-spacing: 0;
}
.card .meta .left { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .meta .left svg { color: #9ba1ac; }
.card .meta .due {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-ui-lausanne);
  font-size: 12px;
  line-height: 18px;
  padding: 2px 6px; border-radius: 5px; background: #f3f4f6; color: #5f6672;
  font-weight: 400;
}
.card .meta .due.overdue { background: var(--er-accent-10); color: var(--accent); }
.card .meta .count-sub {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-ui-lausanne);
  font-size: 12px;
  line-height: 18px;
  color: #8b919b;
}
.card .avs { display: inline-flex; }
.card .avs .av { width: 18px; height: 18px; font-size: 8px; border: 1.5px solid #fff; margin-left: -5px; }
.card .avs .av:first-child { margin-left: 0; }

.progress { height: 3px; background: #eceef1; border-radius: 9999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); }

.add-card {
  padding: 8px 6px 2px;
  font-family: var(--font-ui-lausanne);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: #6c7380;
  border-radius: 6px; text-align: left; width: 100%;
}
.add-card:hover { background: transparent; color: #40464f; }

.empty-state {
  padding: 60px 28px; text-align: center; color: var(--muted-foreground);
}
.empty-state strong { display: block; font-size: 15px; color: var(--er-ink); margin-bottom: 6px; }

/* ============ DETAIL DRAWER ============ */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease-smooth);
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 100vw; z-index: 100;
  background: #fff; box-shadow: -10px 0 40px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform .3s var(--ease-smooth);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  padding: 18px 24px; border-bottom: 1px solid var(--er-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.drawer-head .col-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--er-muted); padding: 4px 10px; border-radius: 9999px;
  font-size: 12px; font-weight: 600;
}
.drawer-head .col-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.drawer-head .close {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center; color: #666;
}
.drawer-head .close:hover { background: var(--er-muted); color: var(--accent); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-foreground);
}
.field input.title-input {
  font-family: var(--font-ui-lausanne);
  font-size: 24px; font-weight: 500; letter-spacing: 0; line-height: 32px;
  border: 0; outline: none; padding: 8px 0; background: transparent;
  color: var(--er-ink); width: 100%;
}
.field input.title-input:focus { border-bottom: 2px solid var(--accent); }

.field-row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.field-row label { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }

.drawer select, .drawer input[type=date], .drawer input[type=text] {
  padding: 8px 10px; border: 1px solid var(--er-border); border-radius: 6px;
  font-size: 13px; background: #fff; outline: none;
}
.drawer select:focus, .drawer input:focus, .drawer textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--er-accent-10);
}

textarea.desc {
  width: 100%; min-height: 120px;
  border: 1px solid var(--er-border); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; line-height: 1.55; resize: vertical;
  font-family: var(--font-ui-lausanne); font-size: 14px; line-height: 22px; letter-spacing: 0;
  outline: none; color: var(--er-ink);
}

.assignee-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.assignee-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 9999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--er-border); background: #fff; color: #333;
  cursor: pointer;
}
.assignee-pill.selected { border-color: var(--accent); background: var(--er-accent-10); color: var(--accent); }
.assignee-pill .av { width: 20px; height: 20px; font-size: 9px; border: 0; }

.checklist { display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.check-row:hover { background: var(--er-muted); }
.check-row input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.check-row input[type=text] {
  flex: 1; border: 0; background: transparent; outline: none; font-size: 13px;
  color: var(--er-ink);
}
.check-row.done input[type=text] { text-decoration: line-through; color: #999; }
.check-row .rm { opacity: 0; color: #999; padding: 4px; }
.check-row:hover .rm { opacity: 1; }
.check-row .rm:hover { color: var(--accent); }
.add-check-row {
  padding: 6px 8px; font-size: 12px; color: var(--muted-foreground); font-weight: 600;
  text-align: left; border-radius: 6px; width: 100%;
}
.add-check-row:hover { background: var(--er-muted); color: var(--accent); }

.progress-summary {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted-foreground); font-weight: 600;
}
.progress-summary .progress { flex: 1; }

.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px;
}
.comment .bubble {
  background: var(--er-secondary);
  border-radius: 8px; padding: 8px 12px;
}
.comment .bubble .comment-meta {
  font-family: var(--font-ui-lausanne);
  font-weight: 400;
  letter-spacing: 0;
}
.comment .bubble .author { font-size: 12px; font-weight: 400; color: var(--er-ink); }
.comment .bubble .time { font-size: 12px; color: #7a7a7a; margin-left: 6px; font-weight: 400; }
.comment .bubble .body {
  font-family: var(--font-ui-lausanne);
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0;
  color: var(--er-ink);
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
}

.comment-compose {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: flex-start;
}
.comment-compose textarea {
  min-height: 60px;
  border: 1px solid var(--er-border); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; line-height: 22px;
  font-family: var(--font-ui-lausanne); letter-spacing: 0;
  outline: none; resize: vertical; width: 100%;
  color: var(--er-ink);
}
.comment-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--er-accent-10); }
.comment-compose .actions { grid-column: 2; display: flex; justify-content: flex-end; margin-top: 6px; }

.drawer-foot {
  padding: 14px 24px; border-top: 1px solid var(--er-border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--er-secondary);
}
.danger {
  color: var(--accent); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.danger:hover { text-decoration: underline; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--er-ink); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease-smooth), transform .25s var(--ease-smooth);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .accent { color: var(--accent); }
.toast.error { background: var(--er-destructive); }

/* ============ VIEW WRAP (list, calendar, dashboard) ============ */
.view-wrap {
  flex: 1; overflow: auto; padding: 24px 28px;
  background: var(--er-secondary);
}

/* ============ LIST VIEW ============ */
.list-view {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--er-border);
  overflow: hidden;
}
.list-head, .list-row {
  display: grid;
  grid-template-columns: 76px 1fr 120px 140px 96px 48px;
  align-items: center;
  padding: 9px 16px;
  gap: 12px;
}
.list-head {
  background: var(--er-muted);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--er-border);
}
.list-row {
  border-bottom: 1px solid var(--er-border);
  cursor: pointer; font-size: 13px; color: var(--er-ink);
  transition: background .12s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--er-secondary); }
.list-row.done .lh-title { text-decoration: line-through; color: var(--muted-foreground); }
.lh-title {
  font-family: var(--font-ui-lausanne);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: #1d1f21;
  letter-spacing: 0;
}
.lh-project,
.lh-due,
.proj-dot-label {
  font-family: var(--font-ui-lausanne);
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  letter-spacing: 0;
}
.lh-due.overdue { color: var(--accent); font-weight: 600; }
.lh-assignee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lh-assignee-name { display: none; }
.status-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 9999px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.proj-dot-label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-dot-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }

/* ============ CALENDAR VIEW ============ */
.cal-view { display: flex; flex-direction: column; gap: 16px; }
.cal-month-shell {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-gutter: stable both-edges;
}
.cal-nav {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-radius: 10px; border: 1px solid var(--er-border);
  padding: 10px 16px;
}
.cal-nav-title {
  font-size: 15px; font-weight: 700; flex: 1; text-align: center; color: var(--er-ink);
}
.cal-nav-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1; color: var(--er-ink);
  border: 1px solid var(--er-border); background: #fff; cursor: pointer;
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-month {
  min-width: 1225px;
  background: #fff; border-radius: 10px; border: 1px solid var(--er-border); overflow: hidden;
}
.cal-day-headers {
  display: grid; grid-template-columns: repeat(7, minmax(175px, 1fr));
  border-bottom: 1px solid var(--er-border);
}
.cal-day-hdr {
  padding: 8px 8px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(175px, 1fr));
  grid-auto-rows: minmax(96px, auto);
}
.cal-cell {
  min-width: 0;
  min-height: 96px;
  padding: 8px 8px 6px;
  border-right: 1px solid var(--er-border);
  border-bottom: 1px solid var(--er-border);
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.empty { background: var(--er-secondary); }
.cal-cell.today .cal-day-num {
  background: var(--accent); color: #fff; border-radius: 50%;
}
.cal-day-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; font-size: 12px; font-weight: 600; color: var(--er-ink);
  margin-bottom: 3px;
}
.cal-task {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 12px; line-height: 16px; font-weight: 500;
  background: var(--er-accent-10); color: var(--accent);
  border-left: 2px solid var(--accent);
  padding: 3px 6px; border-radius: 0 3px 3px 0;
  margin-bottom: 3px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-task:hover { background: var(--er-accent-20); }
.cal-task.done {
  background: var(--er-muted); color: var(--muted-foreground);
  border-left-color: var(--muted-foreground); text-decoration: line-through;
}
.cal-more { font-size: 10px; color: var(--muted-foreground); font-weight: 600; padding: 1px 4px; }
.cal-agenda {
  display: none;
  flex-direction: column;
  gap: 12px;
}
.cal-agenda-day,
.cal-agenda-empty {
  background: #fff;
  border: 1px solid var(--er-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.cal-agenda-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cal-agenda-day-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--er-ink);
}
.cal-agenda-day-count {
  font-size: 12px;
  color: var(--muted-foreground);
}
.cal-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cal-agenda-task {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--er-border);
  border-radius: 10px;
  background: #fff;
}
.cal-agenda-task:hover { border-color: var(--accent); }
.cal-agenda-task.done { opacity: 0.7; }
.cal-agenda-task-title {
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--er-ink);
}
.cal-agenda-task-meta {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted-foreground);
}
.cal-no-date-mobile { display: none; }
.cal-no-date {
  background: #fff; border-radius: 10px; border: 1px solid var(--er-border); padding: 16px 20px;
}
.cal-no-date h4 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground); margin-bottom: 10px;
}
.cal-no-date-tasks { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-task-pill {
  background: var(--er-muted); color: var(--er-ink);
  font-size: 12px; font-weight: 500; padding: 4px 12px;
  border-radius: 9999px; cursor: pointer; border: 1px solid var(--er-border);
}
.cal-task-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ============ DASHBOARD VIEW ============ */
.dash-view { display: flex; flex-direction: column; gap: 20px; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  background: #fff; border-radius: 10px; border: 1px solid var(--er-border);
  padding: 20px 22px;
}
.stat-value { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted-foreground); font-weight: 600; margin-top: 6px; }
.dash-completion {
  background: #fff; border-radius: 10px; border: 1px solid var(--er-border);
  padding: 16px 22px; display: flex; flex-direction: column; gap: 10px;
}
.dash-completion-text {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--er-ink);
}
.dash-sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dash-section {
  background: #fff; border-radius: 10px; border: 1px solid var(--er-border);
  padding: 18px 20px;
}
.dash-section h3 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-foreground); margin-bottom: 14px;
}
.dash-bar-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.dash-bar-row:last-child { margin-bottom: 0; }
.dash-bar-label {
  font-size: 12px; font-weight: 600; color: var(--er-ink);
  width: 80px; flex: 0 0 80px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.dash-bar-track {
  flex: 1; height: 7px; background: var(--er-muted); border-radius: 9999px; overflow: hidden;
}
.dash-bar-fill {
  height: 100%; border-radius: 9999px;
  transition: width .4s var(--ease-smooth);
  min-width: 0;
}
.dash-bar-count {
  font-size: 12px; font-weight: 700; color: var(--er-ink);
  min-width: 30px; text-align: right;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; border: 2px solid transparent; background-clip: padding-box; }

/* Responsive */
@media (max-width: 1100px) {
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-sections { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  html, body { overflow: auto; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 57px 0 0 0;
    background: rgba(15, 23, 42, 0.32);
    border-right: 0;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease-smooth);
  }
  .sidebar.mobile-open {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-panel {
    width: min(86vw, 320px);
    max-width: 320px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
    transform: translateX(-100%);
    transition: transform .25s var(--ease-smooth);
  }
  .sidebar.mobile-open .sidebar-panel { transform: translateX(0); }
  .side-mobile-head { display: flex; }
  .mobile-nav-btn { display: inline-flex; }
  .topbar {
    height: auto;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 10px 12px;
    align-items: center;
  }
  .brand { padding-left: 12px; }
  .crumbs { display: none; }
  .top-right {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .searchbox {
    order: 1;
    width: 100%;
    flex: 1 1 100%;
  }
  .user-switcher { order: 2; }
  .top-right .av-stack { order: 3; }
  .project-head,
  .tabs,
  .toolbar,
  .view-wrap,
  .board-wrap { padding-left: 16px; padding-right: 16px; }
  .project-head { padding-top: 16px; gap: 14px; }
  .project-head h1 { font-size: 24px; }
  .proj-actions { width: 100%; justify-content: flex-start; }
  .proj-actions .av-stack { display: none; }
  .toolbar-spacer { display: none; }
  .drawer { width: min(100vw, 560px); }
  .drawer-foot { flex-wrap: wrap; gap: 10px; }
  .comment-compose { grid-template-columns: 1fr; }
  .comment-compose .actions { grid-column: auto; justify-content: flex-start; }
  .board { scroll-snap-type: x proximity; }
  .column {
    flex: 0 0 min(82vw, 300px);
    width: min(82vw, 300px);
    scroll-snap-align: start;
  }
  .list-head { display: none; }
  .list-view {
    background: transparent;
    border: 0;
    overflow: visible;
  }
  .list-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "title title"
      "priority status"
      "project due"
      "assignee assignee";
    padding: 14px 16px;
    gap: 12px 14px;
    background: #fff;
    border: 1px solid var(--er-border);
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .list-row:last-child { margin-bottom: 0; }
  .lh-title { grid-area: title; }
  .lh-priority { grid-area: priority; }
  .lh-status { grid-area: status; }
  .lh-project { grid-area: project; }
  .lh-due { grid-area: due; }
  .lh-assignee { grid-area: assignee; }
  .lh-priority,
  .lh-status,
  .lh-project,
  .lh-due,
  .lh-assignee {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
  }
  .lh-priority::before,
  .lh-status::before,
  .lh-project::before,
  .lh-due::before,
  .lh-assignee::before {
    content: attr(data-label);
    font-size: 11px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
  }
  .lh-assignee-name {
    display: inline;
    font-size: 13px;
    line-height: 18px;
    color: var(--er-ink);
  }
  .dash-bar-label {
    width: 96px;
    flex-basis: 96px;
  }
}

@media (max-width: 700px) {
  .top-right .av-stack,
  .user-switcher-label { display: none; }
  .project-head h1 { font-size: 22px; }
  .project-head h1 .ic { width: 32px; height: 32px; font-size: 13px; }
  .tabs,
  .toolbar {
    overflow: visible;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .tabs { padding-bottom: 8px; }
  .tabs,
  .toolbar,
  .view-wrap,
  .board-wrap { padding-left: 14px; padding-right: 14px; }
  .board {
    min-width: 0;
    flex-direction: column;
    gap: 12px;
  }
  .column {
    width: 100%;
    flex-basis: auto;
  }
  .cal-view { gap: 12px; }
  .cal-nav { padding: 8px 12px; }
  .cal-nav-title { font-size: 16px; }
  .cal-month-shell { display: none; }
  .cal-agenda { display: flex; }
  .cal-no-date:not(.cal-no-date-mobile) { display: none; }
  .cal-no-date-mobile { display: block; }
  .dash-stats { grid-template-columns: 1fr; }
  .stat-card,
  .dash-completion,
  .dash-section { padding: 16px; }
  .dash-bar-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
  }
  .dash-bar-label {
    width: auto;
    flex-basis: auto;
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .topbar { padding: 10px; }
  .mobile-nav-btn { margin-left: 0; }
  .brand { padding-left: 10px; font-size: 14px; }
  .project-head,
  .tabs,
  .toolbar,
  .view-wrap,
  .board-wrap { padding-left: 12px; padding-right: 12px; }
  .btn { padding: 0 12px; }
  .project-head .btn,
  .project-head .btn-sm { min-height: 34px; }
  .list-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "priority"
      "status"
      "project"
      "due"
      "assignee";
  }
  .cal-agenda-task {
    flex-direction: column;
    align-items: flex-start;
  }
  .cal-no-date,
  .cal-agenda-day,
  .cal-agenda-empty { padding: 12px 14px; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
