/* ============================================================
   Moon Angel — Yönetim Paneli
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --cream: #f7f1e7;
  --cream-2: #efe5d6;
  --ivory: #fffdf8;
  --paper: #ffffff;
  --espresso: #241a12;
  --espresso-2: #3a2b1e;
  --muted: #6f5d49;
  --gold: #b9925a;
  --gold-ink: #8a6634;
  --green: #157347;
  --red: #a33a2a;
  --amber: #8a5a12;
  --line: rgba(36, 26, 18, 0.14);
  --line-soft: rgba(36, 26, 18, 0.08);
  --shadow: 0 24px 60px -34px rgba(36, 26, 18, 0.4);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

.admin-body {
  min-height: 100vh;
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  color: var(--espresso);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

/* ---------- Üst bar ---------- */

.admin-top {
  background: var(--espresso);
  color: var(--ivory);
}

.admin-top-inner {
  width: min(1320px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid rgba(217, 192, 154, 0.6);
  border-radius: 50%;
  color: #d9c09a;
  flex-shrink: 0;
}
.admin-mark svg { width: 21px; height: 21px; }
.admin-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
}
.admin-brand small {
  display: block;
  margin-top: 5px;
  font-size: 8px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 253, 248, 0.62);
}

.admin-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 253, 248, 0.72);
  transition: background 0.2s, color 0.2s;
}
.admin-nav a:hover { color: var(--ivory); background: rgba(255, 253, 248, 0.08); }
.admin-nav a.is-active { color: var(--espresso); background: #d9c09a; }

.admin-top-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.admin-top-actions form { margin: 0; }
.admin-link {
  border: 0;
  padding: 0;
  background: none;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 253, 248, 0.72);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.admin-link:hover { color: var(--ivory); }
.admin-link--button { cursor: pointer; }

/* ---------- Ana alan ---------- */

.admin-main {
  width: min(1320px, calc(100% - 40px));
  margin-inline: auto;
  padding: 40px 0 64px;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.admin-eyebrow {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.admin-page-head h1 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.admin-flash {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 12.5px;
}
.admin-flash--success { color: #0f5132; background: #e7f3ea; border-color: #b8d9c2; }
.admin-flash--error { color: #842029; background: #f8e8e6; border-color: #e2b8b3; }
.admin-flash--info { color: #4a3a22; background: #f3ead9; border-color: #ddc9a6; }

/* ---------- İstatistikler ---------- */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.admin-stat {
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 12px 30px -24px rgba(36, 26, 18, 0.4);
}
.admin-stat span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-stat strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

/* ---------- Kart / panel ---------- */

.admin-card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-card + .admin-card { margin-top: 22px; }
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.admin-card-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}
.admin-card-body { padding: 22px; }

/* ---------- Filtre ---------- */

.admin-filter {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbf7f0;
}
.admin-filter .field { margin: 0; }
.admin-filter .field--search { flex: 1 1 260px; }
.admin-filter .field--compact { flex: 0 1 180px; }

/* ---------- Form alanları ---------- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ivory);
  font-size: 13px;
  color: var(--espresso);
  transition: border-color 0.2s, background 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-ink);
  background: #fff;
}
.field textarea { min-height: 110px; resize: vertical; }
.field small { display: block; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row--3 { grid-template-columns: repeat(3, 1fr); }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0; }
.checkbox-field input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--gold-ink); }
.checkbox-field label { margin: 0; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--espresso); }
.checkbox-field small { display: block; font-size: 10.5px; color: var(--muted); }

/* ---------- Butonlar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--espresso); color: var(--ivory); }
.btn-dark:hover { background: #120d09; }
.btn-gold { background: var(--gold-ink); color: #fff; }
.btn-gold:hover { background: #745428; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--espresso); }
.btn-outline:hover { border-color: var(--espresso); }
.btn-danger { background: transparent; border-color: #d8aaa4; color: var(--red); }
.btn-danger:hover { background: #f8e8e6; border-color: var(--red); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 9px; }
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--espresso);
}
.btn-icon:hover { border-color: var(--espresso); }
.btn-icon svg { width: 15px; height: 15px; }
.btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-row--end { justify-content: flex-end; }

/* ---------- Tablo ---------- */

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.admin-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbf7f0;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: #fdfaf5; }
.admin-table .col-img { width: 58px; }
.admin-table .col-num { text-align: right; white-space: nowrap; }
.admin-table .col-actions { width: 150px; text-align: right; white-space: nowrap; }
.admin-thumb {
  width: 42px; height: 52px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  object-fit: cover;
  background: var(--cream-2);
}
.admin-product-name { font-weight: 500; line-height: 1.35; }
.admin-product-code { margin-top: 2px; font-size: 9px; letter-spacing: 0.08em; color: var(--muted); }
.admin-cat { font-size: 10px; color: var(--muted); }

/* ---------- Etiketler ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--green { background: #e7f3ea; color: #0f5132; }
.tag--amber { background: #f7edd8; color: #7a4f0c; }
.tag--red { background: #f8e8e6; color: #842029; }
.tag--neutral { background: #eee9e1; color: #4f4233; }
.tag--gold { background: #f3ead9; color: #745428; }

/* ---------- Hızlı stok ---------- */

.quick-stock { display: inline-flex; align-items: center; gap: 5px; }
.quick-stock input {
  width: 62px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ivory);
  font-size: 11px;
  text-align: right;
}
.quick-stock button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.quick-stock button:hover { border-color: var(--espresso); background: var(--cream); }

/* ---------- Sayfalama ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  color: var(--muted);
}
.pagination-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a,
.pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.pagination a:hover { border-color: var(--espresso); }
.pagination .is-current { background: var(--espresso); border-color: var(--espresso); color: var(--ivory); }

/* ---------- Ürün formu ---------- */

.product-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}
.form-section + .form-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.form-section h2 {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}
.logo-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbf7f0;
  text-align: center;
}
.logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  padding: 8px;
  border-radius: 8px;
  background: var(--paper);
  object-fit: contain;
}
.logo-preview > span { font-size: 10px; color: var(--muted); }
.logo-fallback {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-ink);
}
.logo-fallback svg { width: 24px; height: 24px; }

