/* Advanced Admin Panel — isolated from existing site CSS */
:root {
  --adm-bg: #f2ead9;
  --adm-panel: #fffdf7;
  --adm-ink: #1a120f;
  --adm-muted: #B8324B;
  --adm-line: rgba(26, 18, 15, 0.12);
  --adm-olive: #96691f;
  --adm-sky: #f2e2be;
  --adm-danger: #a31f1a;
  --adm-warn: #9a7b0a;
  --adm-side: 212px;
  --adm-font: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.adm-body {
  font-family: var(--adm-font);
  background: linear-gradient(160deg, #eee6d4 0%, #f7f1e5 45%, #efe3ce 100%);
  color: var(--adm-ink);
  min-height: 100vh;
}

.adm-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.adm-login-card {
  width: min(420px, 100%);
  background: var(--adm-panel);
  border: 1px solid var(--adm-line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 18px 50px rgba(26, 18, 15, 0.08);
}
.adm-login-card h1 { margin: 8px 0 6px; font-size: 28px; }
.adm-login-card p { margin: 0 0 22px; color: var(--adm-muted); font-size: 14px; }
.adm-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--adm-olive);
  font-weight: 700;
}

.adm-shell { display: none; min-height: 100vh; }
.adm-shell.open { display: grid; grid-template-columns: var(--adm-side) 1fr; }

.adm-sidebar {
  background: #1a120f;
  color: #f2e2be;
  padding: 14px 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.adm-brand { padding: 4px 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 8px; }
.adm-brand-logo { display: block; height: 24px; width: auto; margin-bottom: 4px; }
.adm-brand span { font-size: 11px; opacity: 0.6; }
.adm-nav { flex: 1; }
.adm-nav-label {
  margin: 12px 10px 4px;
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(242, 226, 190,0.4);
  font-weight: 700;
}
.adm-nav-label:first-child { margin-top: 0; }
.adm-sidebar-foot {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 10px;
  padding-top: 10px;
}
.adm-nav-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(242, 226, 190,0.78);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: inherit;
}
.adm-nav-btn:hover, .adm-nav-btn.active { background: rgba(217, 65, 93, 0.18); color: #fff; }
.adm-nav-btn.active { font-weight: 700; }
.adm-nav-btn iconify-icon { flex-shrink: 0; opacity: 0.85; }

.adm-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 15, 0.45);
  z-index: 35;
}
.adm-menu-toggle {
  display: none;
  border: 1px solid var(--adm-line);
  background: var(--adm-panel);
  color: var(--adm-ink);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.adm-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adm-main { padding: 24px 28px 48px; min-width: 0; }
.adm-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.adm-topbar h2 { margin: 0; font-size: 28px; }
.adm-userchip { font-size: 13px; color: var(--adm-muted); }

.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.adm-stat {
  background: var(--adm-panel);
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  padding: 16px;
}
.adm-stat span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--adm-muted); margin-bottom: 6px; }
.adm-stat strong { font-size: 26px; }

.adm-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .adm-shell.open { grid-template-columns: 1fr; }
  .adm-menu-toggle { display: inline-flex; }
  .adm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--adm-side), 86vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(0,0,0,0.25);
  }
  .adm-shell.nav-open .adm-sidebar { transform: translateX(0); }
  .adm-sidebar-backdrop[hidden] { display: none !important; }
  .adm-shell.nav-open .adm-sidebar-backdrop:not([hidden]) { display: block; }
  .adm-grid-2 { grid-template-columns: 1fr; }
}


.adm-card {
  background: var(--adm-panel);
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.adm-card h3 { margin: 0 0 14px; font-size: 16px; }

.adm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.adm-toolbar input, .adm-toolbar select, .adm-field input, .adm-field select, .adm-field textarea {
  border: 1px solid var(--adm-line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--adm-ink);
}
.adm-toolbar input { min-width: 200px; }
.adm-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.adm-field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--adm-muted); }
.adm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
@media (max-width: 700px) { .adm-form-grid { grid-template-columns: 1fr; } }

.adm-btn {
  border: 1px solid var(--adm-ink);
  background: var(--adm-ink);
  color: var(--adm-sky);
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.adm-btn:hover { opacity: 0.92; }
.adm-btn.secondary { background: transparent; color: var(--adm-ink); }
.adm-btn.danger { background: var(--adm-danger); border-color: var(--adm-danger); color: #fff; }
.adm-btn.ghost { background: transparent; border-color: transparent; color: var(--adm-muted); text-decoration: underline; }
.adm-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.adm-table-wrap { overflow: auto; border: 1px solid var(--adm-line); border-radius: 12px; }
.adm-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.adm-table th, .adm-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--adm-line);
  font-size: 13.5px;
  vertical-align: middle;
}
.adm-table th {
  background: rgba(239, 227, 206, 0.55);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.adm-table tr:last-child td { border-bottom: 0; }
.adm-thumb {
  width: 42px; height: 42px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px;
}
.adm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-actions .adm-btn { padding: 6px 10px; font-size: 12px; }

.adm-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--adm-line);
}
.adm-pill.ok { color: var(--adm-olive); background: rgba(150, 105, 31,0.12); }
.adm-pill.warn { color: var(--adm-warn); background: rgba(154,123,10,0.12); }
.adm-pill.bad { color: var(--adm-danger); background: rgba(155,44,44,0.1); }

