:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #667085;
  --line: #d8dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  --touch: 46px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 62px;
  background: #17202b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.brand { font-weight: 700; letter-spacing: 0.04em; }
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 58px); }
.sidebar { background: #202b38; color: #dce3ec; padding: 18px; }
.sidebar a { display: block; color: #dce3ec; padding: 13px 10px; border-radius: 6px; min-height: var(--touch); }
.sidebar a:hover { background: #2d3a49; text-decoration: none; }
.content { padding: 18px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel { padding: 18px; margin-bottom: 16px; }
.compact-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.compact-head h2, .board-head h1 { margin: 0; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 18px; }
.stat strong { display: block; font-size: 28px; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 13px; text-align: left; vertical-align: middle; }
.table th { background: #eef2f6; font-size: 13px; color: #475467; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form {
  display: inline-flex;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  box-shadow: none;
}
.link-button:hover {
  text-decoration: underline;
}
.icon-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}
.icon-button:hover {
  border-color: var(--accent);
  background: #ecfdf3;
  text-decoration: none;
}
.icon-button.danger-text {
  color: var(--danger);
}
.icon-button.danger-text:hover {
  border-color: var(--danger);
  background: #fef3f2;
}
.icon-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.danger-text {
  color: var(--danger);
}
.btn, button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  min-height: var(--touch);
  padding: 11px 14px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn svg, button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.btn.secondary, button.secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); }
.btn:hover { text-decoration: none; }
.btn.icon-button,
button.icon-button,
a.icon-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  gap: 0;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; color: #344054; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: var(--touch);
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 0 0 14px;
}
legend {
  padding: 0 6px;
  font-weight: 700;
}
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.customer-form {
  display: grid;
  gap: 10px;
}
.table td small {
  display: block;
  margin-top: 3px;
}
.actions input[readonly] {
  max-width: 230px;
}
.field-hint {
  color: #b45309;
  font-weight: 600;
}
.login-wrap { max-width: 420px; margin: 72px auto; }
.notice { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; background: #ecfdf3; color: #067647; }
.error { background: #fef3f2; color: var(--danger); }
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
}
.tab-chip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 34px minmax(110px, auto) 34px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.tab-chip.active {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.tab-name-link,
.tab-name-input {
  display: block;
  min-width: 110px;
  max-width: 240px;
  min-height: 40px;
  padding: 10px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  white-space: nowrap;
}
.tab-name-link {
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-name-link:hover { text-decoration: none; background: #f8fafc; }
.tab-name-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #fff;
}
.tab-icon,
.tab-add {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
.tab-icon svg {
  width: 19px;
  height: 19px;
}
.tab-icon:hover,
.tab-add:hover {
  background: #eef2f6;
}
.tab-icon.danger {
  color: var(--danger);
}
.tab-add {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}
.tab-add:hover { background: var(--accent-dark); }
.editor-hero, .editor-wallpaper, .editor-tabs, .editor-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.editor-hero {
  position: sticky;
  top: 0;
  z-index: 4;
}
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.layout-meta { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(120px, 0.6fr) 90px auto; gap: 12px; align-items: end; }
.editor-wallpaper {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px);
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
}
.wallpaper-copy h2 {
  margin: 4px 0 6px;
  font-size: 20px;
}
.wallpaper-copy p:last-child {
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.wallpaper-preview {
  justify-self: end;
  width: min(100%, 320px);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.wallpaper-preview:hover,
.wallpaper-preview:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  transform: translateY(-1px);
  outline: none;
}
.wallpaper-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.editor-tabs {
  padding: 8px;
}
.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.board-head h1 { font-size: 24px; }
.board-head span { color: var(--muted); font-weight: 700; }
.editor-board {
  overflow-x: auto;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  grid-template-rows: repeat(4, minmax(286px, auto));
  gap: 14px;
  align-items: stretch;
}
.slot-shell { min-width: 0; position: relative; }
.tile-topline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}
.tile-actions {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.tile-action {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
.tile-action svg {
  width: 21px;
  height: 21px;
}
.tile-action.danger {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(180, 35, 24, 0.84);
}
.tile-action.success {
  background: #067647;
}
.tile-action:disabled {
  display: none;
}
.slot {
  width: 100%;
  min-height: 286px;
  border: 2px solid var(--tile-color, #000);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.1)),
    var(--tile-color, #000);
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 8px;
  align-content: stretch;
  position: relative;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 120ms ease;
  text-align: left;
  cursor: default;
}
.tile-form {
  cursor: default;
}
.tile-form input,
.tile-form select {
  min-height: 38px;
}
.tile-name {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #f7f7f7;
  color: #111827;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  padding: 9px 10px;
}
.tile-money-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tile-money-edit label {
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}
.tile-money-edit input {
  font-size: 19px;
  font-weight: 700;
  padding-right: 8px;
}
.tile-image-zone {
  width: 100%;
  min-height: 92px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.64);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  background: rgba(255,255,255,0.18);
}
.tile-color-strip {
  width: 100%;
  min-height: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: var(--tile-color, #000);
}
.tile-popover {
  position: absolute;
  top: 50px;
  right: 8px;
  z-index: 8;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}
.color-popover {
  display: grid;
  grid-template-columns: repeat(7, 34px);
  gap: 8px;
  min-width: 314px;
}
.tile-popover[hidden] {
  display: none;
}
.slot:hover {
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.2);
}
.slot:active { transform: scale(0.99); }
.slot.empty {
  background: #f3f5f8;
  color: #475467;
  border: 2px dashed #b8c0cc;
  box-shadow: none;
  text-align: center;
  grid-template-rows: auto auto auto auto 1fr;
  justify-content: stretch;
}
.slot.empty:hover { background: #ffffff; }
.slot.empty .pos { justify-self: start; }
.slot.empty .tile-name { color: #111827; }
.slot.empty .tile-image-zone {
  background: #fff;
  border-color: #d0d5dd;
  color: #667085;
}
.slot.empty .tile-color-strip {
  background: #d0d5dd;
  border-color: #c7ced8;
}
.slot.empty .tile-money-edit label {
  color: #475467;
  text-shadow: none;
}
.slot .pos { font-size: 13px; opacity: 0.88; font-weight: 700; }
.slot .pos[draggable="true"] {
  cursor: grab;
  user-select: none;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
}
.slot .pos[draggable="true"]:active { cursor: grabbing; }
.slot.empty .pos[draggable="true"] {
  cursor: default;
  background: rgba(102, 112, 133, 0.12);
}
.slot.dragging {
  opacity: 0.64;
  transform: scale(0.98);
}
.slot-shell.drop-target .slot {
  outline: 4px solid #22c55e;
  outline-offset: 3px;
}
.slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: rgba(255,255,255,0.18); }
.slot-label { font-size: 25px; line-height: 1.12; word-break: break-word; text-shadow: 0 1px 2px rgba(0,0,0,0.22); }
.slot-type { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.slot-money {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 8px 10px;
  margin: 0 -2px;
  border-radius: 6px;
  background: rgba(255,255,255,0.18);
}
.slot-money b { font-size: 24px; line-height: 1; }
.slot-money em { font-style: normal; font-size: 15px; font-weight: 700; }
.print-badge {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 13px;
  font-weight: 700;
}
button.compact {
  width: auto;
  min-height: 36px;
  padding: 7px 10px;
}
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.native-color {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 56px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}
.native-color input {
  min-height: 42px;
  padding: 3px;
}
.color-swatch {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  border-radius: 6px;
}
.color-swatch span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.media-modal[hidden] { display: none; }
.media-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}
.media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}
.media-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(900px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.28);
}
.modal-upload-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.modal-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}
.modal-media-choice {
  display: grid;
  gap: 5px;
  justify-items: center;
  align-content: start;
  min-height: 132px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
}
.modal-media-choice img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
}
.modal-media-choice.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
  background: #ecfdf3;
}
.image-action {
  width: 100%;
  justify-content: center;
}
.copy-paste-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.delete-action {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}
.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.media-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}
.media-tab.active {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.media-tab span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
}
.wallpaper-library .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.wallpaper-card img {
  aspect-ratio: 16 / 9;
}
.library-grid { align-items: stretch; }
.media-search-panel {
  padding: 12px;
}
.media-search-row {
  font-size: 18px;
}
.media-search-control {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.media-search-input {
  min-height: 50px;
  font-size: 20px;
  font-weight: 700;
}
.media-results-panel h2 {
  margin: 0;
}
.modal-upload-form {
  display: grid;
  gap: 12px;
}
.upload-modal-panel {
  width: min(560px, 96vw);
}
.media-card {
  position: relative;
  padding: 8px;
  min-height: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}
.media-card[hidden] {
  display: none;
}
.media-card.newly-added {
  animation: media-added 1400ms ease;
}
.media-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent), var(--shadow);
}
.media-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f2f4f7; }
.media-card strong { font-size: 16px; line-height: 1.25; word-break: break-word; }
.media-title-input {
  min-height: 34px;
  padding: 6px 7px;
  border: 1px solid transparent;
  background: #fff;
  font-weight: 700;
  font-size: 14px;
}
.media-type-select {
  min-height: 34px;
  padding: 6px 7px;
  font-size: 13px;
}
.media-type-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.media-title-input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 118, 110, 0.16);
}
.media-delete-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.92);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.24);
}
.media-delete-icon svg {
  width: 18px;
  height: 18px;
}
.usage-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.usage-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.upload-queue {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}
.upload-queue-row {
  display: grid;
  grid-template-columns: 70px minmax(140px, 1fr) 140px 90px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.upload-queue-row img {
  width: 70px;
  height: 52px;
  object-fit: cover;
  border-radius: 5px;
}
.layout-media-panel {
  width: min(980px, 96vw);
}
.media-library-modal .panel {
  margin-bottom: 10px;
  box-shadow: none;
}
.media-library-modal .media-results-panel {
  max-height: 58vh;
  overflow: auto;
}
@keyframes media-added {
  0% { box-shadow: 0 0 0 4px rgba(22, 128, 58, 0.55); }
  100% { box-shadow: var(--shadow); }
}
.thumb-option { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.thumb-option img { width: 64px; height: 48px; object-fit: cover; border-radius: 5px; }
.muted { color: var(--muted); }
.inline-form { display: inline; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.status.ok { background: #dcfae6; color: #067647; }
.status.off { background: #f2f4f7; color: #667085; }
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.device-stats .stat { min-height: 100px; }
.device-last-seen {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.device-last-seen strong {
  font-size: 14px;
  font-weight: 800;
}
.device-last-seen small {
  color: var(--muted);
}
.status.warn {
  background: #fef0c7;
  color: #b54708;
}
.status.offline {
  background: #fee4e2;
  color: #b42318;
}
.status.stale {
  background: #f2f4f7;
  color: #475467;
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; gap: 8px; overflow-x: auto; padding: 10px; }
  .stats, .form-grid, .layout-meta, .editor-wallpaper { grid-template-columns: 1fr; }
  .page-head, .compact-head, .board-head { align-items: stretch; flex-direction: column; }
  .slot-grid {
    grid-template-columns: repeat(5, minmax(138px, 1fr));
    min-width: 760px;
    gap: 10px;
  }
  .slot { min-height: 260px; }
  .tile-action {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }
  .tile-name { font-size: 18px; }
  .tile-money-edit input { font-size: 16px; }
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
@media (max-width: 560px) {
  .content { padding: 10px; }
  .topbar { padding: 0 12px; }
  .slot-grid {
    grid-template-columns: repeat(5, minmax(126px, 1fr));
    min-width: 690px;
    gap: 8px;
  }
  .slot {
    min-height: 248px;
    padding: 8px;
  }
  .editor-hero { position: static; }
  .actions { align-items: stretch; }
  .actions > *, .btn, button { width: 100%; justify-content: center; }
  .slot button,
  .tab-icon,
  .tab-add,
  .tile-popover button,
  .modal-media-choice,
  .modal-actions button {
    width: auto;
  }
  .slot .tile-image-zone,
  .slot .tile-color-strip {
    width: 100%;
  }
  .tile-actions { gap: 3px; }
  .tile-action {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
  }
  .tile-action svg {
    width: 17px;
    height: 17px;
  }
  .tile-money-edit { grid-template-columns: 1fr; }
  .tile-image-zone { min-height: 72px; }
  .color-popover {
    left: 8px;
    right: auto;
    min-width: 282px;
    grid-template-columns: repeat(7, 30px);
  }
  .color-swatch {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }
  .modal-upload-box { grid-template-columns: 1fr; }
  .modal-upload-form { grid-template-columns: 1fr; }
  .upload-queue-row { grid-template-columns: 58px 1fr; }
  .modal-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-media-choice { width: auto; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* LOBI Portal 2026 visual refresh */
:root {
  --bg: #0f2544;
  --app-bg: #f5f8fb;
  --panel: #ffffff;
  --text: #142033;
  --muted: #6b7890;
  --line: #dfe7f1;
  --accent: #17b8b0;
  --accent-dark: #0f827e;
  --accent-soft: #dff8f7;
  --danger: #e5483f;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 45px rgba(24, 39, 75, 0.08);
  --shadow-hover: 0 24px 60px rgba(24, 39, 75, 0.14);
  --radius: 16px;
  --radius-sm: 12px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(97, 218, 251, 0.2), transparent 28rem),
    linear-gradient(135deg, #eef5fb 0%, #f8fbfe 42%, #edf4fa 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 68px;
  min-height: 68px;
  padding: 0 22px;
  background: rgba(15, 37, 68, 0.96);
  border-bottom: 1px solid rgba(153, 205, 230, 0.18);
  box-shadow: 0 16px 38px rgba(15, 37, 68, 0.18);
  backdrop-filter: blur(14px);
}

.brand,
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(92, 225, 230, 0.5);
  border-radius: 12px;
  background: rgba(92, 225, 230, 0.14);
  color: #7ee7ee;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: min(420px, 45vw);
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(173, 210, 229, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #dceeff;
  font-weight: 700;
}

.topbar-search svg {
  width: 19px;
  height: 19px;
  color: #7ee7ee;
}

.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  padding-top: 68px;
}

.sidebar {
  position: sticky;
  top: 68px;
  align-self: start;
  height: calc(100vh - 68px);
  padding: 22px 16px;
  background: linear-gradient(180deg, #142d51 0%, #102540 100%);
  border-right: 1px solid rgba(153, 205, 230, 0.16);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.sidebar a,
.nav-disabled {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #b9c9db;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sidebar a svg,
.nav-disabled svg {
  width: 21px;
  height: 21px;
}

.sidebar a:hover {
  transform: translateX(2px);
  background: rgba(126, 231, 238, 0.1);
  color: #ffffff;
  text-decoration: none;
}

.sidebar a.active {
  background: linear-gradient(135deg, #41d7de 0%, #16b8b0 100%);
  color: #09233d;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 14px 28px rgba(18, 184, 176, 0.3);
}

.nav-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.content {
  min-width: 0;
  padding: 28px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.02em;
}

h2 {
  letter-spacing: -0.01em;
}

.page-head {
  min-height: 64px;
  margin-bottom: 22px;
}

.panel,
.card,
.editor-hero,
.editor-wallpaper,
.editor-tabs,
.editor-board {
  border: 1px solid rgba(190, 205, 222, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel,
.editor-hero,
.editor-wallpaper,
.editor-tabs,
.editor-board {
  padding: 20px;
  margin-bottom: 18px;
}

.card,
.media-card,
.stat,
.modal-media-choice,
.usage-item,
.upload-queue-row {
  border-radius: var(--radius-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover,
.media-card:hover,
.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 184, 176, 0.38);
  box-shadow: var(--shadow-hover);
}

.stat {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(190, 205, 222, 0.7);
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto -28px -44px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(23, 184, 176, 0.12);
}

.stat span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.stat strong {
  color: #102540;
  font-size: 36px;
}

.table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
}

.table th {
  background: #edf4f8;
  color: #44546a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  background: #fff;
}

.table tbody tr td {
  transition: background 140ms ease;
}

.table tbody tr:hover td {
  background: #f7fcfd;
}

.btn,
button {
  border-radius: 12px;
  border-color: transparent;
  background: linear-gradient(135deg, #18c7bf 0%, #0f8f88 100%);
  box-shadow: 0 10px 22px rgba(15, 143, 136, 0.22);
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 143, 136, 0.28);
}

.btn.secondary,
button.secondary {
  background: #f4f7fb;
  color: #23324a;
  border-color: #dce6f0;
  box-shadow: none;
}

.btn.danger,
button.danger,
.icon-button.danger-text,
.tile-action.danger,
.media-delete-icon {
  background: linear-gradient(135deg, #ef5a50 0%, #cf2f27 100%);
  color: #fff;
  border-color: transparent;
}

.icon-button,
.btn.icon-button,
button.icon-button,
a.icon-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 13px;
  background: #ffffff;
  color: #126b68;
  border: 1px solid #dce6f0;
  box-shadow: 0 8px 18px rgba(24, 39, 75, 0.07);
}

.icon-button:hover {
  background: var(--accent-soft);
  border-color: rgba(23, 184, 176, 0.58);
  box-shadow: 0 14px 26px rgba(18, 184, 176, 0.16);
}

.icon-button svg,
.btn svg,
button svg,
.sidebar svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input,
select,
textarea {
  border-radius: 12px;
  border-color: #dce6f0;
  background: #fbfdff;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 184, 176, 0.14);
}

fieldset {
  border-radius: var(--radius);
  border-color: #dce6f0;
  background: #fbfdff;
}

.notice {
  border: 1px solid rgba(23, 184, 176, 0.22);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.error {
  border-color: rgba(229, 72, 63, 0.26);
}

.tab-chip {
  border-radius: 14px;
  border-color: #dce6f0;
  box-shadow: 0 8px 16px rgba(24, 39, 75, 0.06);
}

.tab-chip.active {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent), 0 12px 28px rgba(23, 184, 176, 0.14);
}

.tab-add {
  background: linear-gradient(135deg, #18c7bf 0%, #0f8f88 100%);
  box-shadow: 0 12px 24px rgba(15, 143, 136, 0.26);
}

.editor-hero {
  top: 68px;
}

.slot-grid {
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  grid-template-rows: repeat(4, minmax(300px, auto));
  gap: 18px;
}

.slot {
  min-height: 300px;
  border-radius: 16px;
  border-width: 1px;
  padding: 12px;
  box-shadow: 0 18px 42px rgba(10, 24, 45, 0.15);
}

.slot:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 58px rgba(10, 24, 45, 0.22);
}

.slot.empty {
  border: 1px dashed #b9c8da;
  background: rgba(255, 255, 255, 0.62);
}

.slot .pos[draggable="true"] {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.slot.empty .pos[draggable="true"] {
  background: #edf2f7;
}

.tile-action {
  border-radius: 11px;
  background: rgba(16, 37, 64, 0.82);
  border-color: rgba(255, 255, 255, 0.22);
}

.drag-handle {
  cursor: grab;
  touch-action: none;
}

.drag-handle:active,
.slot-drag-active .drag-handle {
  cursor: grabbing;
}

.slot-drag-active {
  user-select: none;
}

.slot.dragging {
  opacity: 0.78;
  transform: scale(1.02);
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  cursor: grabbing;
  z-index: 3;
}

.slot-shell.drop-target .slot {
  outline: 4px solid var(--accent);
  outline-offset: 5px;
  box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow-panel);
}

.slot-shell.drop-target .slot.empty::before {
  content: "Hier ablegen";
  position: absolute;
  inset: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: rgba(88, 213, 232, 0.18);
  color: var(--text-main);
  font-weight: 900;
  pointer-events: none;
}

.slot-shell.drop-target .slot.empty::after {
  opacity: 0.22;
}

.tile-name {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.93);
}

.tile-image-zone {
  min-height: 110px;
  border-radius: 13px;
}

.tile-image,
.slot img {
  border-radius: 12px;
}

.tile-color-strip {
  border-radius: 999px;
}

.media-search-panel {
  padding: 16px;
}

.media-search-row {
  color: #22324a;
}

.media-search-control {
  gap: 12px;
}

.media-search-input {
  min-height: 58px;
  border-radius: 16px;
  padding-left: 18px;
}

.media-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.media-card {
  padding: 10px;
  border: 1px solid #dce6f0;
}

.media-card img {
  border-radius: 12px;
}

.media-delete-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.media-modal-panel {
  border-radius: 18px;
  border: 1px solid rgba(190, 205, 222, 0.8);
}

.status.ok {
  background: var(--accent-soft);
  color: #0e716d;
}

.status.off {
  background: #edf2f7;
  color: #657489;
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
  }
  .shell {
    grid-template-columns: 1fr;
    padding-top: 0;
  }
  .sidebar {
    position: sticky;
    top: 68px;
    z-index: 20;
    height: auto;
    display: flex;
    padding: 10px;
  }
  .sidebar a,
  .nav-disabled {
    flex: 0 0 auto;
    margin-bottom: 0;
  }
  .content {
    padding: 18px;
  }
  .editor-hero {
    top: 0;
  }
  .slot-grid {
    min-width: 980px;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar-search {
    min-width: 0;
  }
  .topbar-search span {
    display: none;
  }
  .actions > .icon-button,
  .btn.icon-button,
  button.icon-button,
  a.icon-button {
    width: 44px;
  }
  .content {
    padding: 12px;
  }
  .slot-grid {
    min-width: 900px;
  }
}

/* verbindliches LOBI Dark Designsystem */
:root {
  --bg-main: #132A4A;
  --bg-deep: #0E1F38;
  --bg-panel: #1C365C;
  --bg-panel-soft: #243F68;
  --bg-card: #203A63;
  --bg-card-hover: #294B78;
  --accent: #58D5E8;
  --accent-strong: #22C7D8;
  --accent-soft: rgba(88, 213, 232, 0.16);
  --text-main: #F4F8FF;
  --text-muted: #AFC2DA;
  --text-soft: #7F95B2;
  --danger: #E94343;
  --warning: #F5A623;
  --success: #41D39B;
  --border-soft: rgba(255,255,255,0.14);
  --border-strong: rgba(88,213,232,0.55);
  --shadow-panel: 0 18px 45px rgba(0,0,0,0.28);
  --shadow-card: 0 10px 26px rgba(0,0,0,0.22);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --bg: var(--bg-deep);
  --panel: var(--bg-panel);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --line: var(--border-soft);
  --accent-dark: var(--accent-strong);
  --shadow: var(--shadow-card);
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(88, 213, 232, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(34, 199, 216, 0.12), transparent 30rem),
    linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-main) 48%, #183A63 100%);
  color: var(--text-main);
}

a { color: var(--accent); }
.muted, label, .table td small { color: var(--text-muted); }

.topbar {
  background: rgba(14, 31, 56, 0.96);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-panel);
}

.brand-mark {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--accent);
}

.topbar-search {
  background: var(--bg-panel);
  border-color: var(--border-soft);
  color: var(--text-main);
}

.topbar-search svg { color: var(--accent); }

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--bg-deep), #0A182C);
  border-right: 1px solid var(--border-soft);
}

.sidebar a,
.nav-disabled {
  color: var(--text-muted);
}

.sidebar a:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

.sidebar a.active {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(88,213,232,0.35), 0 14px 28px rgba(88,213,232,0.24);
}

.content { padding: 32px; }

.panel,
.card,
.editor-hero,
.editor-wallpaper,
.editor-tabs,
.editor-board,
fieldset,
.media-modal-panel {
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

.panel,
.editor-hero,
.editor-wallpaper,
.editor-tabs,
.editor-board {
  padding: 24px;
}

.card,
.media-card,
.modal-media-choice,
.upload-queue-row,
.usage-item {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}

.card:hover,
.media-card:hover,
.modal-media-choice:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.table {
  background: transparent;
  color: var(--text-main);
  border-radius: var(--radius-md);
}

.table th {
  background: var(--bg-panel-soft);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table td {
  background: transparent;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-soft);
}

.table tbody tr:hover td {
  background: var(--bg-card-hover);
}

input,
select,
textarea,
.tab-name-input,
.media-title-input,
.media-type-select {
  background: var(--bg-panel-soft);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
}

input:focus,
select:focus,
textarea:focus,
.tab-name-input:focus,
.media-title-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--bg-card-hover);
}

.btn,
button {
  background: var(--accent-strong);
  color: var(--bg-deep);
  border-color: var(--accent-strong);
  border-radius: var(--radius-md);
}

.btn.secondary,
button.secondary,
.icon-button,
.btn.icon-button,
button.icon-button,
a.icon-button,
.tab-icon,
.tile-action {
  width: 42px;
  height: 42px;
  min-height: 42px;
  background: var(--bg-panel-soft);
  color: var(--accent);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.btn.secondary:hover,
button.secondary:hover,
.icon-button:hover,
.tab-icon:hover,
.tile-action:hover {
  background: var(--accent-soft);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn.danger,
button.danger,
.icon-button.danger-text,
.tab-icon.danger,
.tile-action.danger,
.media-delete-icon {
  background: var(--danger);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}

.btn svg,
button svg,
.icon-button svg,
.tab-icon svg,
.tile-action svg,
.sidebar svg,
.media-delete-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
  color: currentColor;
}

.status.ok {
  background: rgba(65, 211, 155, 0.16);
  color: var(--success);
}

.status.off {
  background: rgba(175, 194, 218, 0.13);
  color: var(--text-soft);
}

.notice {
  background: rgba(65, 211, 155, 0.16);
  color: var(--text-main);
  border: 1px solid rgba(65, 211, 155, 0.35);
}

.notice.error,
.error {
  background: rgba(233, 67, 67, 0.16);
  color: var(--text-main);
  border-color: rgba(233, 67, 67, 0.42);
}

.tabs {
  min-height: 46px;
}

.tab-chip {
  background: var(--bg-panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.tab-chip.active {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(88,213,232,0.28), 0 12px 26px rgba(0,0,0,0.24);
}

.tab-name-link,
.tab-name-input {
  color: var(--text-main);
  border-color: var(--border-soft);
}

.tab-add {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  background: var(--accent);
  color: var(--bg-deep);
  border-radius: 12px;
}

.slot-grid {
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  grid-template-rows: repeat(4, minmax(300px, auto));
}

.slot {
  border-radius: var(--radius-md);
  border-color: rgba(255,255,255,0.2);
  box-shadow: var(--shadow-card);
}

.slot.empty {
  background: rgba(28, 54, 92, 0.62);
  color: var(--text-muted);
  border: 1px dashed var(--border-soft);
}

.slot.empty .tile-image-zone {
  background: rgba(36, 63, 104, 0.55);
  border-color: var(--border-soft);
  color: var(--text-soft);
}

.tile-name,
.tile-money-edit input {
  background: rgba(244, 248, 255, 0.92);
  color: #0E1F38;
}

.tile-image-zone {
  background: rgba(14, 31, 56, 0.55);
  border-color: var(--border-soft);
}

.media-search-panel,
.media-results-panel {
  background: var(--bg-panel);
}

.media-search-input {
  background: var(--bg-panel-soft);
  color: var(--text-main);
}

.media-card img {
  border-color: var(--border-soft);
  background: var(--bg-deep);
}

.media-type-badge,
.print-badge {
  background: rgba(14, 31, 56, 0.78);
  color: var(--accent);
  border: 1px solid var(--border-soft);
}

.media-modal-backdrop {
  background: rgba(0,0,0,0.65);
}

.login-wrap {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-wrap .panel {
  width: 100%;
}

@media (max-width: 900px) {
  .sidebar {
    width: auto;
  }
  .content {
    padding: 20px;
  }
}

/* Korrekturen nach Redesign: kompakter Portalmaßstab */
.topbar {
  height: 58px;
  min-height: 58px;
  padding: 0 16px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.topbar-search {
  min-height: 38px;
  min-width: min(340px, 40vw);
  padding: 0 12px;
  font-size: 14px;
}
.shell {
  grid-template-columns: 220px minmax(0, 1fr);
  padding-top: 58px;
}
.sidebar {
  top: 58px;
  width: 220px;
  height: calc(100vh - 58px);
  padding: 16px 12px;
}
.sidebar a,
.nav-disabled {
  min-height: 40px;
  margin-bottom: 6px;
  padding: 0 11px;
  border-radius: 12px;
  gap: 10px;
  font-size: 14px;
}
.sidebar a svg,
.nav-disabled svg {
  width: 19px;
  height: 19px;
}
.content {
  padding: 22px;
}
h1 {
  font-size: clamp(24px, 2.2vw, 32px);
}
h2 {
  font-size: 20px;
}
.page-head {
  min-height: 48px;
  margin-bottom: 16px;
}
.panel,
.editor-hero,
.editor-wallpaper,
.editor-tabs,
.editor-board {
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 18px;
}
.table th,
.table td {
  padding: 9px 11px;
}
.table th {
  font-size: 11px;
}
.btn.secondary,
button.secondary,
.icon-button,
.btn.icon-button,
button.icon-button,
a.icon-button,
.tab-icon,
.tile-action,
.tab-add {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
}
.btn svg,
button svg,
.icon-button svg,
.tab-icon svg,
.tile-action svg,
.sidebar svg,
.media-delete-icon svg {
  width: 19px;
  height: 19px;
}
input,
select,
textarea {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
}
.layout-meta {
  grid-template-columns: minmax(160px, 1fr) minmax(190px, 1.1fr) minmax(105px, 0.55fr) 70px auto;
  gap: 10px;
}
.editor-hero {
  top: 58px;
}
.editor-tabs {
  padding: 8px 10px;
}
.tabs {
  min-height: 40px;
  gap: 6px;
}
.tab-chip {
  grid-template-columns: 32px minmax(96px, auto) 32px;
  min-height: 38px;
  border-radius: 12px;
}
.tab-name-link,
.tab-name-input {
  min-height: 36px;
  min-width: 96px;
  max-width: 205px;
  padding: 8px 10px;
  font-size: 14px;
}
.tab-icon,
.tab-add {
  width: 32px;
  min-width: 32px;
  height: 36px;
  min-height: 36px;
}
.tab-add {
  width: 36px;
  min-width: 36px;
  border-radius: 10px;
}
.board-head {
  margin-bottom: 12px;
}
.board-head h1 {
  font-size: 22px;
}
.slot-grid {
  grid-template-columns: repeat(5, minmax(148px, 1fr));
  grid-template-rows: repeat(4, minmax(206px, auto));
  gap: 10px;
}
.slot {
  min-height: 206px;
  padding: 7px;
  gap: 5px;
  border-radius: 10px;
  grid-template-rows: auto auto auto auto;
}
.tile-topline {
  grid-template-columns: 1fr;
  gap: 4px;
}
.tile-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.tile-action {
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  border-radius: 7px;
}
.tile-action svg {
  width: 15px;
  height: 15px;
}
.slot .pos {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.slot .pos[draggable="true"] {
  padding: 0;
}
.tile-image-zone {
  min-height: 68px;
  border-radius: 9px;
}
.tile-color-strip {
  display: none !important;
}
.tile-name {
  min-height: 31px;
  padding: 5px 7px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
}
.tile-money-edit {
  gap: 5px;
}
.tile-money-edit label {
  font-size: 10px;
  gap: 2px;
}
.tile-money-edit input {
  min-height: 29px;
  padding: 4px 7px;
  font-size: 13px;
}
.print-badge {
  min-height: 22px;
  padding: 3px 7px;
  font-size: 11px;
}
.media-search-input {
  min-height: 46px;
  font-size: 17px;
}
.media-grid {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}
.media-card {
  padding: 8px;
}
.media-delete-icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    padding-top: 0;
  }
  .sidebar {
    top: 58px;
    width: auto;
    height: auto;
  }
  .slot-grid {
    min-width: 790px;
    grid-template-columns: repeat(5, minmax(148px, 1fr));
  }
}

.slot.empty {
  min-height: 88px;
  align-content: center;
  justify-content: center;
  padding: 8px;
  background: rgba(28, 54, 92, 0.34);
  border-color: rgba(255,255,255,0.1);
}
.slot.empty::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: auto;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 25px;
  line-height: 1;
  background: var(--accent-soft);
}
.slot.empty .tile-topline,
.slot.empty .tile-image-zone,
.slot.empty .tile-name,
.slot.empty .tile-money-edit,
.slot.empty .print-badge {
  display: none;
}
.slot.empty.editing-empty {
  min-height: 206px;
  align-content: stretch;
  justify-content: stretch;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.1)),
    var(--tile-color, #000);
}
.slot.empty.editing-empty::after {
  display: none;
}
.slot.empty.editing-empty .tile-topline,
.slot.empty.editing-empty .tile-image-zone,
.slot.empty.editing-empty .tile-name,
.slot.empty.editing-empty .tile-money-edit {
  display: grid;
}

.wallpaper-library .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.wallpaper-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.wallpaper-card .media-title-input {
  min-height: 44px;
}

/* Editor safety: editable article and money fields stay light in every state. */
input,
select,
textarea {
  color-scheme: light;
}

.tile-name,
.article-name-input,
.tile-money-edit input,
input[name="price"],
input[name="deposit"] {
  background: #ffffff;
  color: #0f172a;
  caret-color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: none;
  -webkit-text-fill-color: #0f172a;
}

.tile-name:hover,
.tile-name:active,
.tile-name:focus,
.tile-name:focus-visible,
.article-name-input:hover,
.article-name-input:active,
.article-name-input:focus,
.article-name-input:focus-visible,
.tile-money-edit input:hover,
.tile-money-edit input:active,
.tile-money-edit input:focus,
.tile-money-edit input:focus-visible,
input[name="price"]:hover,
input[name="price"]:active,
input[name="price"]:focus,
input[name="price"]:focus-visible,
input[name="deposit"]:hover,
input[name="deposit"]:active,
input[name="deposit"]:focus,
input[name="deposit"]:focus-visible {
  background: #ffffff;
  color: #0f172a;
  caret-color: #0f172a;
  border-color: rgba(88, 213, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(88, 213, 232, 0.16);
  outline: none;
  -webkit-text-fill-color: #0f172a;
}

.tile-name::placeholder,
.article-name-input::placeholder {
  color: #64748b;
  -webkit-text-fill-color: #64748b;
}

.tile-name:-webkit-autofill,
.tile-name:-webkit-autofill:hover,
.tile-name:-webkit-autofill:focus,
.article-name-input:-webkit-autofill,
.article-name-input:-webkit-autofill:hover,
.article-name-input:-webkit-autofill:focus,
.tile-money-edit input:-webkit-autofill,
.tile-money-edit input:-webkit-autofill:hover,
.tile-money-edit input:-webkit-autofill:focus,
input[name="price"]:-webkit-autofill,
input[name="price"]:-webkit-autofill:hover,
input[name="price"]:-webkit-autofill:focus,
input[name="deposit"]:-webkit-autofill,
input[name="deposit"]:-webkit-autofill:hover,
input[name="deposit"]:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
}