.image-preview {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbf7f0;
  text-align: center;
}
.image-preview img {
  width: 100%;
  max-width: 220px;
  max-height: 260px;
  margin: 0 auto 10px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--paper);
}
.image-preview small { display: block; color: var(--muted); font-size: 10px; }
.form-meta {
  margin-top: 10px;
  font-size: 10px;
  color: var(--muted);
}
.form-error {
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #e2b8b3;
  border-radius: 10px;
  background: #f8e8e6;
  color: #842029;
  font-size: 12px;
}
.form-error ul { padding-left: 18px; list-style: disc; }

/* ---------- Giriş ---------- */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(217, 192, 154, 0.35), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(185, 146, 90, 0.22), transparent 40%),
    var(--cream);
}
.login-card {
  width: min(430px, 100%);
  padding: 40px 36px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-brand .admin-mark { width: 46px; height: 46px; color: var(--gold-ink); border-color: var(--gold); }
.login-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.18em;
  line-height: 1;
}
.login-brand small {
  display: block;
  margin-top: 5px;
  font-size: 8px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-card h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
}
.login-card .login-lead { margin: 8px 0 22px; font-size: 12px; color: var(--muted); }
.login-hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  color: var(--muted);
}
.login-hint code { padding: 2px 5px; border-radius: 4px; background: var(--cream-2); color: var(--espresso); }

/* ---------- Alt bilgi ---------- */

.admin-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1320px, calc(100% - 40px));
  margin-inline: auto;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Duyarlı ---------- */

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .product-form-grid { grid-template-columns: 1fr; }
  .admin-top-inner { gap: 16px; }
  .admin-nav { order: 3; width: 100%; }
}

@media (max-width: 620px) {
  .admin-main, .admin-top-inner, .admin-footer { width: calc(100% - 28px); }
  .admin-stats { grid-template-columns: 1fr; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .admin-top-actions { margin-left: 0; }
  .admin-page-head h1 { font-size: 32px; }
  .pagination { flex-direction: column; align-items: flex-start; }
}

/* ---------- Görünüm ---------- */

.range-field {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-field input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--gold-ink);
  cursor: pointer;
}
.range-field output {
  min-width: 62px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--espresso);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}
.color-input {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-input input[type="color"] {
  width: 46px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  cursor: pointer;
}
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 4px; }
.color-input code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.theme-preview {
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--pv-radius, 14px);
  background: var(--pv-bg, #f7f1e7);
  color: var(--pv-text, #241a12);
  font-family: var(--pv-sans, -apple-system, "Segoe UI", Arial, sans-serif);
  font-size: calc(12px * var(--pv-scale, 1));
  line-height: 1.6;
}
.theme-preview-eyebrow {
  margin: 0 0 10px;
  font-size: calc(9px * var(--pv-scale, 1));
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pv-muted, #6f5d49);
}
.theme-preview h3 {
  margin: 0 0 10px;
  font-family: var(--pv-serif, Georgia, serif);
  font-size: calc(26px * var(--pv-scale, 1));
  font-weight: 600;
  line-height: 1.08;
}
.theme-preview h3 em { color: var(--pv-accent-ink, #8a6634); font-style: italic; }
.theme-preview p {
  margin: 0 0 16px;
  font-size: calc(11.5px * var(--pv-scale, 1));
  color: var(--pv-muted, #6f5d49);
}
.theme-preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-preview-btn {
  padding: 8px 14px;
  border-radius: var(--pv-radius, 14px);
  background: var(--pv-text, #241a12);
  color: var(--pv-surface, #fffdf8);
  font-size: calc(10px * var(--pv-scale, 1));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.theme-preview-chip {
  padding: 8px 14px;
  border: 1px solid var(--pv-accent, #b9925a);
  border-radius: 999px;
  color: var(--pv-accent-ink, #8a6634);
  font-size: calc(10px * var(--pv-scale, 1));
}

@media (max-width: 620px) {
  .color-grid { grid-template-columns: 1fr; }
  .theme-preview { padding: 18px; }
}
