/* Gaya admin panel & halaman login. Dimuat hanya di domain admin (tidak ikut CSS publik yang di-inline). */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --adm-ink: #0b1b3f;
  --adm-muted: #6b7a99;
  --adm-blue: #3b6cf6;
  --adm-line: #eef2fa;
  --adm-card-shadow: 0 1px 2px rgba(11, 27, 63, 0.04), 0 12px 32px rgba(59, 108, 246, 0.06);
}

.admin-body,
.login-body {
  margin: 0;
  color: var(--adm-ink);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.admin-body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 75% -10%, #eef4ff 0%, rgba(238, 244, 255, 0) 60%), linear-gradient(180deg, #f7f9fe 0%, #f4f7fd 100%);
}

/* ---------- sidebar ---------- */
.admin-sidebar {
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--adm-line);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.admin-sidebar__cloud {
  position: absolute;
  left: -40px;
  bottom: -60px;
  width: 300px;
  height: 200px;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(222, 232, 253, 0.55), rgba(214, 226, 252, 0)) 30px 40px / 160px 160px no-repeat,
    radial-gradient(closest-side, rgba(232, 239, 254, 0.6), rgba(228, 236, 253, 0)) 110px 70px / 220px 170px no-repeat;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #5d6b89;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-link svg { color: #6f7d9b; }
.admin-nav-link:hover { background: #f1f5ff; color: var(--adm-ink); }
.admin-nav-link--active,
.admin-nav-link--active:hover { background: #e8f0ff; color: var(--adm-blue); font-weight: 600; }
.admin-nav-link--active svg { color: var(--adm-blue); }

.admin-icon-btn {
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--adm-line);
  border-radius: 12px;
  background: #fff;
  color: var(--adm-muted);
  cursor: pointer;
}

/* ---------- kartu, chip, tanggal ---------- */
.admin-card {
  background: #fff;
  border: 1px solid rgba(238, 242, 250, 0.9);
  border-radius: 20px;
  box-shadow: var(--adm-card-shadow);
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--adm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--adm-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--adm-card-shadow);
}

.admin-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.admin-chip--live { color: #c81e1e; }
.admin-chip--live .admin-chip__dot { background: #dc2626; animation: adm-pulse 1.6s infinite; }
.admin-chip--button { color: var(--adm-blue); cursor: pointer; transition: background 0.15s; }
.admin-chip--button:hover { background: #f1f5ff; }
.admin-chip--button.htmx-request svg { animation: adm-spin 0.8s linear infinite; }

.admin-date-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--adm-card-shadow);
}

/* ---------- toast ---------- */
.admin-toasts {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: 20px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92vw, 380px);
  pointer-events: none;
}

.admin-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--adm-line);
  border-radius: 16px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 16px 40px rgba(11, 27, 63, 0.12);
  pointer-events: auto;
  animation: adm-toast-in 0.25s ease-out;
}

