/* team channels, tasks and calendar */
.channel-avatar,
.channel-head-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  flex: none;
}
.channel-head-avatar {
  width: 36px;
  height: 36px;
  font-size: 20px;
}
.channel-side-links {
  display: grid;
  gap: 2px;
  padding: 10px 8px 14px;
  border-top: 1px solid var(--border);
}
.channel-side-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.channel-side-links a:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}
.channel-messages { gap: 2px; }
.channel-message {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 4px;
  border-radius: 8px;
}
.channel-message:hover { background: rgba(31, 35, 41, .025); }
.channel-message-main { min-width: 0; flex: 1; }
.channel-message-head { display: flex; align-items: center; gap: 8px; }
.channel-message-author { font-size: 12.5px; font-weight: 650; color: var(--text); }
.channel-message-time { font-size: 10.5px; color: var(--faint); }
.channel-message-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.channel-message-text .mention {
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 3px;
  padding: 0 2px;
}
.channel-day { text-align: center; font-size: 11px; color: var(--faint); margin: 12px 0 7px; }
.channel-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; padding: 34px 16px; }
.channel-empty .icon { color: var(--faint); margin-bottom: 9px; }
.channel-empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.channel-empty-sub { font-size: 12px; }
.channel-card {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
}
.channel-card:hover { border-color: #c4d5fb; background: #fbfcff; text-decoration: none; }
.channel-card > span:not(.channel-card-icon) { min-width: 0; flex: 1; }
.channel-card > .icon { color: var(--faint); flex: none; }
.channel-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex: none;
}
.channel-card-icon.task { background: #fff3e8; color: var(--warning); }
.channel-card-title { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-card-sub { display: block; font-size: 11px; color: var(--faint); margin-top: 1px; }
.channel-compose-tools { display: flex; align-items: center; gap: 12px; margin-top: 7px; padding: 0 2px; }
.channel-compose-tools .link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11.5px; }
.channel-compose-tools .link-btn:hover { color: var(--primary); }

/* tasks */
.task-status-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-list { display: grid; gap: 8px; }
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.task-row:hover { border-color: #cbd6ea; box-shadow: 0 3px 12px rgba(31, 35, 41, .04); }
.task-row.done { opacity: .68; }
.task-check-btn {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid #c6ccd4;
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  margin-top: 1px;
  padding: 0;
}
.task-check-btn:hover { border-color: var(--primary); }
.task-check-btn.checked { background: var(--success); border-color: var(--success); }
.task-main { min-width: 0; flex: 1; }
.task-title-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.task-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 7px;
  color: var(--faint);
  font-size: 11px;
}
.task-meta > span,
.task-doc-link { display: inline-flex; align-items: center; gap: 4px; }
.task-doc-link { color: var(--primary); }
.task-doc-link:hover { text-decoration: underline; }
.task-due.overdue { color: var(--danger); font-weight: 600; }
.task-due.today { color: var(--warning); font-weight: 600; }
.task-due.soon { color: var(--warning); }
.task-actions { display: flex; align-items: center; gap: 5px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .task-row { padding: 12px; }
  .task-actions .badge { display: none; }
}

/* calendar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.calendar-month-title { font-size: 19px; font-weight: 680; margin: 0; letter-spacing: -.02em; }
.calendar-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}
.calendar-weekdays > div {
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  text-align: left;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-cell {
  min-height: 118px;
  padding: 7px;
  border-right: 1px solid #f0f2f4;
  border-bottom: 1px solid #f0f2f4;
  cursor: pointer;
  transition: background .12s ease;
}
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell:hover { background: #fbfcff; }
.calendar-cell.other-month { background: #fcfcfd; }
.calendar-cell.other-month .calendar-date { color: #c6ccd4; }
.calendar-cell.today { background: #f7faff; box-shadow: inset 0 0 0 1px #cddafd; }
.calendar-date { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.calendar-cell.today .calendar-date { color: var(--primary); }
.calendar-items { display: grid; gap: 3px; }
.calendar-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 0;
  background: var(--primary-soft);
  color: #245bdb;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 10.5px;
  text-align: left;
  overflow: hidden;
}
.calendar-item:hover { background: #dfe9ff; }
.calendar-item.task { background: #fff5e8; color: #9a5b07; }
.calendar-item.task.done { opacity: .55; text-decoration: line-through; }
.calendar-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.calendar-item-time { font-size: 9px; flex: none; opacity: .8; }
.calendar-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-more { font-size: 10px; color: var(--faint); padding: 1px 4px; }
.agenda-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2f4;
  font-size: 12.5px;
}
.agenda-row:last-child { border-bottom: 0; }
.agenda-date { flex: none; width: 72px; color: var(--faint); font-size: 11px; }
.agenda-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .calendar-cell { min-height: 82px; padding: 5px; }
  .calendar-item-time { display: none; }
  .calendar-weekdays > div { padding: 7px 5px; }
  .calendar-month-title { font-size: 16px; }
  .calendar-toolbar > .small { width: 100%; }
}

.task-check-btn.locked { border-style: dashed; color: var(--faint); cursor: default; font-size: 10px; }
.task-check-btn.locked .icon { width: 11px; height: 11px; }

/* live collaboration editor */
.live-presence { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.live-presence .avatar { border: 2px solid #fff; margin-left: -5px; }
.live-presence .avatar:first-child { margin-left: 0; }
.live-editor .editor-head { flex-wrap: wrap; }
.live-editor .editor-head-main { flex: 1; min-width: 240px; }
.live-editor .editor-status.error { color: var(--danger); }
.live-editor .editor-textarea:disabled { background: var(--surface-soft); color: var(--muted); }
.live-editor .editor-grid { min-height: calc(100vh - 210px); }

/* document templates */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.template-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; outline: none; }
.template-card:hover { border-color: var(--border-strong, #c9cdd4); }
.template-card:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.template-card.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.template-name { font-size: 13px; font-weight: 600; color: var(--text); }
.template-desc { font-size: 11px; line-height: 1.45; color: var(--muted); }
.template-del { position: absolute; top: 4px; right: 6px; width: 18px; height: 18px; line-height: 16px; text-align: center; border-radius: 50%; color: var(--faint); font-size: 14px; }
.template-del:hover { background: var(--surface-soft); color: var(--danger); }

/* voice room */
.voice-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.voice-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-secondary); background: var(--surface); }
.voice-tab:hover { border-color: var(--border-strong, #c9cdd4); color: var(--text); }
.voice-tab.active { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.voice-tab .badge { margin-left: 2px; }
.voice-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 20px; }
.voice-room-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voice-room-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--text); }
.voice-people { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 18px 0 6px; min-height: 30px; align-items: center; }
.voice-person { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); }
.voice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.voice-note { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.voice-locked { display: flex; gap: 12px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-soft); color: var(--text-secondary); }
.voice-locked-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin: 18px 0; }
.voice-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); transition: border-color .15s ease, box-shadow .15s ease; }
.voice-tile.speaking { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.voice-avatar { position: relative; display: flex; }
.voice-mic { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); }
.voice-name { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; }
.voice-sub { font-size: 11px; color: var(--muted); }
.voice-controls { display: flex; flex-wrap: wrap; gap: 10px; }
#voice-mute.muted { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.channel-voice-btn { margin-left: auto; white-space: nowrap; }
@media (max-width: 720px) {
  .voice-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .voice-card { padding: 15px; }
  .channel-voice-btn { margin-left: 0; }
}

