/* ==================== VAULT ==================== */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.vault-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); cursor: pointer; text-align: center; position: relative; }
.vault-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.vault-item:hover .vault-del-btn { opacity: 0.6 !important; }
.vault-del-btn:hover { opacity: 1 !important; color: var(--red) !important; }
.vault-icon { font-size: 36px; }
.vault-name { font-size: 12px; font-weight: 600; word-break: break-all; color: var(--text); }

/* Vault thumbnails */
.vault-thumb { width: 100%; max-height: 100px; overflow: hidden; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--overlay-black-faint); }
.vault-thumb img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; transition: transform var(--transition-fast); }
.vault-item:hover .vault-thumb img { transform: scale(1.05); }
.vault-play-badge { position: absolute; bottom: 2px; right: 2px; font-size: 14px; background: var(--overlay-black-strong); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; line-height: 1; }

/* Vault preview modal */
.vault-preview-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.88); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.vault-preview-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--overlay-black-strong); flex-shrink: 0; }
.vault-preview-filename { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.vault-preview-actions { display: flex; gap: 8px; align-items: center; }
.vault-preview-close { font-size: 18px; line-height: 1; padding: 4px 10px; }
.vault-preview-body { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; overflow: auto; padding: 20px; }
.vault-preview-content { max-width: 90vw; max-height: 85vh; border-radius: 8px; }
img.vault-preview-content { object-fit: contain; box-shadow: var(--shadow-lg); }
iframe.vault-preview-pdf { width: 90vw; height: 85vh; border: none; border-radius: 8px; background: #fff; }

/* Vault document items */
.vault-item--doc { border-left: 3px solid var(--accent); }
.vault-doc-preview { font-size: 11px; color: var(--text-dim); line-height: 1.4; max-height: 32px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Document editor page */
.doc-header { margin-bottom: 20px; }
.doc-title-input { width: 100%; background: none; border: none; border-bottom: 2px solid var(--border); color: #fff; font-size: 24px; font-weight: 800; font-family: inherit; padding: 8px 0; outline: none; transition: border-color 0.15s; }
.doc-title-input:focus { border-color: var(--accent); }
.doc-meta { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.doc-editor-wrap { margin-bottom: 16px; }
.doc-editor-wrap trix-editor { min-height: 300px; max-height: none; }
.doc-footer { display: flex; align-items: center; justify-content: space-between; }
.doc-save-status { font-size: 12px; color: var(--text-dim); font-style: italic; }

/* ==================== TRIX EDITOR (DARK THEME) ==================== */
trix-editor.trix-dark {
  background: var(--bg, #1a2730);
  color: var(--text, #e8ecee);
  border: 1px solid var(--border, #2a3f4d);
  border-radius: 0 0 8px 8px;
  padding: 12px;
  min-height: 80px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
}
trix-editor.trix-dark:focus { border-color: var(--accent, #1cb0f6); outline: none; box-shadow: 0 0 0 3px var(--accent-dim); }
trix-editor.trix-dark a { color: var(--accent, #1cb0f6); }

trix-toolbar {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border, #2a3f4d);
  border-radius: 0;
  padding: 6px 4px;
}

trix-toolbar .trix-button-group { border: none !important; margin-bottom: 0 !important; border-radius: 0 !important; background: transparent !important; }
trix-toolbar .trix-button {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary, #8fa3b0);
  padding: 4px 7px;
  filter: invert(0.85);
  border-radius: 3px;
  width: 32px; height: 32px;
}
trix-toolbar .trix-button:hover { filter: invert(1); background: var(--overlay-white-ultra) !important; }
trix-toolbar .trix-button.trix-active { filter: invert(1); background: var(--overlay-white-faint) !important; }
trix-toolbar .trix-button-group:not(:first-child) { margin-left: 8px; }

/* Show attachment button for file uploads */
trix-toolbar .trix-button-group--file-tools { }

/* Rich content display for non-edit mode */
.rich-content { font-size: 14px; line-height: 1.6; color: var(--text); }
.rich-content h1, .rich-content h2, .rich-content h3 { color: #fff; margin: 12px 0 8px; }
.rich-content a { color: var(--accent); }
.rich-content blockquote { border-left: 3px solid var(--accent-dim); padding-left: 12px; color: var(--text-dim); margin: 8px 0; }
.rich-content code { background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.rich-content pre { background: var(--bg-hover); padding: 12px; border-radius: 8px; overflow-x: auto; }
.rich-content ul, .rich-content ol { padding-left: 24px; margin: 8px 0; }
.rich-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

/* ==================== EMPTY STATE TOOL CARDS (Basecamp style) ==================== */
.tool-card__empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  height: 100%;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
}
.tool-card__empty-icon {
  font-size: 22px;
  opacity: 0.5;
}
.tool-card__empty-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.tool-card__empty-cta {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.tool-card:hover .tool-card__empty-cta {
  opacity: 1;
}

/* ==================== TRIX NOTES TIGHTER SPACING ==================== */
.card-field--notes strong {
  margin-bottom: 2px;
}
.card-field--notes .card-field__value {
  margin-top: 0;
}
.card-field--notes trix-toolbar {
  margin-top: 2px;
}
.card-field--notes trix-editor {
  margin-top: 0;
}
.btn-save-notes {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  border-color: var(--border);
  opacity: 0.7;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
.btn-save-notes:hover {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
}

/* ==================== SCHEDULE / CALENDAR ==================== */
.schedule-calendar { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.schedule-header { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.schedule-header__day { text-align: center; padding: 10px; font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.schedule-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.schedule-day { min-height: 100px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 8px; transition: background var(--transition-fast); cursor: default; }
.schedule-day:nth-child(7n) { border-right: none; }
.schedule-day:hover { background: var(--bg-hover); }
.schedule-day--empty { background: var(--bg); opacity: 0.3; }
.schedule-day--today { background: var(--accent-dim); }
.schedule-day--today .schedule-day__num { background: var(--accent); color: #000; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.schedule-day--has-events { }
.schedule-day__num { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.schedule-event { font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.schedule-event-more { font-size: 10px; color: var(--text-dim); padding: 2px 6px; }

/* ==================== CHECK-INS ==================== */
.checkin-question { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 12px; transition: border-color var(--transition-fast); }
.checkin-question:hover { border-color: var(--border-hover); }
.checkin-question__text { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.4; }
.checkin-response-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.checkin-response-form textarea { min-height: 60px; resize: vertical; }
.checkin-list { display: flex; flex-direction: column; gap: 2px; }
