*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #111;
  -webkit-font-smoothing: antialiased;
}
.timeline {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 0;
}
@media (min-width: 768px) {
  .timeline { max-width: 800px; }
}
@media (min-width: 1200px) {
  .timeline { max-width: 960px; }
}
.message-row {
  display: flex;
  align-items: flex-start;
  padding: 3px 16px 3px 8px;
  position: relative;
}
.avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #d4d4d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.87);
  margin-right: 8px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.message-content {
  flex: 1;
  min-width: 0;
  position: relative;
}
.text-bubble {
  background: #fff;
  border-radius: 4px 18px 18px 18px;
  padding: 8px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.07);
  position: relative;
}
.sender-name {
  font-size: 12px;
  font-weight: 600;
  color: #523D8A;
  margin-bottom: 2px;
}
.text-bubble .message-text {
  font-size: 15px;
  line-height: 1.4;
  color: #0F2336;
  word-break: break-word;
}
.html-message-content {
  max-height: 30vh;
  overflow: auto;
}
.html-message-content > :first-child {
  margin-top: 0;
}
.html-message-content > :last-child {
  margin-bottom: 0;
}
.html-message-content img,
.html-message-content iframe,
.html-message-content table,
.html-message-content pre {
  max-width: 100%;
}
.html-message-content table {
  display: block;
  overflow-x: auto;
}
.html-message-content pre {
  overflow: auto;
}
.text-bubble .message-text strong {
  font-weight: 700;
}
.timestamp-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.timestamp {
  font-size: 10px;
  color: #3D6A8F;
}
.structure-card {
  background: #fff;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  position: relative;
}
.card-header {
  display: flex;
  align-items: center;
  padding: 8px 12px 6px;
  gap: 8px;
}
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.category-pill .material-symbols-outlined {
  font-size: 13px;
}
.card-header .sender-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}
.card-body {
  padding: 0 12px 8px;
}
.task-title,
.event-title {
  font-weight: 600;
  font-size: 14px;
  color: #111;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #757575;
}
.meta-item .material-symbols-outlined {
  font-size: 14px;
  color: #9e9e9e;
}
.event-dates {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.date-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.date-row .date-label {
  width: 38px;
  font-size: 11px;
  font-weight: 500;
  color: #9e9e9e;
}
.date-row .material-symbols-outlined {
  font-size: 14px;
  color: #9e9e9e;
}
.date-row .date-value {
  color: #616161;
}
.approval-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}
.approval-info-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.approval-info-row .material-symbols-outlined {
  font-size: 14px;
  color: #9e9e9e;
}
.approval-info-row .info-label {
  color: #9e9e9e;
}
.approval-info-row .info-value {
  font-weight: 500;
  color: #111;
}
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.approval-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1.5px solid;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.approval-btn:hover {
  filter: brightness(0.95);
}
.checklist-section {
  border-top: 0.5px solid #e0e0e0;
  padding: 0 8px;
}
.checklist-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 4px;
}
.checklist-header .material-symbols-outlined {
  font-size: 16px;
  color: #757575;
}
.checklist-header .checklist-label {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #616161;
}
.checklist-header .checklist-count {
  font-size: 11px;
  font-weight: 600;
  color: #9e9e9e;
}
.checklist-header .checklist-count.all-done {
  color: #43a047;
}
.checklist-progress {
  margin: 0 4px;
  height: 3px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
}
.checklist-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: #42a5f5;
  transition: width 0.3s ease;
}
.checklist-progress-bar.all-done {
  background: #66bb6a;
}
.checklist-items {
  padding: 8px 4px 4px;
}
.checklist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  cursor: pointer;
}
.checklist-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #43a047;
  cursor: pointer;
  flex-shrink: 0;
}
.checklist-row .checklist-desc {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.87);
}
.checklist-row .checklist-desc.checked {
  text-decoration: line-through;
  color: #9e9e9e;
}
.card-text-content {
  padding: 0 12px 6px;
  font-size: 15px;
  line-height: 1.4;
  color: #0F2336;
  word-break: break-word;
}
.card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 8px;
}
.reactions-wrapper {
  padding-bottom: 16px;
  position: relative;
}
.reactions-row {
  position: absolute;
  bottom: 0;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  cursor: pointer;
}
.reaction-chip .reaction-count {
  font-size: 12px;
  font-weight: 600;
  color: #616161;
}
.reply-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  background: #1e88e5;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.reply-badge .material-symbols-outlined {
  font-size: 10px;
}
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 20;
  vertical-align: middle;
}
.hover-toolbar {
  position: absolute;
  top: -14px;
  right: 16px;
  display: flex;
  gap: 2px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}
