:root {
  --bg: #f6f2eb;
  --panel: #ffffff;
  --ink: #17233a;
  --muted: #736a5d;
  --line: #e6dac9;
  --brand: #e63946;
  --brand-dark: #c92534;
  --nav: #14233b;
  --nav-soft: #203453;
  --ok: #21824b;
  --warn: #a96700;
  --bad: #bc2131;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Poppins, Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-root {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(20, 35, 59, .82), rgba(20, 35, 59, .82)),
    url("../assets/aussen.jpg") center/cover;
}

.login-panel {
  width: min(100%, 430px);
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
}

.login-brand,
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.login-brand strong,
.side-brand strong {
  display: block;
  line-height: 1.2;
}

.login-brand small,
.side-brand small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.login-panel h1 {
  margin: 28px 0 20px;
  font-size: 30px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8cbb8;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

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

button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
}

.primary-action {
  width: 100%;
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-dark);
}

.error {
  min-height: 20px;
  color: var(--bad);
  font-size: 13px;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: #e8edf5;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}

.side-brand {
  padding: 4px 6px 22px;
}

.side-brand small {
  color: #9eabba;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  color: #c9d3e0;
  text-decoration: none;
  border-radius: 7px;
  display: block;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 13px;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--nav-soft);
  color: #fff;
}

.side-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: grid;
  gap: 10px;
  padding: 18px 6px 0;
}

.side-footer span {
  color: #c9d3e0;
  font-size: 13px;
}

.side-footer button,
.site-link,
.ghost-button {
  background: #fff;
  color: var(--nav);
  text-decoration: none;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 28px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.site-link,
.ghost-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 13px;
}

.menu-btn {
  display: none;
  background: var(--nav);
  color: #fff;
}

.route-view[hidden] {
  display: none;
}

.grid {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 35, 58, .05);
}

.metric {
  padding: 17px;
}

.metric small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 8px;
}

.section-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
}

.panel-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.panel-header h2 {
  font-size: 17px;
  margin: 0;
}

.panel-body {
  padding: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar label {
  margin: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 960px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #eee5d8;
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #faf7f2;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

.primary-line {
  color: var(--ink);
  font-weight: 800;
}

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

.pill {
  display: inline-flex;
  border-radius: 999px;
  background: #f4f0e9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.pill.ok {
  background: #e9f7ee;
  color: var(--ok);
}

.pill.warn {
  background: #fff4dc;
  color: var(--warn);
}

.pill.bad {
  background: #fdebed;
  color: var(--bad);
}

.status-select {
  min-width: 138px;
}

.pagination-bar {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
}

.pagination-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.pagination-actions strong {
  color: var(--ink);
  font-size: 13px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

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

.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
}

.editable-row {
  cursor: pointer;
}

.editable-row:hover {
  background: #fff8ef;
}

.empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

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

.product-search-insert {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 14px 18px 12px;
}

.product-search-insert label {
  display: grid;
  gap: 7px;
}

.product-search-meta {
  color: var(--muted);
  font-size: 12px;
}

.product-image-panel {
  display: grid;
  gap: 10px;
}

.product-image-drop {
  align-items: center;
  background: #fffaf2;
  border: 1px dashed #d8bea0;
  color: var(--brand-dark);
  display: flex;
  justify-content: center;
  min-height: 190px;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.product-image-drop img {
  aspect-ratio: 16 / 10;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.product-image-drop span {
  padding: 18px;
}

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

.danger-button {
  background: #fdebed;
  color: var(--bad);
}

.compact-button {
  padding: 8px 10px;
  font-size: 12px;
}

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

.media-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  padding: 0;
  text-align: left;
}

.media-card img,
.media-card video {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #f4f0e9;
}

.media-card div {
  padding: 10px;
  font-size: 12px;
}

.media-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.media-card .row-actions {
  margin-top: 10px;
}

.placeholder-card {
  min-height: 190px;
  padding: 18px;
}

.placeholder-card h3 {
  margin: 0 0 10px;
}

.placeholder-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 268px;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .menu-btn {
    display: inline-flex;
  }

  .stats-grid,
  .section-grid,
  .placeholder-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (max-width: 640px) {
  .content-shell {
    padding: 18px 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .stats-grid,
  .section-grid,
  .placeholder-grid {
    grid-template-columns: 1fr;
  }
}
