/*
 * Admin backend theme — modern INSPINIA-style corporate admin: flush dark
 * slate sidebar (no floating cards, no big gaps), flat light-gray content
 * area, turquoise accent (Inspinia's own #1ab394), thin borders instead of
 * soft shadows, compact "ibox" panels, small border radii. Deliberately
 * dense and businesslike rather than airy/spaced-out. These tokens
 * (--brand/--sidebar-*, --font) are meant to carry over to the platform's
 * own marketing/landing page later.
 */

:root {
  --bg: #f3f3f4;
  --surface: #ffffff;
  --fg: #262626;
  --muted: #767676;
  --border: #e7eaec;
  --border-strong: #d7dbdf;

  --brand: #1ab394;
  --brand-deep: #18a689;
  --brand-tint: #e8f8f5;
  --brand-fg: #ffffff;

  --sidebar-bg: #2f4050;
  --sidebar-bg-alt: #293846;
  --sidebar-fg: #dfe4ed;
  --sidebar-muted: #8095a8;

  --radius: 8px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(23, 43, 56, .07), 0 1px 2px rgba(23, 43, 56, .05);
  --shadow-md: 0 10px 24px -10px rgba(23, 43, 56, .18);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font);
  --accent: var(--brand);

  --green-bg: #eaf6f0; --green-fg: #1c8a5e;
  --gray-bg: #eef0f2;  --gray-fg: #5b6a76;
  --amber-bg: #fdf3e2; --amber-fg: #a9720b;
  --red-bg: #fbeae9;   --red-fg: #b91c1c;
  --blue-bg: #e8f1fb;  --blue-fg: #1c5fa8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

h1, h2, h3 { font-weight: 600; }

.admin-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar (flush, full-height, no floating card) ---------- */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  padding: 0 0 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: .9375rem;
  color: var(--sidebar-fg);
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  margin-bottom: .5rem;
}
.brand-mark {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { color: #fff; }

.admin-nav { display: flex; flex-direction: column; gap: 0; padding: 0 .5rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .75rem;
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--sidebar-muted);
  border-left: 3px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .04); color: var(--sidebar-fg); }
.admin-nav a.is-active {
  background: rgba(255, 255, 255, .05);
  color: #fff;
  border-left-color: var(--brand);
}
.admin-nav svg { flex-shrink: 0; opacity: .8; }
.admin-nav a.is-active svg { opacity: 1; color: var(--brand); }

.admin-sidebar-footer {
  margin-top: auto;
  padding: .75rem .75rem 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.admin-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .25rem;
  font-size: .8125rem;
}
.admin-user .avatar {
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.admin-user .name { font-weight: 600; color: var(--sidebar-fg); }
.admin-user .email { color: var(--sidebar-muted); font-size: .75rem; }

.logout-btn {
  background: none; border: 0; color: var(--sidebar-muted); font-size: .8125rem;
  cursor: pointer; padding: .5rem .25rem; width: 100%; text-align: left; border-radius: 3px;
}
.logout-btn:hover { color: var(--sidebar-fg); }

/* ---------- Main ---------- */
.admin-main { flex: 1; min-width: 0; }

.admin-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: 1.75rem;
  position: sticky; top: 0; z-index: 10;
}
.admin-topbar h1 { font-size: 1rem; font-weight: 700; margin: 0; }

