:root {
  --ecl-bg: #f4f6f4;
  --ecl-panel: #ffffff;
  --ecl-ink: #17201a;
  --ecl-muted: #617064;
  --ecl-line: #dfe7df;
  --ecl-green: #25734b;
  --ecl-blue: #285f86;
  --ecl-red: #ad3434;
  --ecl-shadow: 0 10px 28px rgba(24, 39, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ecl-bg);
  color: var(--ecl-ink);
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
}

.ecl-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 160ms ease;
}

.ecl-app.is-sidebar-collapsed {
  grid-template-columns: 72px 1fr;
}

.ecl-sidebar {
  background: #17201a;
  color: #eef5ef;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ecl-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 22px;
  position: relative;
}

.ecl-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ecl-green);
  font-weight: 800;
}

.ecl-brand small {
  display: block;
  color: #aebcaf;
}

.ecl-sidebar-toggle {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef5ef;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.ecl-nav {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: #d7e2d8;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
}

.ecl-nav.is-active,
.ecl-nav:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ecl-sidebar-footer {
  margin-top: auto;
  color: #aebcaf;
  font-size: 13px;
}

.ecl-app.is-sidebar-collapsed .ecl-sidebar {
  padding: 18px 12px;
  align-items: center;
}

.ecl-app.is-sidebar-collapsed .ecl-brand {
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
}

.ecl-app.is-sidebar-collapsed .ecl-brand-copy,
.ecl-app.is-sidebar-collapsed .ecl-nav span,
.ecl-app.is-sidebar-collapsed .ecl-sidebar-footer span:last-child {
  display: none;
}

.ecl-app.is-sidebar-collapsed .ecl-sidebar-toggle {
  margin-left: 0;
}

.ecl-app.is-sidebar-collapsed .ecl-nav {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.ecl-app.is-sidebar-collapsed .ecl-nav::first-letter {
  font-size: 0;
}

.ecl-app.is-sidebar-collapsed .ecl-nav[data-view="products"]::after {
  content: "C";
}

.ecl-app.is-sidebar-collapsed .ecl-nav[data-view="assets"]::after {
  content: "A";
}

.ecl-status {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--ecl-red);
}

.ecl-status.is-ok {
  background: #47bf73;
}

.ecl-main {
  padding: 24px;
  min-width: 0;
}

.ecl-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.ecl-header h1 {
  margin: 0 0 4px;
  font-size: 26px;
}

.ecl-header p {
  margin: 0;
  color: var(--ecl-muted);
}

.ecl-panel,
.ecl-alert {
  background: var(--ecl-panel);
  border: 1px solid var(--ecl-line);
  border-radius: 8px;
  box-shadow: var(--ecl-shadow);
}

.ecl-alert {
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #7a4b00;
  background: #fff7df;
}

.ecl-panel.is-hidden {
  display: none;
}

.ecl-toolbar {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--ecl-line);
  flex-wrap: wrap;
}

.ecl-input,
.ecl-select {
  height: 38px;
  border: 1px solid var(--ecl-line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.ecl-input {
  min-width: 260px;
  flex: 1;
}

.ecl-date-input {
  min-width: 150px;
  flex: 0 0 150px;
}

.ecl-button {
  height: 38px;
  border: 1px solid var(--ecl-line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ecl-ink);
  cursor: pointer;
  font-weight: 650;
}

.ecl-button:hover {
  border-color: var(--ecl-green);
  color: var(--ecl-green);
}

.ecl-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ecl-table-wrap {
  overflow: auto;
}

.ecl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ecl-table th,
.ecl-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ecl-line);
  text-align: left;
  vertical-align: middle;
}

.ecl-table th {
  color: var(--ecl-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ecl-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: #edf2ed;
}

.ecl-title {
  max-width: 360px;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ecl-description-preview {
  width: min(380px, 28vw);
  color: var(--ecl-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ecl-muted {
  color: var(--ecl-muted);
}

.ecl-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e9f3ed;
  color: var(--ecl-green);
  font-size: 12px;
  font-weight: 700;
}

.ecl-pill.is-off {
  background: #f5e8e8;
  color: var(--ecl-red);
}

.ecl-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
}

.ecl-meta {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ecl-line);
  color: var(--ecl-muted);
  font-size: 13px;
}

.ecl-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  padding: 14px;
}

.ecl-asset-card {
  border: 1px solid var(--ecl-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ecl-asset-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf2ed;
}

.ecl-asset-body {
  padding: 10px;
  display: grid;
  gap: 7px;
  font-size: 12px;
}

.ecl-asset-id {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecl-asset-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecl-asset-details {
  border-top: 1px solid var(--ecl-line);
  padding-top: 6px;
}

.ecl-asset-details summary {
  color: var(--ecl-blue);
  cursor: pointer;
  font-weight: 700;
}

.ecl-asset-details div {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.ecl-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ecl-link-button {
  border: 0;
  background: transparent;
  color: var(--ecl-blue);
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.ecl-dialog {
  width: min(1180px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

.ecl-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.ecl-dialog pre {
  margin: 0;
  max-height: 70vh;
  overflow: auto;
  padding: 18px;
  font-size: 12px;
  background: #111814;
  color: #d9f0dc;
}

.ecl-edit {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.ecl-edit h2 {
  margin: 0;
  font-size: 20px;
}

.ecl-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ecl-field {
  display: grid;
  gap: 5px;
}

.ecl-field label {
  color: var(--ecl-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ecl-field input,
.ecl-field textarea {
  width: 100%;
  border: 1px solid var(--ecl-line);
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
}

.ecl-field textarea {
  min-height: 120px;
  resize: vertical;
}

.ecl-field textarea.ecl-description-editor {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ecl-field.is-wide {
  grid-column: 1 / -1;
}

.ecl-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ecl-edit-message {
  color: var(--ecl-muted);
  font-size: 13px;
}

.ecl-editor-section {
  display: grid;
  gap: 10px;
}

.ecl-editor-section h3 {
  margin: 0;
  font-size: 15px;
}

.ecl-variant-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--ecl-line);
  border-radius: 8px;
}

.ecl-variant-table {
  min-width: 760px;
}

.ecl-variant-table code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.ecl-raw-toggle {
  border-top: 1px solid var(--ecl-line);
  padding-top: 10px;
}

.ecl-raw-toggle pre {
  margin-top: 10px;
  border-radius: 7px;
}

.ecl-dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .ecl-app {
    grid-template-columns: 1fr;
  }

  .ecl-sidebar {
    min-height: auto;
  }

  .ecl-app.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .ecl-toolbar,
  .ecl-header {
    flex-direction: column;
  }

  .ecl-input {
    min-width: 0;
    width: 100%;
  }

  .ecl-description-preview {
    width: 240px;
  }
}
