.crm-operations {
  display: grid;
  gap: 11px;
  margin: 14px 0 12px;
  max-width: 100%;
}

.crm-operation-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line-strong, rgba(110, 196, 221, .3));
  border-radius: 13px;
  background: var(--panel-soft, rgba(18, 42, 68, .76));
  color: var(--ink, #f3f8fc);
  box-shadow: 0 8px 24px rgba(3, 12, 23, .08);
}

.crm-operation__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 9px;
}

.crm-operation__title,
.crm-operation__subheading {
  margin: 0;
  color: var(--ink, #f3f8fc);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.crm-operation__status {
  flex: 0 1 auto;
  color: var(--muted, #9aaec1);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

.crm-operation__status[data-state="pending"] { color: var(--cyan, #73e4ef); }
.crm-operation__status[data-state="complete"] { color: var(--success, #76e2ba); }
.crm-operation__status[data-state="error"],
.crm-operation__status[data-state="unknown"],
.crm-operation__status[data-state="blocked"] { color: var(--danger, #ff9d9d); }

.crm-operation__details {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.crm-operation__button,
.crm-operation__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong, rgba(110, 196, 221, .34));
  border-radius: 8px;
  background: rgba(37, 111, 163, .14);
  color: var(--ink, #f3f8fc);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.crm-operation__button:hover:not(:disabled),
.crm-operation__link:hover {
  border-color: var(--cyan, #73e4ef);
  background: rgba(37, 111, 163, .24);
}

.crm-operation__button:focus-visible,
.crm-operation__link:focus-visible,
.crm-operation__textarea:focus-visible {
  outline: 3px solid var(--cyan, #73e4ef);
  outline-offset: 2px;
}

.crm-operation__button:disabled {
  opacity: .58;
  cursor: wait;
}

.crm-operation__button--primary {
  border-color: var(--cyan, #73e4ef);
  background: rgba(49, 146, 184, .25);
}

.crm-operation__button--danger {
  border-color: rgba(239, 111, 111, .62);
  background: rgba(188, 48, 48, .2);
}

.crm-operation__download { justify-self: start; }

.crm-operation__flyer-image,
.crm-operation__draft-image,
.crm-operation__publish-image,
.crm-operation__post-image {
  display: block;
  width: min(100%, 520px);
  max-height: 520px;
  border: 1px solid var(--line, rgba(151, 181, 205, .2));
  border-radius: 9px;
  background: #fff;
  object-fit: contain;
}

.crm-operation__publish-image { width: min(100%, 420px); }
.crm-operation__post-image { width: min(100%, 360px); max-height: 260px; }

.crm-operation__field {
  display: grid;
  gap: 6px;
}

.crm-operation__field-label,
.crm-operation__note,
.crm-operation__planned-note,
.crm-operation__reconcile-note,
.crm-operation__empty,
.crm-operation__post-meta,
.crm-operation__caption {
  margin: 0;
  color: var(--muted, #9aaec1);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.crm-operation__caption { color: var(--ink, #f3f8fc); }
.crm-operation__post-meta { font-size: 11px; }

.crm-operation__textarea {
  display: block;
  width: 100%;
  min-height: 108px;
  padding: 10px;
  border: 1px solid var(--line-strong, rgba(110, 196, 221, .3));
  border-radius: 8px;
  background: var(--panel, rgba(12, 31, 53, .91));
  color: var(--ink, #f3f8fc);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.crm-operation__post-list {
  display: grid;
  gap: 8px;
}

.crm-operation__post,
.crm-operation__preview {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line, rgba(151, 181, 205, .16));
  border-radius: 9px;
  background: rgba(7, 21, 39, .12);
}

.crm-operation__image-link { justify-self: start; }

html[data-theme="light"] .crm-operation-card {
  border-color: #ded5ec;
  background: #faf8fe;
  color: #201b2b;
  box-shadow: 0 8px 22px rgba(40, 25, 69, .05);
}

html[data-theme="light"] .crm-operation__title,
html[data-theme="light"] .crm-operation__subheading,
html[data-theme="light"] .crm-operation__caption { color: #201b2b; }

html[data-theme="light"] .crm-operation__status,
html[data-theme="light"] .crm-operation__field-label,
html[data-theme="light"] .crm-operation__note,
html[data-theme="light"] .crm-operation__planned-note,
html[data-theme="light"] .crm-operation__reconcile-note,
html[data-theme="light"] .crm-operation__empty,
html[data-theme="light"] .crm-operation__post-meta { color: #655b71; }

html[data-theme="light"] .crm-operation__button,
html[data-theme="light"] .crm-operation__link {
  border-color: #d4c5e8;
  background: #f1ebfa;
  color: #35234d;
}

html[data-theme="light"] .crm-operation__button--primary { background: #e9f6fb; }
html[data-theme="light"] .crm-operation__button--danger { background: #fff0f0; }

html[data-theme="light"] .crm-operation__textarea {
  border-color: #d4c5e8;
  background: #fff;
  color: #201b2b;
}

@media (max-width: 520px) {
  .crm-operation__header { display: grid; }
  .crm-operation__status { text-align: left; }
  .crm-operation__button,
  .crm-operation__link { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-operation-card,
  .crm-operation-card * { scroll-behavior: auto !important; transition: none !important; }
}
