/* ==================================================================
   GSS — CMS Admin
   Memakai bahasa visual yang sama dengan landing page (navy + emas),
   tapi dengan kepadatan informasi khas panel admin.
   ================================================================== */

:root {
  --navy-950: #04101F;
  --navy-900: #061829;
  --navy-800: #0A2240;
  --navy-700: #123258;
  --gold-600: #A9861B;
  --gold-500: #C9A227;
  --gold-400: #DCBB55;

  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --ink: #101B2A;
  --muted: #5B6B7D;
  --line: #E3E8EF;

  --ok-bg: #E7F6EE;   --ok-fg: #1B7F4B;
  --draft-bg: #F1F3F7; --draft-fg: #5B6B7D;
  --danger: #C4342B;  --danger-bg: #FCEDEC;

  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,27,42,.06), 0 8px 24px -16px rgba(16,27,42,.28);
  --ease: cubic-bezier(.16,1,.3,1);
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.025em; margin: 0; line-height: 1.2; }

:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: 4px; }

/* ================== Halaman login ================== */
.login {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(90% 70% at 50% 0%, #123258 0%, transparent 60%),
    linear-gradient(160deg, #0A2240 0%, #04101F 100%);
}

.login__card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 22px;
  padding: clamp(2rem, 5vw, 2.75rem);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.6);
}

.login__brand { display: flex; align-items: center; gap: .85rem; margin-bottom: 2rem; }
.login__brand img { width: 46px; height: 46px; }
.login__brand b { font-family: var(--font-display); font-size: 1.0625rem; display: block; letter-spacing: -.02em; }
.login__brand span { font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600); font-weight: 700; }

.login h1 { font-size: 1.625rem; margin-bottom: .5rem; }
.login__sub { color: var(--muted); font-size: .9375rem; margin: 0 0 2rem; }
.login__hint { margin: 1.5rem 0 0; font-size: .8125rem; color: var(--muted); text-align: center; }
.login__back { display: block; text-align: center; margin-top: 1.5rem; font-size: .8125rem; color: var(--muted); }
.login__back:hover { color: var(--navy-800); }

/* ================== Form controls ================== */
.field { display: block; margin-bottom: 1.15rem; }
.field > span {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}
.field > span em { color: var(--danger); font-style: normal; }

.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-size: .9375rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .75rem .9rem;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B7D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 18px; padding-right: 2.4rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201,162,39,.16);
}

/* ================== Tombol ================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .7rem 1.25rem;
  border-radius: 999px;
  font-size: .875rem; font-weight: 600;
  transition: background-color 180ms var(--ease), color 180ms var(--ease),
              transform 180ms var(--ease), border-color 180ms var(--ease), opacity 180ms var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--block { width: 100%; padding-block: .85rem; }

.btn--primary { background: var(--navy-800); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--navy-700); transform: translateY(-1px); }
.btn--gold { background: var(--gold-500); color: var(--navy-900); }
.btn--gold:hover:not(:disabled) { background: var(--gold-400); transform: translateY(-1px); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn--ghost:hover:not(:disabled) { border-color: var(--navy-800); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #A82C24; transform: translateY(-1px); }

/* ================== Layout admin ================== */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--navy-900);
  color: #fff;
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
@media (max-width: 900px) { .sidebar { position: static; height: auto; gap: 1.25rem; } }

.sidebar__brand { display: flex; align-items: center; gap: .8rem; }
/* Cakram putih di belakang logo: sidebar berlatar navy, sedangkan logo GSS
   memuat garis hitam yang tidak terbaca di atasnya. */
.logo-chip {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
}
.sidebar__brand img, .logo-chip img { width: 100%; height: 100%; object-fit: contain; }
.login__brand img { width: 52px; height: 52px; object-fit: contain; }
.sidebar__brand b { font-family: var(--font-display); font-size: .9375rem; display: block; letter-spacing: -.02em; }
.sidebar__brand span { font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); font-weight: 700; }

.sidebar__nav { display: grid; gap: .3rem; }
@media (max-width: 900px) { .sidebar__nav { grid-auto-flow: column; grid-auto-columns: 1fr; } }

