/* ============================================================
   FAMOUSONE CMS — "Aurora Admin" design system
   Subset Aurora dashboard: dark #0B0919, cyan→indigo→violet
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0B0919;
  --bg-deep: #080714;
  --ink: #F4F2FF;
  --muted: #A39CC4;
  --faint: #6E6894;

  --cyan: #22D3EE;
  --indigo: #6366F1;
  --violet: #8B5CF6;

  --green: #34D399;
  --red: #FB7185;
  --amber: #FBBF24;

  --grad: linear-gradient(92deg, #22D3EE 0%, #6366F1 55%, #8B5CF6 100%);
  --grad-text: linear-gradient(92deg, #7DF3FF 0%, #A5B4FC 45%, #D8B4FE 100%);
  --grad-soft: linear-gradient(100deg, rgba(34, 211, 238, 0.16), rgba(139, 92, 246, 0.14));

  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);

  --radius: 20px;
  --radius-sm: 13px;
  --radius-xs: 10px;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 10px 34px rgba(99, 102, 241, 0.38);

  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-body);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.5); color: #fff; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
svg { display: block; }

/* ---------------- Background aurora ---------------- */
.bg-aurora {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background: var(--bg);
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: drift 26s ease-in-out infinite alternate;
}
.orb-1 {
  width: 560px; height: 560px; top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.34), transparent 65%);
}
.orb-2 {
  width: 640px; height: 640px; top: -120px; right: -160px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.38), transparent 65%);
  animation-delay: -8s;
}
.orb-3 {
  width: 720px; height: 720px; bottom: -320px; left: 32%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28), transparent 66%);
  animation-delay: -16s;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 95% 70% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 95% 70% at 50% 0%, #000 30%, transparent 100%);
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 25px) scale(0.96); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- Layout ---------------- */
.container-wide { width: min(1560px, 95%); margin-inline: auto; }
.page { min-height: 60vh; }
.cms-page { min-height: calc(100vh - 68px); padding-bottom: 40px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-title { font-size: 1.45rem; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- Topbar ---------------- */
.cms-topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 9, 25, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.cms-topbar-inner {
  display: flex; align-items: center; gap: 24px; height: 68px;
}
.cms-left { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }

.cms-side-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); transition: all .18s ease;
}
.cms-side-toggle:hover { color: var(--ink); background: rgba(255, 255, 255, 0.07); }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; }
.brand-badge {
  font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #7DE8F8;
  border: 1px solid rgba(34, 211, 238, .35);
  background: rgba(34, 211, 238, .1);
  padding: 3px 9px; border-radius: 999px;
}

.cms-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* Jam real time di header */
.cms-clock {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.15; gap: 2px;
  padding: 2px 10px;
  border-left: 1px solid var(--line);
  margin-right: 2px;
}
.cms-clock-time {
  font-family: var(--font-display); font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: .98rem; color: var(--ink); letter-spacing: .02em;
}
.cms-clock-date {
  font-size: .62rem; font-weight: 600; letter-spacing: .04em;
  color: var(--faint);
}

.cms-profile { position: relative; }
.cms-account {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink); font-family: inherit; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.cms-account:hover { border-color: rgba(99, 102, 241, 0.55); background: rgba(255, 255, 255, 0.08); }
.cms-acc-body { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.cms-acc-name { font-weight: 700; font-size: .86rem; }
.cms-acc-role {
  font-size: .6rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #7DE8F8;
}
.cms-acc-chev { color: var(--faint); display: grid; place-items: center; }

.cms-menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 70;
  min-width: 240px; padding: 8px;
  background: rgba(14, 12, 30, 0.94);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.55);
  display: none;
}
.cms-menu.open { display: block; animation: fadeUp .18s ease both; }
.cms-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 11px;
  font-size: .9rem; font-weight: 600; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.cms-menu a svg { flex: 0 0 auto; color: var(--faint); transition: color .15s ease; }
