html {
  font-size: 15px;
  min-height: 100%;
  position: relative;
}

body {
  background: #f6f7f8;
  color: #202428;
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 64px;
}

.navbar {
  background: #ffffff !important;
}

.navbar-brand {
  font-weight: 700;
}

.nav-auth {
  align-items: center;
  display: flex;
  gap: 10px;
}

.nav-user {
  color: #4d5963;
  font-size: .85rem;
  font-weight: 700;
}

.logout-form {
  margin: 0;
}

.logout-button {
  height: 34px;
  min-width: 0;
  padding: 0 12px;
}

.container {
  max-width: 1320px;
}

.page-head,
.detail-head {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 22px 0 18px;
}

.detail-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 210px);
}

.auth-panel {
  background: #ffffff;
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  max-width: 460px;
  padding: 28px;
  width: 100%;
}

.auth-copy {
  color: #4d5963;
  margin: 10px 0 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field input {
  width: 100%;
}

.auth-submit {
  width: 100%;
}

.page-head h1,
.detail-head h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

.eyebrow {
  color: #65707a;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.metric,
.price-panel,
.panel,
.data-shell,
.toolbar {
  background: #ffffff;
  border: 1px solid #dfe4e8;
  border-radius: 8px;
}

.metric {
  min-width: 128px;
  padding: 12px 14px;
}

.metric span,
.price-panel span {
  color: #65707a;
  display: block;
  font-size: .8rem;
}

.metric strong,
.price-panel strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}

.toolbar {
  align-items: end;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}

.search-field {
  flex: 1 1 360px;
}

.search-field span {
  color: #65707a;
  display: block;
  font-size: .8rem;
  margin-bottom: 4px;
}

.search-field input {
  border: 1px solid #cfd6dc;
  border-radius: 6px;
  height: 40px;
  padding: 0 12px;
  width: 100%;
}

.toggle-field {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
}

.btn-primary,
.btn-secondary {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 700;
  height: 40px;
  justify-content: center;
  min-width: 92px;
  padding: 0 14px;
  text-decoration: none;
}

.btn-primary {
  background: #195a92;
  border: 1px solid #195a92;
  color: #ffffff;
}

.btn-secondary {
  background: #eef3f7;
  border: 1px solid #cdd8e2;
  color: #173a59;
}

.data-shell {
  overflow: auto;
}

.data-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e7ecef;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f1f4f6;
  color: #4d5963;
  font-size: .82rem;
  font-weight: 700;
}

.product-name {
  font-weight: 700;
  max-width: 460px;
}

.muted,
.slug-line {
  color: #65707a;
}

.category-cell {
  max-width: 360px;
}

.action-cell {
  text-align: right !important;
}

.table-actions {
  display: inline-flex;
  gap: 8px;
}

.badge-stack,
.status-strip,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-strip {
  margin-bottom: 16px;
}

.status-badge,
.chip {
  border-radius: 999px;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
}

.status-badge.ok {
  background: #e4f4ec;
  color: #216242;
}

.status-badge.neutral,
.chip {
  background: #eef1f3;
  color: #3f4b55;
}

.status-badge.danger {
  background: #fae7e7;
  color: #8a2929;
}

.chip.primary {
  background: #e4eef7;
  color: #195a92;
}

.empty-state {
  color: #65707a;
  padding: 24px;
}

.status-message {
  background: #e4f4ec;
  border: 1px solid #b6dcc4;
  border-radius: 8px;
  color: #216242;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.back-link {
  color: #195a92;
  display: inline-block;
  font-weight: 700;
  margin-bottom: 14px;
  text-decoration: none;
}

.price-panel {
  min-width: 220px;
  padding: 16px;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
}

.panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.panel h3 {
  color: #4d5963;
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.edit-form {
  display: grid;
  gap: 16px;
}

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

.full-span {
  grid-column: 1 / -1;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field span {
  color: #4d5963;
  font-size: .82rem;
  font-weight: 700;
}

.form-field input,
.form-field textarea {
  border: 1px solid #cfd6dc;
  border-radius: 6px;
  padding: 10px 12px;
  width: 100%;
}

.form-field textarea {
  min-height: 110px;
  resize: vertical;
}

.code-like {
  font-family: Consolas, monospace;
}

.html-editor {
  border: 1px solid #cfd6dc;
  border-radius: 8px;
  overflow: hidden;
}

.html-editor-toolbar {
  align-items: center;
  background: #f3f6f8;
  border-bottom: 1px solid #dfe4e8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

.editor-tool,
.editor-view {
  align-items: center;
  background: #ffffff;
  border: 1px solid #ccd6de;
  border-radius: 6px;
  color: #173a59;
  cursor: pointer;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  min-width: 38px;
  padding: 0 10px;
}

.editor-tool:hover,
.editor-view:hover,
.editor-tool.is-active,
.editor-view.is-active {
  background: #e4eef7;
  border-color: #9dbbd4;
}

.editor-view-switch {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.html-editor-surface {
  background: #ffffff;
}

.html-editor-visual,
.html-editor-source {
  border: 0;
  min-height: 320px;
  padding: 14px;
  width: 100%;
}

.html-editor-visual {
  outline: none;
  overflow-wrap: anywhere;
}

.html-editor-visual:empty::before {
  color: #93a0aa;
  content: "Inhalt eingeben";
}

.html-editor-source {
  display: none;
  min-height: 320px;
  resize: vertical;
}

.html-editor.is-html-mode .html-editor-visual {
  display: none;
}

.html-editor.is-html-mode .html-editor-source {
  display: block;
}

.html-editor-visual h1,
.html-editor-visual h2,
.html-editor-visual h3,
.html-editor-visual p,
.html-editor-visual ul,
.html-editor-visual ol,
.html-editor-visual blockquote {
  margin-bottom: 12px;
}

.html-editor-visual ul,
.html-editor-visual ol {
  padding-left: 24px;
}

.html-editor-visual blockquote {
  border-left: 3px solid #cfd6dc;
  color: #4d5963;
  padding-left: 12px;
}

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

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

.toggle-field.boxed {
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 12px;
}

.assignment-list {
  display: grid;
  gap: 10px;
}

.assignment-row {
  align-items: center;
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 10px 12px;
}

.assignment-row small {
  color: #65707a;
  display: block;
  font-size: .78rem;
  font-weight: 400;
}

.radio-inline {
  align-items: center;
  color: #4d5963;
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}

.compact-scroll {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

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

.attribute-editor-card {
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  padding: 14px;
}

.attribute-option-list {
  display: grid;
  gap: 8px;
}

.attribute-option-list .toggle-field.boxed {
  min-height: 44px;
  padding: 10px 12px;
  white-space: normal;
}

.media-slot-list,
.media-detail-grid {
  display: grid;
  gap: 12px;
}

.media-slot-card,
.media-detail-item {
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  padding: 12px;
}

.media-preview-link {
  display: block;
  margin-top: 8px;
}

.media-file-link {
  color: #195a92;
  display: inline-flex;
  font-weight: 700;
  margin-top: 8px;
  text-decoration: none;
}

.media-preview-image {
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  display: block;
  height: auto;
  max-height: 220px;
  max-width: 100%;
  object-fit: contain;
}

.media-file-hint {
  color: #65707a;
  font-size: .82rem;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.field-error {
  color: #8a2929;
  font-size: .8rem;
}

.edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.full-width {
  margin-bottom: 16px;
}

.field-list {
  display: grid;
  gap: 10px;
  grid-template-columns: 150px minmax(0, 1fr);
  margin: 0;
}

.field-list.compact {
  grid-template-columns: 130px minmax(0, 1fr);
}

.field-list dt {
  color: #65707a;
  font-weight: 700;
}

.field-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.attribute-group + .attribute-group {
  margin-top: 14px;
}

.content-preview {
  border-top: 1px solid #e7ecef;
  max-height: 560px;
  overflow: auto;
  padding-top: 14px;
}

.content-preview img {
  height: auto;
  max-width: 100%;
}

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

.stack-item {
  background: #f7f9fa;
  border: 1px solid #e1e7eb;
  border-radius: 8px;
  color: #202428;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-decoration: none;
}

.stack-item span,
.stack-item small {
  color: #65707a;
}

.link-item:hover {
  border-color: #9dbbd4;
  color: #195a92;
}

@media (max-width: 820px) {
  .page-head,
  .detail-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-row {
    justify-content: stretch;
  }

  .metric {
    flex: 1 1 120px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .edit-grid,
  .toggle-grid,
  .price-edit-grid {
    grid-template-columns: 1fr;
  }

  .field-list,
  .field-list.compact {
    grid-template-columns: 1fr;
  }
}