.adm-panel { display: none; }
.adm-panel.active { display: block; }

.adm-subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.adm-subtab-btn {
  border: 1px solid var(--adm-line);
  background: var(--adm-panel);
  color: var(--adm-ink);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.adm-subtab-btn:hover { border-color: var(--adm-ink); }
.adm-subtab-btn.active { background: var(--adm-ink); color: var(--adm-sky); border-color: var(--adm-ink); font-weight: 600; }
.adm-subpanel { display: none; }
.adm-subpanel.active { display: block; }

.adm-modal-overlay {
  position: fixed; inset: 0; background: rgba(26, 18, 15, 0.45);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.adm-modal-overlay.open { display: flex; }
.adm-modal {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--adm-panel);
  border-radius: 14px;
  padding: 22px;
  border: 1px solid var(--adm-line);
}
.adm-modal h3 { margin: 0 0 16px; }
.adm-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.adm-toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.adm-toast {
  background: var(--adm-ink); color: var(--adm-sky); padding: 12px 14px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); opacity: 0; transform: translateY(8px);
  transition: 0.25s ease;
}
.adm-toast.show { opacity: 1; transform: none; }

.adm-chart {
  display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px;
}
.adm-bar-wrap { flex: 1; text-align: center; }
.adm-bar {
  background: linear-gradient(180deg, #96691f, #1a120f);
  border-radius: 6px 6px 2px 2px;
  margin: 0 auto 6px;
  width: 70%;
  min-height: 4px;
}
.adm-bar-wrap span { font-size: 11px; color: var(--adm-muted); display: block; }

.adm-empty { text-align: center; padding: 36px 12px; color: var(--adm-muted); }
.adm-error { color: var(--adm-danger); font-size: 13px; margin-top: 8px; }
.adm-notice { color: var(--adm-olive); font-size: 13px; margin-top: 8px; font-weight: 600; }

.adm-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adm-upload-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--adm-line);
  background: #efe3ce;
  display: none;
}
.adm-upload-preview.is-visible { display: block; }
.adm-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.adm-upload input[type="file"] {
  font: inherit;
  font-size: 13px;
  max-width: 100%;
}
.adm-upload-hint {
  margin: 0;
  font-size: 12px;
  color: var(--adm-muted);
}
.adm-upload-status {
  margin: 0;
  font-size: 12px;
  color: var(--adm-olive);
}
.adm-upload-status.is-error { color: var(--adm-danger); }

.adm-autosave-status {
  font-size: 12px;
  color: var(--adm-olive);
  margin-left: auto;
}
.adm-autosave-status.is-error { color: var(--adm-danger); }
.adm-fibre-autosave { margin-top: 8px; display: block; }

.adm-upload-library {
  border: 1px solid var(--adm-line);
  border-radius: 10px;
  padding: 12px;
  background: #fffdf7;
  max-height: 260px;
  overflow-y: auto;
}
.adm-upload-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.adm-upload-library-item {
  padding: 0;
  border: 1px solid var(--adm-line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #efe3ce;
  aspect-ratio: 1 / 1;
}
.adm-upload-library-item:hover {
  border-color: var(--adm-ink);
}
.adm-upload-library-item img,
.adm-upload-library-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.adm-upload-library-item video {
  pointer-events: none;
}

/* Curated Pairings picker (artwork modal) */
.adm-pairing-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.adm-pairing-selected:empty { display: none; }
.adm-pairing-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--adm-line);
  border-radius: 999px;
  background: var(--adm-sky);
  font-size: 13px;
  max-width: 100%;
}
.adm-pairing-chip img,
.adm-pairing-result img,
.adm-pairing-noimg {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #efe3ce;
}
.adm-pairing-chip em {
  font-style: normal;
  color: var(--adm-muted);
  margin-left: 4px;
}
.adm-pairing-chip button {
  border: none;
  background: rgba(26, 18, 15, 0.08);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.adm-pairing-chip button:hover { background: rgba(163, 31, 26, 0.18); }
.adm-pairing-picker { position: relative; }
.adm-pairing-results {
  margin-top: 6px;
  border: 1px solid var(--adm-line);
  border-radius: 10px;
  background: var(--adm-panel);
  max-height: 280px;
  overflow-y: auto;
}
.adm-pairing-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--adm-line);
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--adm-ink);
}
.adm-pairing-result:last-child { border-bottom: none; }
.adm-pairing-result:hover:not(:disabled) { background: var(--adm-sky); }
.adm-pairing-result:disabled { cursor: default; opacity: 0.6; }
.adm-pairing-result > span:nth-child(2) { flex: 1; min-width: 0; }
.adm-pairing-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-olive);
  white-space: nowrap;
}

.adm-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.adm-image-item {
  border: 1px solid var(--adm-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fffdf7;
}
.adm-image-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.adm-image-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.adm-image-item-actions .adm-btn {
  width: 100%;
  font-size: 12px;
  padding: 6px 8px;
}
.adm-image-item-actions .adm-pill {
  text-align: center;
}


/* Unread count on a sidebar item (Inquiries) */
.adm-nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--adm-muted);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