.admin-toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.2s, transform 0.2s; }
.admin-toast__icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; }
.admin-toast--ok .admin-toast__icon { background: #e7f8f1; color: #0f9f74; }
.admin-toast--error .admin-toast__icon { background: #fdecec; color: #dc2626; }
.admin-toast--error { border-color: #fbd5d5; }
.admin-toast__close { flex: none; border: 0; background: none; color: var(--adm-muted); font-size: 20px; line-height: 1; cursor: pointer; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(205, 219, 255, 0.75), rgba(205, 219, 255, 0) 70%),
    radial-gradient(800px 520px at 88% 8%, rgba(226, 214, 255, 0.6), rgba(226, 214, 255, 0) 70%),
    linear-gradient(165deg, #f6f8ff 0%, #ecf1fd 55%, #f2effd 100%);
}

/* Latar ilustrasi login (SVG + CSS, tanpa file gambar) */
.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
}
.login-cloud--1 { left: -12%; bottom: -26%; width: 62vw; height: 52vh; background: radial-gradient(closest-side, #ffffff 0%, rgba(255, 255, 255, 0.85) 45%, rgba(225, 233, 252, 0) 100%); }
.login-cloud--2 { right: -14%; bottom: -30%; width: 70vw; height: 58vh; background: radial-gradient(closest-side, #ffffff 0%, rgba(250, 251, 255, 0.85) 45%, rgba(225, 233, 252, 0) 100%); }
.login-cloud--3 { left: -10%; top: 8%; width: 34vw; height: 46vh; background: radial-gradient(closest-side, rgba(196, 212, 252, 0.55), rgba(196, 212, 252, 0)); }
.login-cloud--4 { right: 6%; top: -12%; width: 40vw; height: 44vh; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0)); }

.login-art {
  position: absolute;
  top: 50%;
  filter: drop-shadow(0 24px 40px rgba(76, 102, 200, 0.16));
}
.login-art--left {
  left: max(2vw, 16px);
  width: min(27vw, 400px);
  transform: translateY(-58%) perspective(900px) rotateY(16deg) rotateX(4deg);
  animation: login-float-left 7s ease-in-out infinite alternate;
}
.login-art--right {
  right: max(1.5vw, 12px);
  width: min(30vw, 440px);
  transform: translateY(-46%);
  animation: login-float-right 8s ease-in-out infinite alternate;
}

@keyframes login-float-left {
  from { transform: translateY(-58%) perspective(900px) rotateY(16deg) rotateX(4deg); }
  to { transform: translateY(-61%) perspective(900px) rotateY(16deg) rotateX(4deg); }
}
@keyframes login-float-right {
  from { transform: translateY(-46%); }
  to { transform: translateY(-49%); }
}

@media (max-width: 1100px) {
  .login-art { display: none; }
}

.login-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 80px rgba(70, 98, 190, 0.18), 0 2px 6px rgba(70, 98, 190, 0.06);
  backdrop-filter: blur(18px);
}

.login-shield {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 150px;
}

.login-glass {
  position: absolute;
  inset: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(236, 241, 255, 0.55));
  box-shadow: 0 12px 30px rgba(91, 108, 220, 0.12);
  backdrop-filter: blur(10px);
}

.login-blob { position: absolute; border-radius: 50%; filter: blur(18px); opacity: 0.75; }
.login-blob--violet { left: 6px; top: 4px; width: 96px; height: 96px; background: #c7b8f8; }
.login-blob--mint { right: 4px; bottom: 2px; width: 70px; height: 70px; background: #9fecd0; }

.login-field {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding: 0 24px;
  border: 1px solid #e3e9f6;
  border-radius: 999px;
  background: #f1f4fb;
  color: #5d6b9a;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-field:focus-within { border-color: #8fb0ff; background: #fff; box-shadow: 0 0 0 4px rgba(59, 108, 246, 0.12); }
.login-field__bar { width: 1px; height: 24px; background: #b8c3dd; }
.login-field__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--adm-ink);
  font: inherit;
  font-size: 15px;
}
.login-field__input::placeholder { color: #9aa6c2; }

.login-finger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 124px;
  height: 124px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  background: radial-gradient(circle at 30% 25%, #4fd0ff 0%, #3b6cf6 45%, #6b3fe0 100%);
  box-shadow: 0 0 0 14px rgba(236, 241, 252, 0.95), 0 0 0 15px rgba(221, 229, 247, 0.9), 0 22px 40px rgba(76, 72, 220, 0.38);
  transition: transform 0.15s, box-shadow 0.15s;
}
.login-finger:hover { transform: translateY(-2px); }
.login-finger:active { transform: scale(0.97); }
.login-finger:focus-visible { outline: 3px solid rgba(59, 108, 246, 0.45); outline-offset: 18px; }

@keyframes adm-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
@keyframes adm-spin { to { transform: rotate(360deg); } }
@keyframes adm-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- komponen halaman (Media, Iklan, SEO, Webmaster, Menu, Profil) ---------- */
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.15s, box-shadow 0.15s, opacity 0.15s; }
.adm-btn svg { width: 18px; height: 18px; }
.adm-btn--primary { background: var(--adm-blue); color: #fff; box-shadow: 0 8px 18px rgba(59, 108, 246, 0.25); }
.adm-btn--primary:hover { background: #2f5be0; }
.adm-btn--ghost { background: #fff; border-color: var(--adm-line); color: var(--adm-ink); }
.adm-btn--ghost:hover { background: #f1f5ff; }
.adm-btn--danger { background: #fff; border-color: #fbd5d5; color: #dc2626; }
.adm-btn--danger:hover { background: #fdecec; }
.adm-btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.adm-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.adm-btn.htmx-request { opacity: 0.7; pointer-events: none; }

.adm-icon-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: #f5f7fc; color: var(--adm-muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.adm-icon-action svg { width: 17px; height: 17px; }
.adm-icon-action:hover { background: #eef3ff; color: var(--adm-blue); }
.adm-icon-action--danger:hover { background: #fdecec; color: #dc2626; }

.adm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--adm-ink); }
.adm-input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #e3e9f6; border-radius: 12px; background: #f8faff; color: var(--adm-ink); font: inherit; font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.adm-input:focus { outline: none; border-color: #8fb0ff; background: #fff; box-shadow: 0 0 0 4px rgba(59, 108, 246, 0.12); }
textarea.adm-input { height: auto; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.adm-input--mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
select.adm-input { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, #6b7a99 50%), linear-gradient(135deg, #6b7a99 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.adm-help { font-size: 12px; line-height: 1.5; color: var(--adm-muted); }
.adm-counter { font-size: 12px; font-weight: 500; color: var(--adm-muted); font-variant-numeric: tabular-nums; }
.adm-counter.is-bad { color: #dc2626; }

.adm-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: #eef3ff; }
.adm-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--adm-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.adm-tab[aria-selected="true"] { background: #fff; color: var(--adm-blue); box-shadow: 0 2px 8px rgba(59, 108, 246, 0.12); }
.adm-tab__count { padding: 1px 8px; border-radius: 999px; background: rgba(59, 108, 246, 0.1); font-size: 11px; font-variant-numeric: tabular-nums; }

.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { padding: 12px 16px; border-bottom: 1px solid var(--adm-line); color: #8a96b2; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.adm-table th.text-right { text-align: right; }
.adm-table td { padding: 14px 16px; border-bottom: 1px solid var(--adm-line); vertical-align: middle; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover td { background: #fafbff; }

.adm-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.adm-badge--blue { background: #eef3ff; color: var(--adm-blue); }
.adm-badge--violet { background: #f1ebfe; color: #7c4fe0; }
.adm-badge--mint { background: #e6f8f2; color: #0f8f69; }
.adm-badge--amber { background: #fff4e5; color: #b45d00; }
.adm-badge--pink { background: #fdeaf3; color: #c2337a; }
.adm-badge--gray { background: #f1f4f9; color: #5d6b89; }

.adm-switch { position: relative; flex: none; width: 46px; height: 26px; margin: 0; appearance: none; border-radius: 999px; background: #dbe3f2; cursor: pointer; transition: background 0.15s; }
.adm-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 27, 63, 0.2); transition: transform 0.15s; }
.adm-switch:checked { background: var(--adm-blue); }
.adm-switch:checked::after { transform: translateX(20px); }
.adm-switch:focus-visible { outline: 3px solid rgba(59, 108, 246, 0.35); outline-offset: 2px; }

.adm-dialog { position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 27, 63, 0.28); backdrop-filter: blur(4px); }
.adm-dialog__panel { display: flex; flex-direction: column; width: min(100%, 680px); max-height: calc(100vh - 32px); overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(11, 27, 63, 0.25); }
.adm-dialog__panel--wide { width: min(100%, 920px); }
.adm-dialog__head, .adm-dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; }
.adm-dialog__head { border-bottom: 1px solid var(--adm-line); }
.adm-dialog__foot { border-top: 1px solid var(--adm-line); background: #f8faff; }
.adm-dialog__body { flex: 1; overflow-y: auto; padding: 22px 24px; }

.adm-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 16px; border: 2px dashed #cfdaf3; border-radius: 20px; background: #f8faff; color: var(--adm-muted); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.adm-dropzone:hover, .adm-dropzone.is-over { border-color: #8fb0ff; background: #f1f5ff; }
.adm-dropzone strong { color: var(--adm-blue); }
form.htmx-request .adm-dropzone { opacity: 0.6; pointer-events: none; }

.adm-media { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--adm-line); border-radius: 18px; background: #fff; transition: box-shadow 0.15s, border-color 0.15s; }
.adm-media:hover { box-shadow: var(--adm-card-shadow); }
.adm-media:has(.adm-media__check:checked) { border-color: #8fb0ff; box-shadow: 0 0 0 3px rgba(59, 108, 246, 0.18); }
.adm-media__thumb { display: flex; align-items: center; justify-content: center; height: 140px; padding: 0; border: 0; background: repeating-conic-gradient(#f3f6fb 0% 25%, #fff 0% 50%) 50% / 18px 18px; cursor: zoom-in; }
.adm-media__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.adm-media__check { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; accent-color: var(--adm-blue); cursor: pointer; }

.adm-serp { padding: 16px 18px; border: 1px solid var(--adm-line); border-radius: 16px; background: #fff; font-family: Arial, sans-serif; }
.adm-serp__url { color: #202124; font-size: 13px; }
.adm-serp__title { margin: 4px 0 3px; color: #1a0dab; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.adm-serp__desc { color: #4d5156; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }

.adm-drag-row.is-dragging td { opacity: 0.35; }
.adm-drag-handle { cursor: grab; color: #a3aec7; }
.adm-drag-handle:active { cursor: grabbing; }
.adm-media__badge { position: absolute; top: 10px; right: 10px; box-shadow: 0 2px 8px rgba(11, 27, 63, 0.08); }

/* ---------- responsif (HP & tablet) ---------- */

/* Tab filter: satu baris yang bisa digeser, bukan terlipat. */
@media (max-width: 767px) {
  .adm-tabs { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .adm-tabs::-webkit-scrollbar { display: none; }
  .adm-tab { flex: none; }
}

/* Tabel → kartu bertumpuk di bawah 1280 px (HP, tablet, laptop kecil dengan sidebar). Kolom berlabel
   memakai atribut data-label pada <td>. */
@media (max-width: 1279px) {
  .adm-stack, .adm-stack tbody { display: block; }
  .adm-stack thead { display: none; }
  .adm-stack tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 14px; padding: 16px 18px; border-bottom: 1px solid var(--adm-line); }
  .adm-stack tr[hidden] { display: none; }
  .adm-stack tbody tr:last-child { border-bottom: 0; }
  .adm-stack td { display: block; min-width: 0; padding: 0; border: 0; }
  .adm-stack tbody tr:hover td { background: transparent; }
  .adm-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #8a96b2; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  /* Judul selebar kartu; tombol aksi menempel di pojok kanan atas (lebar disisakan lewat --stack-actions). */
  .adm-stack .adm-stack__main { grid-column: 1 / -1; min-height: 36px; padding-right: var(--stack-actions, 92px); }
  .adm-stack .adm-stack__actions { position: absolute; top: 16px; right: 18px; }
  .adm-stack .adm-stack__wide { grid-column: 1 / -1; }
  .adm-stack .adm-stack__hide { display: none; }
}

/* Tablet & laptop kecil: isian kartu (Posisi, Tipe, Mulai, Berakhir) dalam satu baris. */
@media (min-width: 768px) and (max-width: 1279px) {
  .adm-stack tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .adm-stack .adm-stack__wide { grid-column: span 2; }
}

/* Dialog → bottom sheet di HP. */
@media (max-width: 639px) {
  .adm-dialog { align-items: flex-end; padding: 0; height: 100vh; height: 100dvh; }
  .adm-dialog__panel, .adm-dialog__panel--wide { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 24px 24px 0 0; }
  .adm-dialog__head, .adm-dialog__foot { padding: 16px 18px; }
  .adm-dialog__body { padding: 18px; }
  .adm-dialog__foot { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .adm-dialog__foot .adm-btn { flex: 1; }
}

/* Sidebar sebagai drawer di bawah 1024 px: latar solid agar konten di belakang tidak tembus. */
@media (max-width: 1023px) {
  .admin-sidebar { background: #fff; backdrop-filter: none; }
  .admin-sidebar.translate-x-0 { box-shadow: 20px 0 50px rgba(11, 27, 63, 0.16); }
}

/* Header & chip lebih ringkas di HP. */
@media (max-width: 639px) {
  .admin-chip { height: 40px; padding: 0 12px; font-size: 12.5px; }
  .admin-date-card { padding: 7px 12px; gap: 8px; border-radius: 12px; }
  .admin-card { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-body *, .login-body * { animation: none !important; transition: none !important; }
}