.admin-content { padding: 1.75rem; max-width: 1200px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--brand);
}
.stat-card .label { font-size: .75rem; color: var(--muted); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.stat-card .value { font-size: 1.625rem; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Cards / panels ("ibox") ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  padding: .85rem 1.3rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: #fafbfc;
}
.panel-header h2 { font-size: .875rem; font-weight: 700; margin: 0; }
.panel-header p { margin: .15rem 0 0; font-size: .75rem; color: var(--muted); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
thead th {
  text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: .6rem 1.3rem; border-bottom: 2px solid var(--border);
  background: #fafbfc;
}
tbody td { padding: .7rem 1.3rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafb; }

.cell-primary { font-weight: 600; }
.cell-muted { color: var(--muted); }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .6875rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px;
}
.pill-green { background: var(--green-bg); color: var(--green-fg); }
.pill-gray { background: var(--gray-bg); color: var(--gray-fg); }
.pill-amber { background: var(--amber-bg); color: var(--amber-fg); }
.pill-red { background: var(--red-bg); color: var(--red-fg); }
.pill-blue { background: var(--blue-bg); color: var(--blue-fg); }

/* ---------- Brightness slider (hell/dunkel toggle) ---------- */
.brightness-toggle-wrap { display: inline-flex; align-items: center; gap: .5rem; }
.brightness-label { font-size: .75rem; color: var(--muted); width: 3.2em; text-align: center; }
.brightness-label.is-current { color: var(--fg); font-weight: 600; }
.brightness-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.brightness-switch input { opacity: 0; width: 0; height: 0; }
.brightness-switch-slider {
  position: absolute; inset: 0; cursor: pointer; background-color: #d9dde1;
  transition: background-color .15s ease; border-radius: 999px;
}
.brightness-switch-slider::before {
  position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background-color: #fff; transition: transform .15s ease; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.brightness-switch input:checked + .brightness-switch-slider { background-color: var(--fg); }
.brightness-switch input:checked + .brightness-switch-slider::before { transform: translateX(18px); }
.brightness-reset {
  border: 0; background: none; padding: .1rem; color: var(--muted); cursor: pointer;
  border-radius: 6px; display: none; font-size: .7rem;
}
.brightness-reset:hover { background: var(--gray-bg); color: var(--fg); }
.brightness-reset.is-visible { display: inline-flex; align-items: center; }

/* ---------- Swatch chips (color list) ---------- */
.chip-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: .3rem .7rem .3rem .3rem; font-size: .8125rem;
  background: var(--surface);
  transition: border-color .12s ease;
}
.color-chip .dot { width: 16px; height: 16px; border-radius: 999px; outline: 1px solid var(--border-strong); }
.color-chip:hover { border-color: var(--brand); }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border-radius: var(--radius); font-weight: 600; font-size: .8125rem;
  padding: .5rem .95rem; cursor: pointer; border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.btn-dark { background: var(--brand); color: var(--brand-fg); }
.btn-dark:hover { background: var(--brand-deep); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--fg); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-deep); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-size: .8125rem; font-weight: 600; margin-bottom: .35rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: .5rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: .8125rem; font-family: var(--font); background: var(--surface);
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.form-error { color: var(--red-fg); font-size: .8125rem; margin-top: .3rem; }