.message-row:hover .hover-toolbar,
.reply-item:hover .hover-toolbar,
.hover-toolbar.toolbar-active {
  opacity: 1;
  pointer-events: auto;
}
.hover-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #616161;
  transition: background 0.12s;
}
.hover-btn:hover {
  background: #f0f0f0;
}
.hover-btn .material-symbols-outlined {
  font-size: 18px;
}
.reaction-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 4px;
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 20;
}
.reaction-popup-emoji {
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s ease;
  line-height: 1;
  padding: 2px;
}
.reaction-popup-emoji:hover {
  transform: scale(1.3);
}
.options-menu-wrapper {
  position: relative;
}
.options-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 120px;
  overflow: hidden;
  z-index: 20;
}
.options-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.options-menu-item:hover {
  background: #f5f5f5;
}
.options-menu-item.danger {
  color: #F44336;
}
.options-menu-item .material-symbols-outlined {
  font-size: 16px;
}
.file-attachments {
  margin-top: 6px;
}
.image-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.image-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-thumb-more {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}
.lightbox-close .material-symbols-outlined {
  font-size: 24px;
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav:hover {
  background: rgba(255,255,255,0.3);
}
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-nav .material-symbols-outlined {
  font-size: 24px;
}
.lightbox-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
}
.lightbox-filename {
  position: absolute;
  top: 14px;
  left: 16px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
  color: #1e88e5;
  text-decoration: none;
}
.file-item:hover {
  text-decoration: underline;
}
.file-item .material-symbols-outlined {
  font-size: 16px;
  color: #9e9e9e;
}
.quill-content .ql-editor {
  padding: 0;
  font-size: 15px;
  line-height: 1.4;
  color: #0F2336;
}
.quill-content .ql-container.ql-bubble {
  border: none;
}
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0;
  color: #757575;
  font-size: 14px;
}
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0;
  color: #F44336;
  font-size: 14px;
}

/* ── Task inline editing ─────────────────────────────────────── */
.task-clickable {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}
.task-clickable:hover {
  background: rgba(0,0,0,0.04);
}
.dropdown-popover {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  min-width: 160px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}
.dropdown-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-popover-item:hover {
  background: #f5f5f5;
}
.dropdown-popover-item.selected {
  font-weight: 600;
  color: #1e88e5;
}
.dropdown-popover-item .user-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.dropdown-popover-item .user-initials-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d4d4d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(0,0,0,0.87);
  flex-shrink: 0;
}
.flatpickr-wrapper {
  position: absolute;
  z-index: 30;
}

/* ── Edit hint ─────────────────────────────────────────────── */
.text-content-wrapper,
.card-text-wrapper {
  position: relative;
}
.edit-hint {
  display: none;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}
.text-content-wrapper:hover .edit-hint,
.card-text-wrapper:hover .edit-hint {
  display: block;
}