.cms-menu a:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.cms-menu a:hover svg { color: #7DE8F8; }
.cms-menu a.cms-menu-danger { color: #FDA4AF; }
.cms-menu a.cms-menu-danger svg { color: #FB7185; }
.cms-menu a.cms-menu-danger:hover { background: rgba(244, 63, 94, 0.12); color: #FECDD3; }
.cms-menu-sep { height: 1px; background: var(--line); margin: 7px 6px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  font-weight: 800; font-size: .9rem;
}

/* ---------------- Layout 2 kolom: sidebar + main ---------------- */
.cms-layout {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  gap: 28px; align-items: start;
  padding: 28px 0 40px;
}
.cms-main { min-width: 0; }

.cms-side {
  position: sticky; top: 88px;
  max-height: calc(100vh - 108px); overflow-y: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 12px 18px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.cms-side::-webkit-scrollbar { width: 6px; }
.cms-side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; }

.side-group { padding: 6px 0 10px; }
.side-group + .side-group {
  border-top: 1px solid var(--line);
  margin-top: 8px; padding-top: 14px;
}
.side-group-label {
  font-size: .62rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint); padding: 0 12px 9px;
}
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px; border-radius: 11px;
  font-size: .9rem; font-weight: 600; color: var(--muted);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.side-item .side-ico { display: grid; place-items: center; color: var(--faint); flex: 0 0 auto; transition: color .15s ease; }
.side-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.side-item:hover .side-ico { color: #7DE8F8; }
.side-item.active {
  background: var(--grad-soft);
  border-color: rgba(99, 102, 241, 0.45);
  color: #fff;
}
.side-item.active .side-ico { color: #7DE8F8; }

.cms-backdrop { display: none; }

/* ---------------- Cards ---------------- */
.card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}
.card h3 { font-size: 1.14rem; margin-bottom: 9px; }
.card p { color: var(--muted); font-size: 0.94rem; }

.card-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-title { font-size: 1.08rem; font-weight: 700; font-family: var(--font-display); }
.card-title small { display: block; font-family: var(--font-body); font-size: .8rem; color: var(--faint); font-weight: 500; margin-top: 2px; }

/* ---------------- Stat cards ---------------- */
.cms-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px; margin-bottom: 24px;
}
.cms-stat {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  position: relative; overflow: hidden;
}
.cms-stat::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: .8;
}
.cms-stat-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  color: var(--faint);
  display: flex; align-items: center; gap: 7px;
}
.cms-stat-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.9rem; margin-top: 10px; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.cms-stat-note { font-size: .76rem; color: var(--faint); margin-top: 6px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px;
  border: 1px solid transparent;
  font-size: .9rem; font-weight: 700; letter-spacing: .01em;
  transition: all .18s ease;
  color: var(--ink); background: rgba(255, 255, 255, 0.06);
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.1); }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.38);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(99, 102, 241, 0.55); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, .25); background: rgba(255,255,255,.05); }
.btn-danger { background: rgba(244, 63, 94, 0.15); color: #FDA4AF; border-color: rgba(244, 63, 94, .3); }
.btn-danger:hover { background: rgba(244, 63, 94, 0.24); color: #FECDD3; }
.btn-sm { padding: 7px 13px; font-size: .8rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: .98rem; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.badge.cyan   { background: rgba(34, 211, 238, 0.12);  color: #7DE8F8; border-color: rgba(34, 211, 238, .32); }
.badge.violet { background: rgba(139, 92, 246, 0.15);  color: #C9B6FE; border-color: rgba(139, 92, 246, .36); }
.badge.green  { background: rgba(52, 211, 153, 0.12);  color: #6EE7B7; border-color: rgba(52, 211, 153, .3); }
.badge.red    { background: rgba(251, 113, 133, 0.12); color: #FDA4AF; border-color: rgba(251, 113, 133, .3); }
.badge.amber  { background: rgba(251, 191, 36, 0.12);  color: #FCD34D; border-color: rgba(251, 191, 36, .3); }
.badge.gray   { background: rgba(255, 255, 255, 0.05); color: var(--muted); border-color: var(--line); }

/* ---------------- Alerts ---------------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 13px;
  font-size: .88rem; font-weight: 500;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  margin-bottom: 16px;
}
.alert.success { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, 0.1); color: #6EE7B7; }
.alert.error   { border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, 0.1); color: #FDA4AF; }
.alert.warn    { border-color: rgba(251, 191, 36, .35);  background: rgba(251, 191, 36, 0.1);  color: #FCD34D; }

/* ---------------- Forms ---------------- */
.cms-form .field { margin-bottom: 16px; }
.cms-form label {
  display: block; font-size: .8rem; font-weight: 700;
  color: var(--muted); margin-bottom: 7px; letter-spacing: .01em;
}
.cms-form label .req { color: #FB7185; }
.input, .cms-form select, .cms-form textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: .92rem;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cms-form textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.input::placeholder, .cms-form textarea::placeholder { color: var(--faint); }
.input:focus, .cms-form select:focus, .cms-form textarea:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13);
  background: rgba(255, 255, 255, 0.07);
}
.cms-form 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='%236E6894' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 15px;
  padding-right: 38px;
}
.cms-form select option { background: #12101F; color: var(--ink); }
.cms-form .hint { font-size: .76rem; color: var(--faint); margin-top: 6px; }
.cms-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cms-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.field-note { font-size: .78rem; color: var(--faint); margin-top: 6px; }

/* File input ringkas */
.cms-filebox {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}
.cms-filebox input[type=file] {
  color: var(--muted); font-size: .82rem;
}
.cms-filebox input[type=file]::file-selector-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 7px 13px;
  font-weight: 700; font-size: .8rem;
  margin-right: 10px; cursor: pointer;
  transition: background .15s ease;
}
.cms-filebox input[type=file]::file-selector-button:hover { background: rgba(255,255,255,.14); }

/* ---------------- Tabel data ---------------- */
.cms-table-wrap {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.cms-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cms-table thead th {
  text-align: left;
  font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}
.cms-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--muted);
  vertical-align: middle;
}
.cms-table tbody tr:last-child td { border-bottom: none; }
.cms-table tbody tr { transition: background .13s ease; }
.cms-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.cms-table .cell-strong { color: var(--ink); font-weight: 600; }
.cms-table .cell-mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cms-table .cell-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cms-table .row-empty td { text-align: center; padding: 40px 16px; color: var(--faint); font-size: .9rem; }

/* ---------------- Search & filter bar ---------------- */
.cms-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.cms-toolbar .cms-search {
  position: relative; flex: 1; min-width: 220px;
}
.cms-toolbar .cms-search input {
  width: 100%; padding: 10px 14px 10px 38px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); font-size: .88rem; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.cms-toolbar .cms-search input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13);
}
.cms-toolbar .cms-search .search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--faint); display: grid; place-items: center; pointer-events: none;
}

/* ---------------- Detail user / panel ---------------- */
.cms-detail-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px;
}
.cms-detail-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px;
}
.cms-detail-box .db-label {
  font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
}
.cms-detail-box .db-value { font-weight: 700; margin-top: 5px; font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.cms-detail-box .db-value.small { font-size: .86rem; font-weight: 600; color: var(--muted); }

/* ---------------- Logs ---------------- */
.log-row {
  display: grid;
  grid-template-columns: 150px 110px 110px 1fr 130px;
  gap: 14px; align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  font-size: .85rem;
}
.log-row:last-child { border-bottom: none; }
.log-row .log-time { color: var(--faint); font-size: .78rem; font-variant-numeric: tabular-nums; }
.log-row .log-admin { color: var(--ink); font-weight: 600; }
.log-row .log-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .log-ip { color: var(--faint); font-size: .76rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Pagination */
.cms-pager { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.cms-pager .pg-info { font-size: .8rem; color: var(--faint); }

/* ---------------- Modal konfirmasi ---------------- */
.cms-modal-bg {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5, 4, 12, 0.6);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.cms-modal-bg.open { display: flex; }
.cms-modal {
  width: min(440px, 100%);
  background: rgba(16, 14, 34, 0.97);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 26px 26px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: fadeUp .18s ease both;
}
.cms-modal h3 { font-size: 1.05rem; margin-bottom: 8px; }
.cms-modal p { color: var(--muted); font-size: .9rem; }
.cms-modal .cms-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ---------------- Auth (login CMS) ---------------- */
.auth-wrap { min-height: calc(100vh - 120px); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 0; }
.auth-card { width: min(430px, 100%); margin-inline: auto; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { width: 52px; height: 52px; margin-inline: auto; border-radius: 15px; }
.auth-brand h1 { font-size: 1.5rem; margin-top: 16px; }
.auth-brand p { color: var(--muted); font-size: .88rem; margin-top: 5px; }

/* ---------------- Misc ---------------- */
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.flex-between { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }

.cms-foot { border-top: 1px solid var(--line); padding: 22px 0; margin-top: 40px; }
.cms-foot p { color: var(--faint); font-size: .8rem; text-align: center; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .cms-topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px 16px; }
  .cms-left { width: 100%; }
  .cms-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; margin-left: 0; }

  .cms-layout { grid-template-columns: 1fr; padding-top: 16px; }
  .cms-side-toggle { display: flex; }
  .cms-side {
    position: fixed; top: calc(var(--cms-top-h, 68px) + 10px); bottom: 0; left: 0;
    width: min(304px, 86vw); max-height: none; height: auto;
    z-index: 65; border-radius: 0 18px 0 0;
    background: rgba(11, 9, 25, 0.97);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    padding: 18px 14px 26px;
    transform: translateX(-104%);
    transition: transform .26s ease, box-shadow .26s ease;
  }
  .cms-side.open { transform: none; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
  .cms-backdrop.show {
    display: block; position: fixed; inset: var(--cms-top-h, 68px) 0 0 0;
    background: rgba(5, 4, 12, 0.55); z-index: 60;
    backdrop-filter: blur(2px);
  }

  .cms-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cms-detail-grid { grid-template-columns: 1fr; }
  .cms-form-row, .cms-form-row-3 { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  .log-row .log-detail { grid-column: 1 / -1; }
  .log-row .log-ip { text-align: left; }
}

@media (max-width: 560px) {
  .cms-stats { grid-template-columns: 1fr; }
  .cms-account .cms-acc-body { display: none; }
  .cms-clock-date { display: none; }
}

/* ============================================================
   Learning Builder — pohon hierarki + RTE + quiz editor
   ============================================================ */
.builder-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.builder-tree {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  position: sticky; top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.builder-form { min-width: 0; }

.tree-node {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .86rem;
}
.tree-mod-head { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.28); margin-top: 8px; }
.tree-sec-head { padding-left: 18px; }
.tree-lesson { padding-left: 30px; font-size: .82rem; }
.tree-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.tree-section .tree-title { color: var(--muted); }
.tree-lesson .tree-title { color: var(--faint); font-weight: 500; }
.tree-acts { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tree-acts a, .tree-acts button {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 7px; font-size: .72rem; font-weight: 700;
  border: 1px solid transparent; background: transparent;
  color: var(--faint); text-decoration: none;
  transition: all .15s ease;
}
.tree-acts a:hover, .tree-acts button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.tree-acts .tadd { border-color: rgba(52, 211, 153, .35); color: #6EE7B7; }
.tree-acts .tadd:hover { background: rgba(52, 211, 153, 0.15); }
.tree-acts .tdel:hover { background: rgba(244, 63, 94, 0.2); color: #FDA4AF; }
.tree-empty { font-size: .74rem; color: var(--faint); padding: 5px 0 5px 18px; font-style: italic; }

/* RTE */
.rte-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.rte-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.rte-toolbar button {
  min-width: 30px; height: 30px; padding: 0 9px;
  border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted);
  font-size: .82rem; font-weight: 600;
  transition: all .15s ease;
}
.rte-toolbar button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.rte-toolbar button.active { background: rgba(34, 211, 238, 0.16); color: #7DE8F8; border-color: rgba(34, 211, 238, .35); }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.rte-body {
  min-height: 240px; max-height: 560px; overflow-y: auto;
  padding: 16px 18px;
  font-size: .95rem; line-height: 1.7; color: var(--ink);
  outline: none;
}
.rte-body:empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }
.rte-body h2 { font-size: 1.25rem; margin: 14px 0 6px; }
.rte-body h3 { font-size: 1.05rem; margin: 12px 0 5px; }
.rte-body p { margin: 8px 0; }
.rte-body ul, .rte-body ol { padding-left: 22px; margin: 8px 0; }
.rte-body blockquote { border-left: 3px solid var(--indigo); padding: 6px 14px; color: var(--muted); margin: 10px 0; background: rgba(255,255,255,.04); border-radius: 0 10px 10px 0; }
.rte-body a { color: #7DE8F8; text-decoration: underline; }
.rte-body img { max-width: 100%; border-radius: 12px; }
.rte-body .youtube-embed {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden; margin: 16px 0;
  border: 1px solid var(--line);
}
.rte-body .youtube-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rte-html { border-radius: 0; border: none; background: rgba(255,255,255,.03); }

/* Insights */
.insight-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.insight-label {
  display: block; font-size: .72rem; font-weight: 800; letter-spacing: .04em;
  color: var(--faint); margin-bottom: 6px; text-transform: uppercase;
}

/* Quiz editor */
.quiz-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.quiz-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; font-size: .8rem; color: var(--muted);
  margin-bottom: 10px;
}
.quiz-card-head .tdel {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  color: var(--faint); font-size: .78rem;
}
.quiz-card-head .tdel:hover { background: rgba(244, 63, 94, 0.2); color: #FDA4AF; }
.quiz-opts { margin-top: 8px; }
.quiz-opt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.quiz-opt-row input[type=radio] { accent-color: #22D3EE; width: 16px; height: 16px; flex: 0 0 auto; }
.quiz-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px;
  text-align: center; color: var(--faint); font-size: .86rem;
}

@media (max-width: 1080px) {
  .builder-layout { grid-template-columns: 1fr; }
  .builder-tree { position: static; max-height: none; }
  .insight-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Pengaturan — Master-Detail / vertical tabs + drag & drop
   ============================================================ */
.md-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.md-master {
  position: sticky; top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 18px 16px;
}
.md-master-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.md-master-hint {
  font-size: .74rem; color: var(--faint);
  margin-bottom: 14px; line-height: 1.5;
}
.md-group { margin-bottom: 14px; }
.md-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.md-group-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-group-count {
  font-size: .64rem; color: var(--faint);
  background: rgba(255,255,255,.06); border-radius: 99px;
  padding: 1px 7px;
}
.md-group-edit {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  color: var(--faint); font-size: .7rem;
  transition: all .15s ease;
}
.md-group-edit:hover { background: rgba(255,255,255,.1); color: #fff; }
.md-group-form {
  display: none; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.md-group-form .input { padding: 7px 10px; font-size: .82rem; }
.md-items { display: flex; flex-direction: column; gap: 3px; }
.ui-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid transparent;
  background: transparent; color: var(--muted);
  font-size: .86rem; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all .14s ease;
  user-select: none;
}
.ui-item:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.ui-item.active {
  background: var(--grad-soft);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}
.ui-item.dragging { opacity: .45; }
.ui-item.drop-target { outline: 1px dashed rgba(34, 211, 238, .6); outline-offset: -1px; }
.ui-drag {
  color: var(--faint); font-size: .72rem; letter-spacing: -2px;
  cursor: grab; flex: 0 0 auto;
}
.ui-item:hover .ui-drag { color: #7DE8F8; }
.ui-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-active-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad);
}

.md-detail { min-width: 0; }
.md-detail-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.md-key-badge {
  font-family: ui-monospace, monospace; font-size: .76rem; font-weight: 700;
  color: #7DE8F8;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, .3);
  border-radius: 8px; padding: 3px 10px;
}
.md-group-chip {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 8px; padding: 3px 10px;
}

@media (max-width: 1080px) {
  .md-layout { grid-template-columns: 1fr; }
  .md-master { position: static; max-height: none; }
}

/* ============================================================
   Sidebar collapse (expand/collapse) — CMS
   ============================================================ */
.side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 4px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.side-head .brand { gap: 9px; min-width: 0; }
.side-head .brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.side-head .brand-name { font-size: .98rem; white-space: nowrap; }
.side-head .brand-badge {
  font-size: .56rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #7DE8F8;
  border: 1px solid rgba(34, 211, 238, .35);
  background: rgba(34, 211, 238, .1);
  padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
}

.side-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all .18s ease;
}
.side-collapse:hover { color: var(--ink); border-color: rgba(99, 102, 241, 0.5); background: rgba(255, 255, 255, 0.09); }
.side-collapse .ic-col { display: none; }

.cms-layout {
  transition: grid-template-columns .3s cubic-bezier(.4, 0, .2, 1);
}

@media (min-width: 1081px) {
  .cms-layout.side-collapsed { grid-template-columns: 74px minmax(0, 1fr); }

  .cms-layout.side-collapsed .side-head { justify-content: center; border-bottom-color: transparent; padding-bottom: 8px; }
  .cms-layout.side-collapsed .side-head .brand { display: none; }
  .cms-layout.side-collapsed .side-collapse .ic-exp { display: none; }
  .cms-layout.side-collapsed .side-collapse .ic-col { display: block; }

  .cms-layout.side-collapsed .side-item { justify-content: center; padding: 10px 4px; }
  .cms-layout.side-collapsed .side-item .side-ico { margin: 0; }
  .cms-layout.side-collapsed .side-item span:not(.side-ico) { display: none; }

  .cms-layout.side-collapsed .side-group-label {
    height: 1px; padding: 0; margin: 10px 14px 6px;
    overflow: hidden; text-indent: -999px;
    background: var(--line); border-radius: 99px;
  }
  .cms-layout.side-collapsed .side-group { padding: 2px 0 8px; }
}

.side-tip {
  position: fixed; z-index: 9999;
  padding: 6px 12px; border-radius: 9px;
  background: rgba(16, 14, 34, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--ink); font-size: .78rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
.side-tip.show { opacity: 1; transform: translateY(-50%) translateX(0); }

@media (max-width: 1080px) {
  .side-collapse { display: none; }
}

/* RTE — tabel */
.rte-body table.rte-table {
  width: 100%; border-collapse: collapse; margin: 14px 0;
  font-size: .9rem;
}
.rte-body table.rte-table th,
.rte-body table.rte-table td {
  border: 1px solid var(--line-strong);
  padding: 8px 12px;
  vertical-align: top; min-width: 40px;
}
.rte-body table.rte-table th {
  background: rgba(99, 102, 241, 0.14);
  color: var(--ink); font-weight: 700; text-align: left;
}
.rte-body table.rte-table td { color: var(--muted); }
.rte-body table.rte-table tr:hover td { background: rgba(255,255,255,0.03); }

/* Refleksi Diri builder (RTE form) */
.ref-pairs { margin-top: 10px; }
.ref-pair {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
}
.ref-pair-inner {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  min-width: 0;
}
.ref-field-label {
  display: block; font-size: .72rem; font-weight: 800;
  color: #7DE8F8; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em;
}
.ref-pair .tdel {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  color: var(--faint); font-size: .8rem;
}
.ref-pair .tdel:hover { background: rgba(244, 63, 94, 0.2); color: #FDA4AF; }
@media (max-width: 720px) {
  .ref-pair-inner { grid-template-columns: 1fr; }
}

/* Carousel / slider uploader (form Sub Bagian) */
.carousel-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px; margin-bottom: 8px;
}
.carousel-item img {
  width: 110px; height: 62px; object-fit: cover;
  border-radius: 8px; flex: 0 0 auto;
  background: rgba(255,255,255,.05);
}
.carousel-meta {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .8rem; color: var(--muted); font-weight: 600;
}
.carousel-acts { display: inline-flex; gap: 6px; }
.carousel-acts button {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  color: var(--faint); font-size: .8rem;
  display: inline-grid; place-items: center;
  transition: all .14s ease;
}
.carousel-acts button:hover:not(:disabled) { background: rgba(255,255,255,.1); color: #fff; }
.carousel-acts button:disabled { opacity: .35; cursor: not-allowed; }
.carousel-acts .tdel:hover { background: rgba(244,63,94,.2); color: #FDA4AF; }

/* ============================================================
   Category Combo (dropdown + search + create new) — E-book
   ============================================================ */
.cat-combo { position: relative; }
.cat-combo-input { padding-right: 42px; }
.cat-combo-chev {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: var(--faint); display: grid; place-items: center;
  transition: all .15s ease;
}
.cat-combo-chev:hover { color: var(--ink); background: rgba(255,255,255,.08); }
.cat-combo-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 999;
  background: rgba(16, 14, 34, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: none;
  max-height: 260px; overflow-y: auto;
}
.cat-combo-panel.open { display: block; animation: fadeUp .14s ease both; }
.cat-combo-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 14px;
  background: transparent; border: none;
  color: var(--muted); font-size: .88rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all .12s ease;
}
.cat-combo-item .cat-ico { color: var(--faint); font-size: .82rem; }
.cat-combo-item:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.cat-combo-create {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px;
  background: var(--grad-soft);
  border: none; border-top: 1px solid rgba(99,102,241,.4);
  color: #7DE8F8; font-size: .86rem; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: all .12s ease;
}
.cat-combo-create:hover { background: rgba(99,102,241,.22); color: #fff; }
.cat-combo-empty {
  padding: 14px; text-align: center;
  color: var(--faint); font-size: .84rem;
}

/* Form e-book: pastikan panel dropdown di atas card di bawahnya */
.ebooks-form-card { position: relative; z-index: 10; }