/* ---------- Tabs (shop edit/create + detail page) ---------- */
.tab-nav { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  background: none; border: 0; padding: .7rem 1rem; font-size: .8125rem; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.is-active { color: var(--brand-deep); border-bottom-color: var(--brand); }

/* Stays visible while scrolling a long shop admin page (Produkte, Mockup-
   Studio, …) — pinned right under .admin-topbar's own sticky bar, same
   solid background so content scrolling underneath doesn't show through. */
.tab-nav-sticky {
  position: sticky; top: 56px; z-index: 9;
  background: var(--bg); padding-top: .5rem;
  margin-inline: -1.75rem; padding-inline: 1.75rem;
}

/* ---------- Pill tabs (sub-navigation within a page, e.g. Mediathek's
   Logos/Mockups switch) — rounded, filled when active, distinct from the
   underlined .tab-nav used for the shop's own top-level navigation. */
.pill-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pill-tabs.is-sticky {
  /* top is set precisely in JS (see admin-layout.blade.php's
     positionStickySubnav()) to sit flush under whatever sticky bar(s) are
     above it on this page — a hardcoded guess here left a visible gap/seam
     since .tab-nav-sticky's real rendered height depends on font metrics. */
  position: sticky; top: 56px; z-index: 8;
  background: var(--bg); padding-block: .75rem;
  margin-inline: -1.75rem; padding-inline: 1.75rem;
}
.pill-tab {
  padding: .45rem 1.1rem; border-radius: 999px; border: 1px solid var(--border-strong);
  font-size: .8125rem; font-weight: 600; color: var(--muted); background: var(--surface);
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.pill-tab:hover { border-color: var(--brand); color: var(--fg); }
.pill-tab.is-active { background: var(--fg); color: #fff; border-color: var(--fg); }

.empty-state { padding: 2.5rem 1.3rem; text-align: center; color: var(--muted); font-size: .8125rem; }

/* ---------- Product cards (shop "Produkte" tab) ---------- */
.product-card-list { display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem; }
.product-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.product-card > summary {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.product-card > summary::-webkit-details-marker { display: none; }
.product-card > summary::before {
  content: ''; width: 0; height: 0; border-style: solid;
  border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--muted);
  transition: transform .12s ease; flex-shrink: 0;
}
.product-card[open] > summary::before { transform: rotate(90deg); }
.product-card[open] > summary { border-bottom: 1px solid var(--border); background: #fafbfc; }
.product-card > summary:hover { background: #fafbfc; }

.product-card-thumb { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; flex-shrink: 0; border: 1px solid var(--border); background: var(--gray-bg); }
.product-card-thumb-empty { display: flex; }
.product-card-heading { flex: 1 1 auto; min-width: 0; }
.product-card-title { font-weight: 700; font-size: .9375rem; }
.product-card-subtitle { font-size: .8125rem; margin-top: .1rem; }
.product-card-meta { font-size: .8125rem; white-space: nowrap; margin-left: auto; padding-left: 1rem; }

.product-card-body { padding: 1.6rem 1.6rem 1.8rem; }
.product-card-divider { height: 1px; background: var(--border); margin: 1.6rem 0; }
.product-card-section-title { font-size: .9375rem; font-weight: 700; margin: 0 0 .85rem; }

@media (max-width: 640px) {
  .product-card-meta { display: none; }
  .product-card-body div[style*="grid-template-columns:2fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* ---------- Login screen ---------- */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-bg);
}
.login-card {
  width: 100%; max-width: 340px; background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 1.0625rem; font-weight: 700; margin: 0 0 .3rem; }
.login-card p.sub { color: var(--muted); font-size: .8125rem; margin: 0 0 1.5rem; }

/* ---------- Blank-photo slots (textile color edit) ---------- */
.photo-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.photo-slot { display: flex; flex-direction: column; gap: .5rem; }
.photo-slot-label { font-size: .8125rem; font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.photo-slot-drop {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: #fafbfc; cursor: pointer; overflow: hidden;
}
.photo-slot-drop:hover { border-color: var(--brand); }
.photo-slot-drop.is-dragover { border-color: var(--brand); border-style: solid; background: var(--brand-tint); }
.photo-slot-drop img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-slot-empty { color: var(--muted); font-size: .75rem; text-align: center; line-height: 1.4; pointer-events: none; }
.photo-slot-drop-wrap { position: relative; }
.photo-slot-remove { position: absolute; top: 6px; right: 6px; margin: 0; }
.photo-slot-remove button {
  width: 22px; height: 22px; border-radius: 999px; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0;
}
.photo-slot-remove button:hover { background: var(--red-fg); }
.photo-slot-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(0, 0, 0, .12);
}
.photo-slot-progress-bar { height: 100%; width: 0%; background: var(--brand); transition: width .1s linear; }

/* ---------- Product colors sub-table (shop "Produkte" tab) ---------- */
.color-manager summary {
  cursor: pointer; font-size: .8125rem; font-weight: 600; color: var(--fg);
  list-style: none; display: inline-flex; align-items: center; gap: .3rem;
}
.color-manager summary::before {
  content: ''; width: 0; height: 0; border-style: solid;
  border-width: 4px 0 4px 6px; border-color: transparent transparent transparent var(--muted);
  transition: transform .12s ease;
}
.color-manager[open] summary::before { transform: rotate(90deg); }
.color-manager summary::-webkit-details-marker { display: none; }
.subtable { margin-top: .6rem; font-size: .8125rem; }
.subtable th, .subtable td { padding: .5rem .6rem; }
.subtable thead th { font-size: .6875rem; }

/* ---------- Generic <details> lists (textile pool colors, etc.) ---------- */
details > summary {
  cursor: pointer; font-size: .8125rem; font-weight: 600; color: var(--fg);
  list-style: none; display: inline-flex; align-items: center; gap: .3rem;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ''; width: 0; height: 0; border-style: solid;
  border-width: 4px 0 4px 6px; border-color: transparent transparent transparent var(--brand);
  transition: transform .12s ease; flex-shrink: 0;
}
details[open] > summary::before { transform: rotate(90deg); }

/* ---------- Toast (save feedback etc.) ---------- */
.toast {
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 1000;
  display: flex; align-items: center; gap: .7rem;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -12px rgba(23, 43, 56, .28), 0 2px 8px rgba(23, 43, 56, .08);
  padding: .9rem 1rem .9rem 1.1rem; font-size: .875rem; font-weight: 600; color: var(--fg);
  min-width: 280px; max-width: 380px;
  overflow: hidden;
  animation: toast-in .32s cubic-bezier(.2, .9, .3, 1.3), toast-out .25s ease 3.2s forwards;
}
.toast-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-fg); color: #fff;
}
.toast-error .toast-icon { background: var(--red-fg); }
.toast-message { flex: 1; line-height: 1.35; }
.toast-close {
  flex-shrink: 0; border: 0; background: none; padding: .2rem; margin: -.2rem -.2rem -.2rem 0;
  color: var(--muted); cursor: pointer; border-radius: 6px; display: flex;
}
.toast-close:hover { background: var(--gray-bg); color: var(--fg); }
.toast-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--green-fg); transform-origin: left;
  animation: toast-progress 3.2s linear forwards;
}
.toast-error .toast-progress { background: var(--red-fg); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