/* ── Quill edit mode ──────────────────────────────────────── */
.quill_container {
  border-radius: 6px;
  padding: 4px;
  background: #fff;
}
.bootstrap-input-border-main {
  border: 1.5px solid #1e88e5;
}
.bootstrap-input-border-main:focus-within {
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.15);
}
.quill_container .ql-editor {
  min-height: 40px;
}
.quill_container .ql-container.ql-bubble {
  border: none;
}
.quill-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 4px 2px;
}
.quill-save-btn,
.quill-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.quill-save-btn {
  background: #1e88e5;
  color: #fff;
}
.quill-save-btn:hover {
  background: #1976d2;
}
.quill-cancel-btn {
  background: #f5f5f5;
  color: #616161;
}
.quill-cancel-btn:hover {
  background: #e0e0e0;
}
.quill-save-btn .material-symbols-outlined,
.quill-cancel-btn .material-symbols-outlined {
  font-size: 14px;
}

/* ── Replies modal ───────────────────────────────────────── */
.replies-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.replies-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 90vw;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.replies-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e0e0e0;
}
.replies-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}
.replies-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #616161;
  transition: background 0.12s;
}
.replies-modal-close:hover {
  background: #f0f0f0;
}
.replies-modal-close .material-symbols-outlined {
  font-size: 20px;
}
.replies-modal-body {
  overflow-y: auto;
  padding: 16px;
  flex: 1;
}
.replies-parent {
  padding-bottom: 8px;
}
.replies-parent .message-row {
  padding: 3px 0;
}
.replies-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.replies-divider-line {
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}
.replies-divider-text {
  font-size: 12px;
  font-weight: 500;
  color: #9e9e9e;
  white-space: nowrap;
}
.replies-thread {
  padding-left: 20px;
  border-left: 2px solid #e0e0e0;
  margin-left: 16px;
}
.reply-item {
  display: flex;
  align-items: flex-start;
  padding: 6px 16px 6px 0;
  gap: 8px;
  position: relative;
}
.reply-item .avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 10px;
}
.reply-content {
  flex: 1;
  min-width: 0;
}
.reply-bubble {
  background: #f8f9fa;
}
.reply-card {
  background: #f8f9fa;
}
.reply-badge:hover {
  background: #1565c0;
}

/* ── Color picker ────────────────────────────────────────── */
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}
.dropdown-popover-item .color-swatch {
  margin: 0 auto;
}
.category-pill.task-clickable {
  cursor: pointer;
  transition: filter 0.12s;
}
.category-pill.task-clickable:hover {
  filter: brightness(0.9);
  background: inherit;
}

/* ── Checklist add item ──────────────────────────────────── */
.checklist-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 8px;
}
.checklist-add-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  outline: none;
  color: #111;
}
.checklist-add-input:focus {
  border-color: #1e88e5;
}
.checklist-add-btn,
.checklist-cancel-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.checklist-add-btn {
  background: #1e88e5;
  color: #fff;
}
.checklist-add-btn:hover {
  background: #1976d2;
}
.checklist-cancel-btn {
  background: #f5f5f5;
  color: #616161;
}
.checklist-cancel-btn:hover {
  background: #e0e0e0;
}
.checklist-add-btn .material-symbols-outlined,
.checklist-cancel-btn .material-symbols-outlined {
  font-size: 16px;
}
.checklist-add-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: #1e88e5;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}
.checklist-add-trigger:hover {
  text-decoration: underline;
}
.checklist-add-trigger .material-symbols-outlined {
  font-size: 16px;
}

/* ── Timeline wrapper & message input bar ────────────────── */
.timeline-wrapper {
  position: relative;
}

.timeline-bottom-spacer {
  height: 80px;
}

.message-input-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 600px;
  width: 100%;
  padding: 8px 16px;
  background: transparent;
  z-index: 100;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .message-input-bar { max-width: 800px; }
}
@media (min-width: 1200px) {
  .message-input-bar { max-width: 960px; }
}

/* ── Reply input in modal ────────────────────────────────── */
.reply-input-wrapper {
  padding: 8px 16px;
  border-top: 1px solid #e0e0e0;
  background: #f5f5f5;
}

