/*!
 * smit-card — карточка настроек и карточка графика. Пара с smit-card.js.
 */

.smit-card {
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-subtle, #dbe2ea);
  border-radius: var(--radius-sm);
  margin-bottom: 16px; overflow: hidden;
}
.smit-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle, #dbe2ea);
}
.smit-card-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
  background: rgba(67, 183, 122, .14); color: #1f7a52;
}
.smit-card-ico.blue { background: rgba(26, 86, 219, .12); color: #1a56db; }
.smit-card-ico.orange { background: rgba(240, 173, 78, .18); color: #b5730f; }
.smit-card-ico.red { background: rgba(198, 47, 54, .12); color: #c62f36; }
.smit-card-ico.gray { background: rgba(100, 116, 139, .14); color: #64748b; }
.smit-card-ttl { font-size: var(--sc-fz-md, .9rem); font-weight: 600; }
.smit-card-act { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.smit-card-body { padding: 4px 16px 12px; }

/* строка настройки: подпись с пояснением слева, переключатель справа */
.smit-card-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 12px 0; border-bottom: 1px dashed var(--border-subtle, #e6ebf1);
}
.smit-card-row:last-child { border-bottom: none; }
.smit-card-row.is-disabled { opacity: .55; }
.smit-card-text { flex: 1 1 auto; min-width: 0; }
.smit-card-lbl { display: block; font-weight: 600; font-size: var(--sc-fz-md, .9rem); cursor: pointer; }
.smit-card-hint {
  margin-top: 3px; font-size: var(--sc-fz-sm, .82rem);
  color: var(--text-muted, #64748b); line-height: 1.45;
}
.smit-card-ctrl { flex: 0 0 auto; padding-top: 2px; }
.smit-card-ctrl .form-control, .smit-card-ctrl .form-select { min-width: 140px; }
.smit-card-switch { min-height: 0; margin: 0; padding-left: 2.6em; }
.smit-card-switch .form-check-input {
  margin: 0 !important; float: none !important; position: static !important;
  width: 2.4em; height: 1.25em; cursor: pointer;
}

/* карточка графика */
.smit-card-plot { padding: 12px 16px; position: relative; }
.smit-card-plot canvas { max-width: 100%; }
.smit-card-note {
  padding: 0 16px 12px; font-size: var(--sc-fz-sm, .82rem);
  color: var(--text-muted, #64748b);
}
.smit-card-empty {
  position: absolute; inset: 12px 16px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--border-subtle, #dbe2ea); border-radius: var(--radius-sm);
  color: var(--text-muted, #64748b); font-size: var(--sc-fz-sm, .82rem);
}

/* ── тёмная тема ── */
[data-bs-theme="dark"] .smit-card, .dark-theme .smit-card {
  background: var(--surface-card); border-color: var(--border-subtle);
}
[data-bs-theme="dark"] .smit-card-head, .dark-theme .smit-card-head { border-color: var(--border-subtle); }
[data-bs-theme="dark"] .smit-card-row, .dark-theme .smit-card-row { border-color: #262d30; }
[data-bs-theme="dark"] .smit-card-hint, .dark-theme .smit-card-hint,
[data-bs-theme="dark"] .smit-card-note, .dark-theme .smit-card-note,
[data-bs-theme="dark"] .smit-card-empty, .dark-theme .smit-card-empty { color: var(--text-muted); }
[data-bs-theme="dark"] .smit-card-empty, .dark-theme .smit-card-empty { border-color: var(--border-subtle); }

/* ── телефон: переключатель уходит под подпись ── */
@media (max-width: 575.98px) {
  .smit-card-row { flex-direction: column; gap: 8px; }
  .smit-card-ctrl { width: 100%; }
  .smit-card-ctrl .form-control, .smit-card-ctrl .form-select { width: 100%; }
}

/* карточка интеграции: бейдж у заголовка, описание, сетка полей, футер */
.smit-card-badge {
  font-size: var(--sc-fz-xs, .76rem); color: var(--text-muted, #64748b);
  background: rgba(100, 116, 139, .12); border-radius: var(--radius-pill); padding: 1px 9px;
}
.smit-card-desc {
  margin: 10px 0 12px; font-size: var(--sc-fz-sm, .82rem);
  color: var(--text-muted, #64748b); line-height: 1.5;
}
.smit-card-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-top: 12px;
}
.smit-card-field.is-wide { grid-column: 1 / -1; }
.smit-card-flbl {
  display: block; font-size: var(--sc-fz-sm, .82rem); font-weight: 600; margin-bottom: 4px;
}
.smit-card-foot {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border-subtle, #dbe2ea);
}
[data-bs-theme="dark"] .smit-card-foot, .dark-theme .smit-card-foot { border-color: var(--border-subtle); }
[data-bs-theme="dark"] .smit-card-badge, .dark-theme .smit-card-badge {
  background: rgba(154, 166, 178, .16); color: var(--text-muted);
}

/* ── Оформление (look) ─────────────────────────────────────────────────
   plain — как есть; accent — цветная полоса сверху; outline — шапка без
   разделителя; flat — без рамки (карточка внутри другой карточки). */
.smit-card.is-accent { border-top: 3px solid var(--brand-primary, #43b77a); }
.smit-card.is-accent.tone-blue { border-top-color: #1a56db; }
.smit-card.is-accent.tone-orange { border-top-color: #f0ad4e; }
.smit-card.is-accent.tone-red { border-top-color: #c62f36; }
.smit-card.is-outline .smit-card-head { border-bottom: 0; padding-bottom: 0; }
.smit-card.is-flat { border: 0; box-shadow: none; }

/* ── Плитка канала (variant: feature) ── */
.smit-card-head-lite { border-bottom: 0; padding-bottom: 0; }
.smit-card-feature .smit-card-body { padding-top: 10px; }
.smit-card-state {
  font-size: var(--sc-fz-xs, .76rem); font-weight: 700; text-transform: lowercase;
  padding: 1px 8px; border-radius: var(--radius-pill);
  background: rgba(100, 116, 139, .14); color: var(--text-muted, #64748b);
}
.smit-card-state.is-on { background: rgba(67, 183, 122, .16); color: #1f7a52; }
.smit-card-metric { margin: 6px 0 10px; font-size: var(--sc-fz-sm, .82rem); color: var(--text-muted, #64748b); }
.smit-card-metric b { font-size: 1.35rem; color: #1f7a52; font-variant-numeric: tabular-nums; }
.smit-card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ── Раскрывающаяся запись (variant: accordion) ── */
.smit-card-acc { padding: 0; }
.smit-card-acc-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; cursor: pointer; list-style: none;
}
.smit-card-acc-head::-webkit-details-marker { display: none; }
.smit-card-acc-head::after {
  content: '\f078'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
  margin-left: auto; font-size: .75rem; color: var(--text-muted, #64748b);
  transition: transform .15s;
}
.smit-card-acc[open] .smit-card-acc-head::after { transform: rotate(180deg); }
.smit-card-acc-head:hover { background: rgba(67, 183, 122, .05); }
.smit-card-acc-head:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: -2px; }
.smit-card-code {
  flex: 0 0 auto; min-width: 34px; text-align: center;
  background: var(--brand-primary, #43b77a); color: #fff;
  border-radius: var(--radius-pill); padding: 2px 9px;
  font-size: var(--sc-fz-xs, .76rem); font-weight: 700;
}
.smit-card-sub { color: var(--text-muted, #64748b); font-size: var(--sc-fz-sm, .82rem); }
.smit-card-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.smit-card-tag {
  font-size: var(--sc-fz-xs, .76rem); padding: 2px 9px; border-radius: var(--radius-pill);
  background: rgba(100, 116, 139, .12); color: var(--text-muted, #64748b);
}
.smit-card-tag.green { background: rgba(67, 183, 122, .16); color: #1f7a52; }
.smit-card-tag.red { background: rgba(198, 47, 54, .12); color: #c62f36; }
.smit-card-tag.orange { background: rgba(240, 173, 78, .2); color: #b5730f; }
.smit-card-lead {
  border-left: 3px solid var(--brand-primary, #43b77a);
  background: rgba(67, 183, 122, .06);
  padding: 10px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 12px;
  font-size: var(--sc-fz-sm, .82rem);
}
.smit-card-steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}
.smit-card-step {
  border: 1px solid var(--border-subtle, #dbe2ea); border-radius: var(--radius-sm); padding: 10px 12px;
  background: var(--surface-muted, #fbfcfe);
}
.smit-card-step-ttl {
  font-size: var(--sc-fz-xs, .76rem); font-weight: 700; text-transform: uppercase;
  color: #1f7a52; margin-bottom: 6px; letter-spacing: .02em;
}
.smit-card-step-body { font-size: var(--sc-fz-sm, .82rem); line-height: 1.5; }
.smit-card-acc-foot { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

[data-bs-theme="dark"] .smit-card-step, .dark-theme .smit-card-step {
  background: #21262b; border-color: var(--border-subtle);
}
[data-bs-theme="dark"] .smit-card-lead, .dark-theme .smit-card-lead {
  background: rgba(67, 183, 122, .1);
}
[data-bs-theme="dark"] .smit-card-step-ttl, .dark-theme .smit-card-step-ttl { color: #7fd6a8; }
[data-bs-theme="dark"] .smit-card-metric b, .dark-theme .smit-card-metric b { color: #7fd6a8; }
[data-bs-theme="dark"] .smit-card-acc-head:hover, .dark-theme .smit-card-acc-head:hover {
  background: rgba(67, 183, 122, .08);
}