.sidebar__link {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem;
  border-radius: 10px;
  font-size: .9375rem; font-weight: 500;
  color: rgba(255,255,255,.7);
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
  width: 100%;
  text-align: left;
}
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar__link.is-active { background: var(--gold-500); color: var(--navy-900); font-weight: 600; }

.sidebar__badge {
  margin-left: auto;
  background: var(--gold-500); color: var(--navy-900);
  font-size: .6875rem; font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: grid; place-items: center; padding-inline: .35rem;
}
.sidebar__link.is-active .sidebar__badge { background: var(--navy-900); color: var(--gold-400); }

.sidebar__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.25rem; display: grid; gap: .3rem; }
@media (max-width: 900px) { .sidebar__foot { margin-top: 0; } }
.sidebar__user { font-size: .8125rem; color: rgba(255,255,255,.55); padding: 0 .85rem .5rem; }
.sidebar__user b { display: block; color: #fff; font-family: var(--font-display); font-size: .9375rem; }

/* ================== Konten ================== */
.main { padding: clamp(1.25rem, 3vw, 2.5rem); min-width: 0; }

.page-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.page-head h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.page-head p { margin: .4rem 0 0; color: var(--muted); font-size: .9375rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; flex: 1 1 180px; max-width: 320px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* ================== Tabel ================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }

thead th {
  text-align: left;
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: .95rem 1.25rem;
  background: #FAFBFC;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color 150ms var(--ease); }
tbody tr:hover { background: #FAFBFC; }

.cell-thumb {
  width: 68px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
}
.cell-name { font-weight: 600; letter-spacing: -.01em; }
.cell-desc {
  color: var(--muted); font-size: .8125rem; margin-top: .15rem;
  max-width: 42ch;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--active { background: var(--ok-bg); color: var(--ok-fg); }
.badge--draft  { background: var(--draft-bg); color: var(--draft-fg); }

.chip {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: .8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--bg); color: var(--navy-800); border-color: var(--line); }
.icon-btn--danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #F5D5D2; }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ================== Empty / loading ================== */
.state { padding: 4rem 1.5rem; text-align: center; color: var(--muted); }
.state svg { width: 46px; height: 46px; margin: 0 auto 1rem; color: var(--line); }
.state h3 { font-size: 1.125rem; color: var(--ink); margin-bottom: .5rem; }
.state p { margin: 0 0 1.5rem; font-size: .9375rem; }

.skeleton-row td > div {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, #EEF1F5 25%, #F7F9FB 37%, #EEF1F5 63%);
  background-size: 400% 100%;
  animation: adminShimmer 1.4s ease infinite;
}
@keyframes adminShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ================== Modal ================== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 1rem;
  background: rgba(4,16,31,.55);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 240ms var(--ease), visibility 240ms;
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal__panel {
  width: 100%; max-width: 620px;
  max-height: 92svh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.55);
  transform: translateY(18px) scale(.98);
  transition: transform 300ms var(--ease);
}
.modal.is-open .modal__panel { transform: none; }
.modal__panel--sm { max-width: 420px; }

.modal__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 1.5rem 0;
}
.modal__head h2 { font-size: 1.3125rem; }
.modal__head p { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; }
.modal__body { padding: 1.5rem; }
.modal__foot {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  background: #FAFBFC;
  position: sticky; bottom: 0;
}

/* Uploader gambar */
.uploader {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1.25rem;
  align-items: center;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.uploader.is-drag { border-color: var(--gold-500); background: rgba(201,162,39,.06); }
@media (max-width: 520px) { .uploader { grid-template-columns: 1fr; } }

.uploader__preview {
  width: 132px; height: 100px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
}
@media (max-width: 520px) { .uploader__preview { width: 100%; height: 160px; } }
.uploader__hint { font-size: .8125rem; color: var(--muted); margin: .5rem 0 0; }
.uploader input[type=file] { display: none; }

/* Notifikasi mengambang */
.toast-wrap { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 300; display: grid; gap: .6rem; justify-items: end; }
.toast {
  display: flex; align-items: center; gap: .7rem;
  background: var(--navy-900); color: #fff;
  padding: .85rem 1.15rem;
  border-radius: 12px;
  font-size: .875rem; font-weight: 500;
  box-shadow: 0 20px 44px -20px rgba(0,0,0,.6);
  animation: toastIn 320ms var(--ease);
  max-width: min(90vw, 380px);
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast--ok svg { color: #5FD08A; }
.toast--error { background: var(--danger); }
.toast.is-leaving { animation: toastOut 240ms var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(10px) scale(.97); } }

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1.15rem;
}
.form-error:empty { display: none; }

/* ================== Pesan masuk ================== */
.messages { display: grid; gap: 1px; background: var(--line); }
.message { background: var(--surface); padding: 1.35rem 1.5rem; }
.message__head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: baseline; justify-content: space-between; }
.message__name { font-weight: 700; letter-spacing: -.01em; }
.message__meta { font-size: .8125rem; color: var(--muted); }
.message__contact { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .35rem; font-size: .875rem; }
.message__contact a { color: var(--navy-700); font-weight: 500; }
.message__contact a:hover { text-decoration: underline; }
.message__text { margin: .9rem 0 0; white-space: pre-wrap; color: #2C3A4B; }
.message__actions { margin-top: .9rem; display: flex; gap: .5rem; }

/* ================== Galeri foto produk ================== */
.gallery { display: grid; gap: 1rem; }

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
}

.gthumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
.gthumb img { width: 100%; height: 100%; object-fit: cover; }

.gthumb__badge {
  position: absolute;
  top: .4rem; left: .4rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Tombol muncul saat kursor di atas thumbnail; selalu tampil di layar sentuh
   karena di sana tidak ada state hover. */
.gthumb__tools {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: center;
  gap: .25rem;
  padding: .4rem;
  background: linear-gradient(transparent, rgba(4,16,31,.85));
  opacity: 0;
  transition: opacity 180ms var(--ease);
}
.gthumb:hover .gthumb__tools,
.gthumb:focus-within .gthumb__tools { opacity: 1; }
@media (hover: none) { .gthumb__tools { opacity: 1; } }

.gthumb__tools .icon-btn { color: #fff; border-color: transparent; }
.gthumb__tools .icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.2); color: #fff; }
.gthumb__tools .icon-btn:disabled { opacity: .35; }

.gallery__drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  text-align: center;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.gallery__drop.is-drag { border-color: var(--gold-500); background: rgba(201,162,39,.06); }
.gallery__drop input[type=file] { display: none; }
.gallery__drop .uploader__hint { margin-top: .7rem; }

/* Jumlah foto pada tabel produk */
.cell-thumbWrap { position: relative; width: 68px; }
.cell-count {
  position: absolute;
  right: -6px; bottom: -6px;
  min-width: 20px; height: 20px;
  padding-inline: .3rem;
  border-radius: 999px;
  background: var(--navy-800);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}

/* ================== Editor konten ================== */
.section-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: .4rem;
  scrollbar-width: thin;
}
.section-tab {
  flex-shrink: 0;
  padding: .6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.section-tab:hover { border-color: var(--navy-800); color: var(--navy-800); }
.section-tab.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

.content-panel__body { padding: clamp(1.25rem, 3vw, 2rem); }
.panel-note {
  margin: 0 0 1.5rem;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  background: #FFF8E6;
  border: 1px solid #F0E2B8;
  /* Versi lebih gelap dari emas #A9861B. Emas aslinya hanya 3.2:1 di atas
     latar krem ini — terlalu tipis untuk teks catatan. Nilai ini 5.6:1. */
  color: #7A6113;
  font-size: .875rem;
}

/* Dua kolom bahasa berdampingan; menumpuk di layar sempit. */
.bi-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; }
@media (min-width: 720px) { .bi-grid { grid-template-columns: 1fr 1fr; gap: 1rem; } }

.bi-cell { display: block; }
.bi-tag {
  display: block;
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: .35rem;
}
.field-note { margin: .5rem 0 0; font-size: .8125rem; color: var(--muted); line-height: 1.55; }

/* Daftar berulang */
.repeat { display: grid; gap: .85rem; }
.repeat__item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  background: #FCFDFE;
}
.repeat__item .field:last-child { margin-bottom: 0; }
.repeat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}
.repeat__num {
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--gold-600);
}
.repeat__tools { display: flex; gap: .25rem; }
.repeat__add { width: 100%; border-style: dashed; }

#contentSave.is-dirty { position: relative; }
#contentSave.is-dirty::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--gold-500);
}

.hidden { display: none !important; }
.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
