@font-face {
  font-family: 'TT Norms Pro Light';
  src: url('/assets/fonts/TT-Norms-Pro-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --sartorius-yellow: #ffed00;
  --ink: #16191f;
  --muted: #667085;
  --line: #d9dee8;
  --panel: rgba(255,255,255,.88);
  --soft: #f7f8fb;
  --danger: #c93a3a;
  --danger-bg: #fff1f1;
  --dark: #1f2937;
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  margin: 0;
  font-family: 'TT Norms Pro Light', Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 0 0, rgba(255,237,0,.22), transparent 30%), #fffdf1;
}

body { padding: 24px; }

.admin-page, .admin-shell, main {
  width: min(1760px, 100%);
  margin: 0 auto;
}

.admin-header, header {
  position: relative;
  margin-bottom: 34px;
}

.eyebrow, .brand-kicker {
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #667085;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 4.2vw, 68px);
  line-height: .95;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.subtitle, .admin-subtitle, header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.back-link, a[href*='index.html'] {
  position: absolute;
  right: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: #111827;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
}

.notice, #authNotice {
  border: 1px solid #f0cf00;
  background: #fff8c9;
  color: #2f2a00;
  border-radius: 26px;
  padding: 22px 28px;
  font-size: 20px;
  margin-bottom: 22px;
}

.toolbar, .search-bar, #searchPanel {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 26px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  border-radius: 20px;
  min-height: 54px;
  padding: 14px 18px;
  font: inherit;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

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

input:focus, textarea:focus, select:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(255,237,0,.28);
}

button, .btn {
  border: 0;
  border-radius: 999px;
  min-height: 54px;
  padding: 0 26px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--dark);
  color: #fff;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 14px 24px rgba(15,23,42,.12); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary, .create-btn, #createAccessoryBtn { background: var(--sartorius-yellow); color: #050505; }
.btn-danger, #deleteAccessoryBtn { background: var(--danger-bg); color: var(--danger); }
.btn-muted { background: #eef1f6; color: #344054; }

.admin-grid, .content-grid, #adminContent {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 34px;
  align-items: start;
}

.panel, .card, .list-panel, .editor-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(15,23,42,.08);
  padding: 24px;
}

.panel h2, .card h2 { margin: 0 0 16px; font-size: 26px; letter-spacing: -0.03em; }

.accessory-list, #accessoryList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
}

.accessory-item {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.accessory-item:hover { background: #fffbe0; border-color: #e0cf00; transform: translateY(-1px); }
.accessory-item.active { background: #fff7a8; border-color: #d8c500; }
.accessory-code { display: block; font-weight: 900; font-size: 15px; color: #111827; margin-bottom: 3px; }
.accessory-name { display: block; color: #475467; font-weight: 700; line-height: 1.2; font-size: 13px; }
.accessory-empty { color: var(--muted); padding: 18px; }

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-row { margin-bottom: 16px; }
.form-row.full, .full { grid-column: 1 / -1; }
label { display: block; color: #344054; font-weight: 800; margin-bottom: 8px; }

.subsection {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.subsection h3 { margin: 0 0 14px; font-size: 24px; }

.attribute-row, .alias-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 2fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  margin-bottom: 10px;
}
.alias-row { grid-template-columns: 1fr auto; }
.attribute-row input[type='checkbox'] { width: 22px; min-height: 22px; }
.small-btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.status, #statusMessage {
  margin: 14px 0;
  color: var(--muted);
  font-weight: 700;
}
.status.error { color: var(--danger); }
.status.ok { color: #087443; }

@media (max-width: 980px) {
  body { padding: 18px; }
  .admin-grid, .content-grid, #adminContent { grid-template-columns: 1fr; }
  .toolbar, .search-bar, #searchPanel { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .attribute-row { grid-template-columns: 1fr; }
  .back-link, a[href*='index.html'] { position: static; margin-top: 18px; }
}

/* Technical attributes editor */
.subsection {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.subsection h3 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.03em;
}
#attributesList,
#aliasesList {
  display: grid;
  gap: 10px;
}
.attribute-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 2fr 90px auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(247,248,251,.75);
}
.alias-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(247,248,251,.75);
}
.attribute-row input,
.alias-row input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.attr-visible-label {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.attr-sort {
  text-align: center;
}
@media (max-width: 1100px) {
  .attribute-row {
    grid-template-columns: 1fr;
  }
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  font-weight: 700;
}

.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}
