/*
 * VARYS-MGMT-014: Shared classes for management pages.
 * Replaces previously duplicated scoped CSS (.razor.css) in:
 *   - Manager pages (OrgaManager, OrganisationManager, CommunicationManager,
 *     ProjectManager, MyManager) — .manager-card / .manager-tip
 *   - Notes editors (CustomerNotesEditor, ProjectNotesEditor,
 *     SupplierNotesEditor) — .note-panel-shell / .note-card variants /
 *     .notes-search-addons
 *
 * Loaded once globally from Varuna.Management.App/Pages/App.razor.
 */

/* Manager card layout used by Organisation/Communication/Project/Orga/MyManager pages. */
.manager-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--bs-card-bg, var(--bs-body-bg));
  color: var(--bs-body-color);
  transition: border-color 0.2s ease;
}

.manager-card:hover {
  border-color: var(--bs-primary);
}

.manager-card--inactive {
  border-style: dashed;
  opacity: 0.7;
}

.manager-card--inactive:hover {
  opacity: 0.85;
}

.manager-card--highlight {
  border-color: var(--bs-primary);
  border-width: 2px;
}

.manager-tip {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

/* Notes editor styling — shared by Customer / Project / Supplier notes editors. */
.note-panel-shell {
  --note-comment-bg: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  --note-comment-border: #d5dde7;
  --note-comment-text: #34495e;
  --note-important-bg: linear-gradient(180deg, #fff3f0 0%, #ffe3de 100%);
  --note-important-border: #efb2a7;
  --note-important-text: #8f2d1b;
  --note-sticky-bg: linear-gradient(180deg, #fffce8 0%, #fff3b8 100%);
  --note-sticky-border: #e5ce6a;
  --note-sticky-text: #6b5600;
}

.notes-search-addons {
  flex-shrink: 0;
}

.notes-search-addons .form-control {
  width: 200px;
}

.notes-search-addons .input-group-text {
  background: transparent;
  border-right: 0;
}

.note-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.note-grid__item {
  min-width: 0;
}

.note-card {
  height: 100%;
  border-width: 1px;
  border-style: solid;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.note-card--editing {
  box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.18), 0 16px 30px rgba(15, 23, 42, 0.14);
}

.note-card--pinned {
  position: relative;
}

.note-card--pinned::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 0.75rem 0 0 0.75rem;
  background: currentColor;
  opacity: 0.3;
}

.note-card--comment {
  background: var(--note-comment-bg);
  border-color: var(--note-comment-border);
  color: var(--note-comment-text);
}

.note-card--important {
  background: var(--note-important-bg);
  border-color: var(--note-important-border);
  color: var(--note-important-text);
}

.note-card--sticky {
  background: var(--note-sticky-bg);
  border-color: var(--note-sticky-border);
  color: var(--note-sticky-text);
}

.note-card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.note-card-header__content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.note-card-title-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.note-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.3;
}

.note-card-meta {
  color: inherit;
  opacity: 0.8;
}

.note-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.note-pin-indicator {
  opacity: 0.7;
}

.note-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
}

.note-card-body,
.note-editor-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.note-card-content {
  overflow-wrap: anywhere;
}

.note-card-content > :first-child {
  margin-top: 0;
}

.note-card-content > :last-child {
  margin-bottom: 0;
}

.note-type-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.note-type-option {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.68);
  color: inherit;
}

.note-type-option--active {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.note-editor-body .form-check {
  margin-bottom: 0;
}

.note-editor-body .e-richtexteditor {
  border-radius: 0.85rem;
  overflow: hidden;
}

.note-editor-body .e-rte-content,
.note-editor-body .e-content {
  min-height: 10rem;
}

@media (max-width: 767.98px) {
  .note-card-header__content {
    flex-direction: column;
  }

  .note-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .note-card-actions > * {
    flex: 1 1 auto;
  }
}