/* ── Compose shared styles (main + reply) ────────────────── */
.compose-row {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  padding: 0;
}
.compose-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
}
.compose-editor-container {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}
.compose-editor-container:focus-within {
}
.compose-editor-container .ql-editor {
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1.4;
}
.compose-editor-container .ql-container.ql-bubble {
  border: none;
}
.reply-input-wrapper .compose-editor-container .ql-editor {
  min-height: 32px;
  max-height: 100px;
}
.compose-send-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #1e88e5;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
}
.compose-send-btn:hover {
  background: #1976d2;
}
.compose-send-btn:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}
.compose-send-btn .material-symbols-outlined {
  font-size: 18px;
}
.reply-input-wrapper .compose-send-btn {
  width: 32px;
  height: 32px;
}
.reply-input-wrapper .compose-send-btn .material-symbols-outlined {
  font-size: 16px;
}

/* ── Plus menu ───────────────────────────────────────────── */
.compose-menu-wrapper {
  position: relative;
}
.compose-plus-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: #616161;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
}
.compose-plus-btn:hover {
  background: #f0f0f0;
}
.compose-plus-btn .material-symbols-outlined {
  font-size: 20px;
}
.compose-options-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  min-width: 150px;
  overflow: hidden;
  z-index: 20;
}
.compose-options-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.compose-options-menu button:hover {
  background: #f5f5f5;
}
.compose-options-menu button .material-symbols-outlined {
  font-size: 16px;
  color: #757575;
}

