.ica-shell {
  width: 100%;
  max-width: 1480px;
  min-width: 0;
  margin: 0 auto;
  color: #1e293b;
}

.ica-toolbar,
.ica-panel,
.ica-channel-list,
.ica-form-card {
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ica-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.ica-health {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 8px;
  flex: 1 1 520px;
  min-width: 0;
}

.ica-health-item {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f8fafc;
}

.ica-health-item span {
  display: block;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}

.ica-health-item strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ica-toolbar-actions,
.ica-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ica-button {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.ica-button:hover { background: #f8fafc; }
.ica-button.primary { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.ica-button.danger { border-color: #fecaca; background: #fff7f7; color: #b91c1c; }
.ica-button:disabled { cursor: not-allowed; opacity: 0.55; }

.ica-layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  align-items: start;
}

.ica-channel-list {
  border-radius: 12px;
  overflow: hidden;
}

.ica-channel-list-head {
  padding: 11px 13px;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ica-channel-button {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.ica-channel-button:last-child { border-bottom: 0; }
.ica-channel-button:hover { background: #f8fafc; }
.ica-channel-button.active { background: #eef2ff; box-shadow: inset 3px 0 #4f46e5; }

.ica-channel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ica-channel-title strong,
.ica-channel-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ica-channel-title strong { font-size: 13px; }
.ica-channel-title span { color: #64748b; font-size: 12px; }

.ica-dots,
.ica-channel-metrics {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ica-dots { margin-top: 7px; }
.ica-channel-metrics { margin-top: 6px; color: #64748b; font-size: 11px; }

.ica-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 10px;
}

.ica-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
}

.ica-dot.ok::before { background: #10b981; }
.ica-dot.warn::before { background: #f59e0b; }
.ica-dot.off::before { background: #ef4444; }

.ica-form-card {
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
}

.ica-form-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.ica-form-head h3 { font-size: 16px; line-height: 1.35; }
.ica-form-head p { margin-top: 3px; color: #64748b; font-size: 12px; }

.ica-readonly {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.ica-readonly-item {
  min-width: 0;
  color: #64748b;
  font-size: 11px;
}

.ica-readonly-item strong {
  display: block;
  margin-top: 2px;
  color: #334155;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ica-form-body { padding: 14px 16px 16px; }

.ica-group {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ica-group:last-of-type { margin-bottom: 8px; }
.ica-group legend { margin-bottom: 8px; color: #475569; font-size: 12px; font-weight: 800; }

.ica-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  min-width: 0;
}

.ica-field { min-width: 0; }
.ica-field.wide { grid-column: 1 / -1; }
.ica-field label { display: block; margin-bottom: 5px; color: #475569; font-size: 11px; font-weight: 700; }

.ica-input,
.ica-textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  padding: 8px 9px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ica-input:focus,
.ica-textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.ica-textarea { min-height: 76px; resize: vertical; line-height: 1.45; }

.ica-check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 35px;
  flex-wrap: wrap;
}

.ica-check {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin: 0 !important;
  cursor: pointer;
}

.ica-check input { width: 16px; height: 16px; accent-color: #4f46e5; }
.ica-help { margin-top: 4px; color: #94a3b8; font-size: 10px; line-height: 1.45; }

.ica-message {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ica-message.error { border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; }
.ica-message.success { border: 1px solid #bbf7d0; background: #f0fdf4; color: #047857; }
.ica-empty { padding: 48px 20px; text-align: center; color: #94a3b8; font-size: 13px; }

@media (max-width: 920px) {
  .ica-health { grid-template-columns: repeat(3, minmax(72px, 1fr)); }
  .ica-readonly { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  #mainContent { padding: 14px !important; }
  .ica-layout { grid-template-columns: minmax(0, 1fr); }
  .ica-channel-list-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ica-channel-button { min-width: 0; border-right: 1px solid #f1f5f9; }
  .ica-channel-title { align-items: flex-start; flex-direction: column; gap: 1px; }
  .ica-channel-title strong { font-size: 12px; }
  .ica-dots { gap: 4px; }
}

@media (max-width: 430px) {
  .ica-toolbar { padding: 10px; }
  .ica-health { grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: 100%; }
  .ica-toolbar-actions { width: 100%; }
  .ica-toolbar-actions .ica-button { flex: 1 1 0; }
  .ica-channel-list-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ica-readonly,
  .ica-grid { grid-template-columns: minmax(0, 1fr); }
  .ica-field.wide { grid-column: auto; }
  .ica-form-head,
  .ica-readonly,
  .ica-form-body { padding-left: 12px; padding-right: 12px; }
  .ica-form-actions { align-items: stretch; }
  .ica-form-actions .ica-button { flex: 1 1 120px; }
}