/* task ledger table */
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.task-toolbar { flex-wrap: wrap; gap: 10px; }
.task-search { display: flex; gap: 6px; margin-left: auto; }
.task-search .input { width: 180px; height: 32px; }
.task-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.task-table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 13px; }
.task-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-soft); white-space: nowrap; }
.task-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.task-table tbody tr:last-child td { border-bottom: none; }
.task-table tbody tr:hover { background: var(--surface-soft); cursor: pointer; }
.task-table tr.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-table-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.task-table-title .task-title { font-weight: 600; }
.task-table-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.task-assignee { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.task-unassigned { color: var(--muted); font-size: 12px; }
.task-time-cell { white-space: nowrap; }
.task-time-cell > span { display: block; }
.task-elapsed { font-size: 11px; color: var(--muted); }
.task-handover { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--primary); white-space: nowrap; }
.task-table-actions { text-align: right; white-space: nowrap; }
.task-table-actions .btn { margin-left: 4px; }
.task-timeline-block { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.task-timeline-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.task-timeline-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.task-timeline { display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow-y: auto; }
.task-event { display: flex; gap: 10px; padding-left: 4px; }
.task-event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-top: 5px; flex: none; }
.task-event-dot.started, .task-event-dot.claimed { background: var(--primary); }
.task-event-dot.done { background: var(--success); }
.task-event-dot.handover { background: var(--warning); }
.task-event-dot.reopened, .task-event-dot.unassigned { background: var(--danger); }
.task-event-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.task-event-text strong { color: var(--text); font-weight: 600; }
.task-event-time { font-size: 11px; color: var(--muted); }
@media (max-width: 720px) {
  .task-search { width: 100%; margin-left: 0; }
  .task-search .input { flex: 1; width: auto; }
}