/* ── Compose panels (task, event, approval, checklist) ──── */
.compose-panel {
  border-bottom: 1px solid #e8e8e8;
  border-left: 3px solid #ccc;
  margin: 0;
  overflow: hidden;
}
.compose-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
}
.compose-panel-label {
  font-size: 12px;
  font-weight: 600;
}
/* Task — warm blue */
.compose-panel--task { border-left-color: #4a90d9; }
.compose-panel--task .compose-panel-header { background: #e3edfa; }
.compose-panel--task .compose-panel-label { color: #2c5f9e; }
/* Event — soft coral */
.compose-panel--event { border-left-color: #e8845a; }
.compose-panel--event .compose-panel-header { background: #fce8df; }
.compose-panel--event .compose-panel-label { color: #b85a30; }
/* Approval — warm amber */
.compose-panel--approval { border-left-color: #e6a934; }
.compose-panel--approval .compose-panel-header { background: #fcf0d4; }
.compose-panel--approval .compose-panel-label { color: #9a6f10; }
/* ToDo — fresh teal */
.compose-panel--todo { border-left-color: #4db89a; }
.compose-panel--todo .compose-panel-header { background: #ddf2ec; }
.compose-panel--todo .compose-panel-label { color: #2a7a60; }
.compose-panel-close {
  border: none;
  background: none;
  font-size: 16px;
  color: #757575;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.compose-panel-close:hover {
  color: #333;
}
.compose-panel-fields {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compose-field {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: #111;
  height: 30px;
}
.compose-field:focus {
  border-color: #1e88e5;
}
.compose-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.compose-field-label {
  font-size: 11px;
  font-weight: 500;
  color: #9e9e9e;
  white-space: nowrap;
}
.compose-select {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: #111;
  height: 30px;
  cursor: pointer;
}
.compose-select:focus {
  border-color: #1e88e5;
}
.compose-date-wrapper {
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  height: 30px;
  display: flex;
  align-items: center;
}
.compose-date-wrapper:hover {
  border-color: #bdbdbd;
}
.compose-date-value {
  color: #616161;
  font-size: 12px;
}
.compose-icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9e9e9e;
  flex-shrink: 0;
}
.compose-icon-btn:hover {
  background: #f0f0f0;
  color: #F44336;
}
.compose-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: #1e88e5;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
}
.compose-add-btn:hover {
  text-decoration: underline;
}
.compose-uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid #e8e8e8;
}
.compose-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: #e3f2fd;
  border-radius: 12px;
  font-size: 12px;
  color: #1565c0;
}
.compose-file-remove {
  background: none;
  border: none;
  color: #1565c0;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  opacity: 0.6;
}
.compose-file-remove:hover {
  opacity: 1;
}
.compose-file-uploading {
  opacity: 0.6;
}
.compose-file-error {
  background: #fce4ec;
  color: #c62828;
}
.compose-file-error .compose-file-remove {
  color: #c62828;
}
.compose-file-status {
  font-size: 10px;
  opacity: 0.7;
}

/* ── Inline title editing ────────────────────────────────── */
.inline-title-input {
  font-weight: 600;
  font-size: 14px;
  color: #111;
  border: 1.5px solid #1e88e5;
  border-radius: 4px;
  padding: 2px 6px;
  width: 100%;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}
.inline-title-input:focus {
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.15);
}
.editable-title {
  position: relative;
  cursor: default;
  border-radius: 4px;
  transition: background 0.12s;
}
.editable-title:hover {
  background: rgba(0, 0, 0, 0.04);
}
.title-edit-hint {
  display: none;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}
.editable-title:hover .title-edit-hint {
  display: block;
}

/* ── Empty messages state ────────────────────────────────── */
.empty-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: #9e9e9e;
  gap: 12px;
}
.empty-messages p {
  font-size: 15px;
  margin: 0;
}
.compose-validation-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff3f3;
  border-bottom: 1px solid #ffcdd2;
  color: #d32f2f;
  font-size: 13px;
  margin: 0;
}
.compose-validation-error .compose-panel-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
}

/* ── Section switcher ───────────────────────────────────── */
.section-switcher {
  position: sticky;
  top: 110px;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  background: transparent;
  pointer-events: none;
}
.section-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: background 0.12s, box-shadow 0.12s;
  pointer-events: auto;
}
.section-switcher-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.section-switcher-btn .material-symbols-outlined {
  font-size: 18px;
  color: #523D8A;
}
.section-switcher-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  min-width: 200px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0;
  z-index: 201;
  pointer-events: auto;
}
.section-switcher-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.section-switcher-option:hover {
  background: #f5f5f5;
}
.section-switcher-option.active {
  font-weight: 600;
  color: #523D8A;
  background: #f3f0fa;
}

/* ── Section pill on messages ───────────────────────────── */
.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #f3f0fa;
  color: #523D8A;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.section-pill .material-symbols-outlined {
  font-size: 12px;
}
.sender-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.card-section-pill-row {
  padding: 6px 12px 0;
}

/* ── Move to section submenu ────────────────────────────── */
.options-menu-section-wrapper {
  position: relative;
}
.section-picker-submenu {
  background: #f8f9fa;
  border-top: 1px solid #e8e8e8;
  max-height: 160px;
  overflow-y: auto;
}
.section-picker-item {
  padding-left: 28px !important;
  font-size: 12px !important;
  color: #555 !important;
}
.section-picker-item:hover {
  background: #eef0f2 !important;
  color: #523D8A !important;
}

/* ── Add section form in switcher ───────────────────────── */
.section-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #e8e8e8;
}
.section-add-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  outline: none;
  color: #111;
  height: 30px;
}
.section-add-input:focus {
  border-color: #523D8A;
}
.section-add-btn {
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: #523D8A;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.section-add-btn:hover {
  background: #3e2d6b;
}
.section-add-btn:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* ── Approvals page ──── */
.approvals-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 0;
}
.approvals-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}
.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* New approval request form */
.new-approval-form {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.new-approval-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.new-approval-reason-input {
  flex: 1;
  min-width: 150px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.new-approval-reason-input:focus {
  border-color: #FF9800;
}
.new-approval-user-select {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.875rem;
  outline: none;
  min-width: 160px;
  background: #fff;
}
.new-approval-user-select:focus {
  border-color: #FF9800;
}
.new-approval-submit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FF9800;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.new-approval-submit:hover {
  background: #F57C00;
}
.new-approval-submit:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* Approval status filter */
.approval-status-filter {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.approval-filter-btn {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 4px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}
.approval-filter-btn:hover {
  background: #eeeeee;
}
.approval-filter-btn.active {
  background: #FF9800;
  color: #fff;
  border-color: #FF9800;
}
