/* public/assets/css/app.css */

:root {
  --bg: #0f172a;
  --bg-soft: #020617;
  --surface: #0b1220;
  --surface-soft: #111827;
  --border: rgba(148, 163, 184, 0.25);
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-strong: #4f46e5;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.85);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(59,130,246,0.25), transparent 55%), radial-gradient(circle at bottom right, rgba(16,185,129,0.2), transparent 55%), #020617;
  color: var(--text-main);
  min-height: 100vh;
}

body {
  -webkit-font-smoothing: antialiased;
}
a:link,
a:visited,
a:hover,
a:active {
  text-decoration: none;
}
/* App shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.app-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(90deg, rgba(15,23,42,0.98), rgba(15,23,42,0.96));
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  background: rgba(15,23,42,0.9);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.btn-icon:hover {
  background: rgba(30, 64, 175, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}


    .brand-mark {
      width: 36px;
      height: 36px;
      border-radius: 50%; /* benar-benar bulat */
      background: conic-gradient(from 210deg, #22c55e, #4ade80, #22c55e, #4f46e5);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 12px 35px rgba(34, 197, 94, 0.7);
      flex-shrink: 0;      /* jangan dikecilkan oleh flexbox di header */
    }

    .brand-mark span {
      font-weight: 800;
      font-size: 16px;
      color: #020617;
    }
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: radial-gradient(circle at 30% 0, #a855f7, #22c55e);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.7);
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 14px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.workspace-switcher {
  padding: 6px 10px;
  background: rgba(15,23,42,0.9);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.ws-name {
  font-weight: 500;
}

.ws-pill {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, #34d399, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #022c22;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Body layout */
.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 0;
}
/* Editor full-screen: sembunyikan sidebar utama, lebar penuh */
body.editor-layout .app-body {
  grid-template-columns: minmax(0, 1fr);
}

body.editor-layout .app-sidebar {
  display: none;
}
/* Sidebar */
.app-sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  background: radial-gradient(circle at 0 0, #020617, #020617);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}

.nav-item .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.5);
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

.nav-item.is-active {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color: #f9fafb;
}

.nav-item.is-active .nav-dot {
  background: #e5e7eb;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-help {
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at 0 0, rgba(79,70,229,0.16), rgba(15,23,42,0.9));
}

.sidebar-help-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.sidebar-help-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Main content */
.app-main {
  padding: 24px 24px 28px;
  /* HAPUS atau NONAKTIFKAN overflow di sini supaya sticky jalan */
  /* overflow: auto; */
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 520px;
  margin-top: 6px;
}

.page-actions {
  display: flex;
  flex-shrink: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  padding: 8px 16px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.7);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.5);
}

.btn-secondary:hover {
  background: rgba(15,23,42,0.9);
}

.btn-ghost {
  background: rgba(15,23,42,0.9);
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.4);
}
/* Tombol tool aktif di panel Elemen (Pensil, Garis, dll) */
.editor-sidebar-left .btn-ghost.is-active {
  background-color: #0f172a;      /* atau pakai warna utama kamu */
  color: #ffffff;
  border-color: #0f172a;
}

/* Kalau butuh full width sekaligus */
.editor-sidebar-left .btn-ghost.full.is-active {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}
.btn-ghost:hover {
  background: rgba(30, 64, 175, 0.85);
}

/* Filters bar */
.filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.filters-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.chip.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.filters-right {
  flex-shrink: 0;
}

.input-search {
  width: 240px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
}

.input-search::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

/* Template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.template-card {
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.template-thumb {
  position: relative;
  padding: 10px;
}

.thumb-image {
  border-radius: 14px;
  background: #020617;
  background-size: cover;
  background-position: center;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.template-thumb .btn-open {
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-size: 12px;
  padding-inline: 12px;
}

.template-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
}

.size {
  color: var(--text-muted);
}

.template-name {
  font-size: 13px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 960px) {
  .app-body {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .app-sidebar {
    position: unset;
    inset: 64px auto 0 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    z-index: 50;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }
}

/* Quota bar (sidebar usage) */
.quota-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  overflow: hidden;
  margin-top: 6px;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
}

/* Button kecil untuk topbar (logout) */
.btn-small {
  padding: 8px 8px;
  font-size: 12px;
}

/* ==== AUTH LAYOUT (LOGIN) ==== */

.auth-body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937, #020617);
  color: var(--text-main);
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 24px 22px 22px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-logo img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
}

.auth-brand-text {
  display: flex;
  flex-direction: column;
}

.auth-app-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.auth-app-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  margin: 10px 0 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.auth-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.7);
  color: #fecaca;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 10px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-field label {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-field input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
}

.auth-field input::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-footer-text {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
}

/* ==== EDITOR LAYOUT ==== */

.editor-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.editor-header {
display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 7px 7px 7px;
  box-shadow: var(--shadow-soft);
}

.editor-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crumb-back {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.9);
}

.crumb-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.crumb-title {
  display: flex;
  flex-direction: column;
}

.crumb-label {
  font-size: 11px;
  color: var(--text-muted);
}

.crumb-name {
  font-size: 14px;
  font-weight: 600;
}

.editor-actions {
  display: flex;
  gap: 8px;
}

/* Shell: kiri tools, tengah canvas, kanan properties */
.editor-shell {
  display: grid;
  grid-template-columns: 65px minmax(0, 1fr) 260px;
  gap: 14px;
  min-height: 420px;
  align-items: flex-start; /* penting: jangan di-center vertical */
}
/* Panel generik */
.panel {
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 10px 12px;
  box-shadow: var(--shadow-soft);
}

.panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.panel-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.panel-text.small {
  font-size: 11px;
}

/* Editor - sidebar kiri */
.editor-sidebar-left,
.editor-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Editor - canvas */
.editor-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-frame {
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top, #020617, #020617);
  box-shadow: var(--shadow-soft);
}

.canvas-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.canvas-inner {
  background: #dedede;
  padding: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: auto;
}

/* Grid garis tipis (hanya saat class has-grid aktif) */
.canvas-inner.has-grid {
  background-color: #e5e7eb;
  background-image:
    linear-gradient(to right, rgba(148,163,184,0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,0.35) 1px, transparent 1px);
  background-size: 40px 40px;
}
/* Pastikan container canvas bisa jadi anchor overlay */
#canvasInner {
  position: relative;
  display: inline-block; /* supaya ukuran ngikut canvas */
  overflow: hidden;
}

/* Canvas Fabric */
#canvasInner canvas {
  display: block;
}

/* Overlay grid (di atas canvas, tapi transparan & tidak bisa diklik) */
#canvasGridOverlay {
  position: absolute;
  inset: 0;               /* top:0; right:0; bottom:0; left:0 */
  pointer-events: none;   /* supaya tidak mengganggu drag & klik objek */
  z-index: 2;

  /* Garis grid tipis */
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.35) 1px, transparent 1px);
  background-size: 32px 32px;  /* jarak grid bisa diubah (16/24/32 px) */

  opacity: 0.6;           /* transparan */
  display: none;          /* default: tidak muncul, di-toggle dari JS */
}
/* Zoom control di header editor */
.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}
.zoom-control input[type="range"] {
  width: 110px;
}
#zoomLabel {
  font-size: 12px;
  color: var(--text-muted);
}

/* Tombol toggle kecil (bold/italic/align/layer) */
.btn-toggle {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-toggle.is-active {
  border-color: var(--accent);
  background: rgba(59,130,246,0.18);
  color: #e5e7eb;
}

/* Group tombol gaya font */
.font-style-buttons {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

/* Align buttons (L/T/R) dan group layer */
.align-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Select font */
#propFontFamily {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 8px;
}

/* Slider outline & curve & radius */
#propStrokeWidth,
#propCurveRadius,
#propCornerRadius {
  width: 100%;
}

/* Divider panel */
.panel-divider {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin: 10px 0;
}

/* Modal editor */
.editor-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.editor-modal-backdrop.show {
  display: flex;
}
.editor-modal {
  background: #020617;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.4);
  padding: 16px 18px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 18px 45px rgba(15,23,42,0.8);
}
.editor-modal-header h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.editor-modal-body {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.editor-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
/* Input di dalam modal editor */
.editor-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
}

.editor-input::placeholder {
  color: rgba(148,163,184,0.8);
}
/* Tombol danger khusus modal */
.btn-danger {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  border: none;
  background: #ef4444;
  color: #ffffff;
  cursor: pointer;
}
.btn-danger:hover {
  background: #dc2626;
}

/* Canvas element: dibatasi max-width agar fit di viewport */
#designCanvas {
  display: block;
  background: #ffffff;
  border-radius: 0px;
}

/* Panel properties */
.prop-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.prop-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.prop-value {
  font-weight: 500;
}

.prop-group {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#propTextContent {
  min-height: 70px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 8px;
}

#propFontSize,
#propFillColor {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 8px;
}

.btn-ghost.full,
.btn-primary.full,
.btn-secondary.full {
  width: 100%;
  justify-content: left;
  margin-bottom: 10px;
}

.btn-ghost.danger {
  border-color: rgba(239, 68, 68, 0.7);
  color: #fecaca;
}

.btn-ghost.danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive editor */
@media (max-width: 1024px) {
  .editor-shell {
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .editor-sidebar-right {
    grid-column: 1 / span 2;
  }
}

@media (max-width: 768px) {
  .editor-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .editor-sidebar-left,
  .editor-sidebar-right {
    order: 1;
  }

  .editor-canvas-wrap {
    order: 0;
  }

  .canvas-inner {
    max-width: 100%;
    overflow: auto;
  }

  #designCanvas {
    max-width: 100%;
    height: auto !important;
  }
}


  .menu-toggle {
    display: none;
  }

@media (max-width: 640px) {
  .app-topbar {
    padding-inline: 12px;
  }

  .brand-text .brand-sub {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .user-menu {
    display: none;
  }

  .page-header {
    flex-direction: column;
	width: 330px;
  }

  .editor-actions {
      display: initial;
  }

  .template-grid {
    flex-direction: column;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-right {
    width: 100%;
  }

  .input-search {
    width: 100%;
  }
}
/* Tombol toggle kecil (bold/italic/align) */
.btn-toggle {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-toggle.is-active {
  border-color: var(--accent);
  background: rgba(59,130,246,0.18);
  color: #e5e7eb;
}

/* Group tombol gaya font */
.font-style-buttons {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

/* Align buttons (L/T/R) */
.align-buttons {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

/* Select font */
#propFontFamily {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 8px;
}

/* Slider outline & curve */
#propStrokeWidth,
#propCurveRadius {
  width: 100%;
}
/* Tombol toggle kecil (bold/italic/align/layer) */
.btn-toggle {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-toggle.is-active {
  border-color: var(--accent);
  background: rgba(59,130,246,0.18);
  color: #e5e7eb;
}

/* Group tombol gaya font */
.font-style-buttons {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

/* Align buttons (L/T/R) dan group layer */
.align-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Select font */
#propFontFamily {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15,23,42,0.96);
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 8px;
}

/* Slider outline & curve & radius */
#propStrokeWidth,
#propCurveRadius,
#propCornerRadius {
  width: 100%;
}

/* Divider panel */
.panel-divider {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin: 10px 0;
}

/* Sidebar editor melayang dan ikut scroll layar (langsung di aside) */
.editor-main .editor-sidebar-left,
.editor-main .editor-sidebar-right {
  position: sticky;
  top: 80px;          /* kira-kira di bawah app-topbar 64px */
  align-self: flex-start;
  z-index: 30;
}

/* ========== Asset Library Modal ========== */
body.no-scroll {
  overflow: hidden;
}

/* wrapper modal */
.asset-modal {
  position: fixed;
  inset: 0;
  z-index: 1200; /* pastikan di atas header dan canvas */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* disembunyikan saat ada class .hidden */
.asset-modal.hidden {
  display: none !important;
}

/* backdrop gelap */
.asset-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

/* kotak dialog */
.asset-modal-dialog {
  position: relative;
  width: 90%;
  max-width: 960px;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* header modal */
.asset-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.asset-modal-header .title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.asset-modal-header .title .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.asset-modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.asset-modal-close:hover {
  background: #e5e7eb;
}

/* toolbar: filter + search */
.asset-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.asset-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-filter {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}
.asset-filter.active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.asset-search {
  margin-left: auto;
  min-width: 160px;
}
.asset-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  font-size: 12px;
}

/* body: grid asset */
.asset-modal-body {
  padding: 12px 16px 16px;
  flex: 1;
  overflow: auto;
  background: #f3f4f6;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.asset-card {
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
}
.asset-card:hover {
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.asset-thumb {
  position: relative;
  padding-top: 100%;
  background: #e5e7eb;
  overflow: hidden;
}
.asset-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;        /* ⟵ seluruh gambar masuk (kepala–kaki) */
  object-position: top center;/* ⟵ mulai dari atas, turun ke bawah   */
  background-color: #e5e7eb;  /* abu-abu di area kosong kanan/kiri    */
}

.asset-name {
  padding: 4px 6px 6px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* empty & load more */
.asset-empty {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

.asset-more {
  margin-top: 12px;
  text-align: center;
}
.asset-more button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.asset-more button:hover {
  background: #f3f4f6;
}

/* helper class umum kalau belum ada */
.hidden {
  display: none !important;
}
/* ========== /Asset Library Modal ========== */


/* ==== HANDLE RESIZE CANVAS ==== */
.canvas-inner {
  position: relative; /* penting supaya handle nempel ke canvas */
}

/* garis pegangan kanan & bawah */
.canvas-resize-handle {
  position: absolute;
  background: transparent;
  z-index: 20;
}

/* handle kanan (resize lebar) */
.canvas-resize-handle-right {
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
}

/* handle bawah (resize tinggi) */
.canvas-resize-handle-bottom {
  left: 0;
  bottom: -4px;
  height: 8px;
  width: 100%;
  cursor: ns-resize;
}

/* sudut kanan bawah (resize dua arah) – opsional */
.canvas-resize-handle-corner {
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  border-radius: 4px;
}



/* ==== Scrollbar lebih gelap (global) ==== */

/* Firefox */
* {
  scrollbar-width: thin;                    /* lebih ramping */
  scrollbar-color: #020617 #020617;        /* thumb | track */
}

/* Chrome, Edge, Safari (WebKit) */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #020617;                      /* track sangat gelap */
}

*::-webkit-scrollbar-thumb {
  background: #020617;                      /* abu gelap */
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #020617;                      /* sedikit lebih terang saat hover */
}




    /* ==== Canvas Pages Bar (Multi Halaman) ==== */
    .canvas-pages-bar {
      margin: 0px 0 10px;
      padding: 8px 12px;
      border-radius: 10px;
      border: 1px solid rgba(148, 163, 184, 0.35);
      background: rgba(15, 23, 42, 0.02);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .canvas-pages-left {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .canvas-pages-label {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 600;
      color: #6b7280;
    }

    .canvas-pages-list {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .canvas-page-pill {
      border-radius: 999px;
      border: 1px solid var(--line, #1e4136);
      background: #1e4136;
      padding: 4px 10px;
      font-size: 12px;
      line-height: 1.2;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: #f9fafb;
      transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    }

    .canvas-page-pill.is-active {
      background: #fff;
      color: #111827;
    }

    .canvas-page-pill-add {
      background: transparent;
      border-style: dashed;
      color: var(--accent);
    }

    .canvas-page-pill-add span {
      font-size: 14px;
      font-weight: 700;
    }

    .canvas-pages-right {
      font-size: 11px;
      color: #9ca3af;
      text-align: right;
      max-width: 260px;
    }
	
    /* Tombol hapus halaman melayang di pojok kanan atas canvas */
    .canvas-frame {
      position: relative; /* supaya tombol melayang relatif ke frame */
    }

    .canvas-page-delete-floating {
      border-radius: 999px;
      border: 1px solid #dc2626;
      background: #fee2e2;
      padding: 3px 5px;
      font-size: 10px;
      line-height: 1.2;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: #b91c1c;
      transition:
        background 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;
      box-shadow: 0 4px 10px rgba(220, 38, 38, 0.12);
    }

    .canvas-page-delete-floating:hover {
      background: #fecaca;
    }

    .canvas-page-delete-floating span {
      font-weight: 700;
      font-size: 14px;
    }

    @media (max-width: 900px) {
      .canvas-page-delete-floating {
        top: 6px;
        right: 6px;
        padding: 4px 8px;
      }
	  
  .app-body{
	  grid-template-columns: 0 minmax(0, 1fr) !important;
  }
  
    }

    @media (max-width: 900px) {
      .canvas-pages-bar {
        flex-direction: column;
        align-items: flex-start;
      }
      .canvas-pages-right {
        text-align: left;
        max-width: 100%;
      }
    }
	
	
    /* ==== Shape Palette (Elemen Shape) ==== */
    .shape-palette {
      border-radius: 8px;
      border: 1px dashed rgba(148, 163, 184, 0.6);
      padding: 6px;
      background: #f9fafb;
      margin-top: 6px;
    }
    .shape-palette-label {
      font-size: 11px;
      font-weight: 600;
      color: #4b5563;
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .shape-palette-grid {
      display: inherit;
      flex-wrap: wrap;
      gap: 4px;
	  padding: 10px;
    }
    .shape-btn {
      flex: 0 0 calc(50% - 4px);
      font-size: 10px;
      padding: 10px 10px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.7);
      background: #ffffff;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
	  margin: 2px;
    }
    .shape-btn:hover {
      background: #e5f0ff;
    }
	
	
	  /* ==== Device Lock (layar kecil / HP) ==== */
  #deviceScreenLock {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 1);
    display: none;               /* default: tidak tampil */
  }

  #deviceScreenLock.is-active {
    display: block;              /* dimunculkan via JS */
  }

  /* Card putih di tengah layar */
  #deviceScreenLock .device-lock-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-59%, -100%);

    background: #ffffff;
    border-radius: 16px;
    padding: 20px 18px 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);

    max-width: 960px;
  max-height: 80vh;
    width: calc(95% - 45px);    /* ada jarak di kiri-kanan HP */
    box-sizing: border-box;
    text-align: left;
  }

  .device-lock-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #0f172a;
  }

  .device-lock-text {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 8px;
  }

  .device-lock-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
  }
  
/* === Editor: Sidebar kanan - layout modern & compact === */

.editor-sidebar-right .panel {
  padding: 8px 10px 14px;
}

/* Kartu per bagian (prop-section) */
.editor-sidebar-right .prop-section {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.88)
  );
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.editor-sidebar-right .prop-section.compact {
  padding: 6px 10px;
}

/* Judul tiap section (Teks & Font, Warna & Gradient, dll) */
.editor-sidebar-right .prop-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.editor-sidebar-right .prop-section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #6366f1, #22c55e);
}

/* Baris label + value (misal: Jenis = Teks) */
.editor-sidebar-right .prop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.editor-sidebar-right .prop-row .prop-label {
  font-size: 12px;
  color: var(--text-muted);
}

.editor-sidebar-right .prop-row .prop-value {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.6);
  max-width: 55%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Input & select di sidebar kanan (biar seragam & rapi) */
.editor-sidebar-right .prop-group textarea,
.editor-sidebar-right .prop-group select,
.editor-sidebar-right .prop-group input[type="number"],
.editor-sidebar-right .prop-group input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-main);
  font-size: 12px;
  padding: 5px 8px;
}

/* Input warna (color picker) */
.editor-sidebar-right .prop-group input[type="color"] {
  width: 48px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: transparent;
}

/* Row slider: range + angka di kanan (sebaris) */
.editor-sidebar-right .slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-sidebar-right .slider-row input[type="range"] {
  flex: 1;
}

/* Baris ukuran canvas: lebar × tinggi + tombol */
.editor-sidebar-right .canvas-size-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* dua input canvasWidthInput & canvasHeightInput akan fleksibel (lebih lebar) */
.editor-sidebar-right .canvas-size-input {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-main);
  font-size: 12px;
  padding: 4px 6px;
}

/* Tombol toggle (mode warna, align, group, layer, dll) */
.editor-sidebar-right .align-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.editor-sidebar-right .btn-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 11px;
  padding: 3px 10px;
  line-height: 1.4;
  cursor: pointer;
  min-height: 24px;
  white-space: nowrap;
}

/* JELASIN yang aktif: btn-toggle.is-active */
.editor-sidebar-right .btn-toggle.is-active {
  border-color: #6366f1;
  background: radial-gradient(
    circle at top,
    rgba(99, 102, 241, 0.95),
    rgba(56, 189, 248, 0.85)
  );
  color: #0b1120;
  font-weight: 600;
}

/* Untuk section kecil seperti Status & Hapus Objek */
.editor-sidebar-right .prop-section.compact .panel-text {
  margin-bottom: 4px;
}

/* Checkbox lebih rapih */
.editor-sidebar-right .prop-group input[type="checkbox"] {
  margin-right: 6px;
}

/* Textarea konten teks */
.editor-sidebar-right #propTextContent {
  min-height: 64px;
  resize: vertical;
}
/* judul section bisa diklik untuk collapse/expand */
.editor-sidebar-right .prop-section-title {
  cursor: pointer;
}

/* icon panah di kanan judul */
.editor-sidebar-right .prop-section-title::after {
  content: "▾";
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

/* wrapper isi section (akan kita buat dari JS) */
.editor-sidebar-right .prop-section-body {
  margin-top: 4px;
}

/* kalau section dikasih class .collapsed → isi disembunyikan */
.editor-sidebar-right .prop-section.collapsed .prop-section-body {
  display: none;
}

/* dan icon panah diputar */
.editor-sidebar-right .prop-section.collapsed .prop-section-title::after {
  transform: rotate(-90deg);
}

/* === RULER (PENGGARIS) DI SEKITAR CANVAS === */

.canvas-ruler-shell {
  display: inline-block;
  margin-top: 6px;
}

.canvas-ruler-row,
.canvas-ruler-main {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: stretch;
}

.canvas-ruler-main {
  margin-top: 0;
}

.canvas-ruler-corner {
  background: radial-gradient(circle at top left, #020617, #020617);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  border-right: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ruler-origin {
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 10px;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.btn-ruler-origin:hover {
  background: rgba(59, 130, 246, 0.95);
  border-color: rgba(59, 130, 246, 1);
  color: #0b1120;
}

.ruler-horizontal,
.ruler-vertical {
  position: relative;
  background: #020617;
  color: #9ca3af;
  font-size: 10px;
  user-select: none;
  overflow: hidden;
}

.ruler-horizontal {
  height: 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.ruler-vertical {
  width: 32px;
  border-right: 1px solid rgba(148, 163, 184, 0.35);
}

/* Tick kecil & besar */
.ruler-tick {
  position: absolute;
  background: rgba(148, 163, 184, 0.5);
  pointer-events: none;
}

.ruler-tick-h {
  /* tick vertikal di ruler atas */
  width: 1px;
  bottom: 0;
  height: 6px;
}

.ruler-tick-h.ruler-tick-major {
  height: 10px;
}

.ruler-tick-v {
  /* tick horizontal di ruler kiri */
  height: 1px;
  right: 0;
  width: 6px;
}

.ruler-tick-v.ruler-tick-major {
  width: 10px;
}

.ruler-label {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  color: #9ca3af;
  pointer-events: none;
  white-space: nowrap;
}

.ruler-label-h {
  top: 2px;
}

.ruler-label-v {
  left: 4px;
}

/* Pastikan canvasInner jadi kontainer posisi */
#canvasInner {
  position: relative;
}

/* Overlay grid & crosshair tidak mengganggu klik */
#canvasGridOverlay {
  position: absolute;
  inset: 0;              /* top:0; right:0; bottom:0; left:0 */
  pointer-events: none;
  z-index: 2;            /* di atas canvas */
}

/* Crosshair */
#crosshairVertical,
#crosshairHorizontal {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  display: none;
}

#crosshairVertical {
  width: 1px;
  top: 0;
  bottom: 0;
  background: rgba(96, 165, 250, 0.95);
}

#crosshairHorizontal {
  height: 1px;
  left: 0;
  right: 0;
  background: rgba(96, 165, 250, 0.95);
}

/* Indikator origin ruler (titik 0,0) */
#rulerOriginMarker {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.95);
  background: radial-gradient(circle, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
  pointer-events: none;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: none;
}

/* tanda + di tengah lingkaran origin */
#rulerOriginMarker::before,
#rulerOriginMarker::after {
  content: "";
  position: absolute;
  background: rgba(96, 165, 250, 0.98);
  border-radius: 999px;
}

#rulerOriginMarker::before {
  width: 1px;
  height: 8px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#rulerOriginMarker::after {
  width: 8px;
  height: 1px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Tooltip besar untuk tombol sidebar editor */
[data-tooltip] {
  position: relative;
}

/* Bubble tooltip */
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(8px, -50%);
  opacity: 0;
  pointer-events: none;
  white-space: normal;

  width: 260px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;

  background: rgba(15, 23, 42, 0.96);   /* gelap elegan */
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
  z-index: 999;

  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Segitiga kecil di samping bubble */
[data-tooltip]::before {
  content: "";
  position: absolute;
  left: calc(100% - 2px);
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(15, 23, 42, 0.96);
  opacity: 0;
  z-index: 1000;
  transition: opacity 0.15s ease;
}

/* Saat di-hover, tooltip muncul */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
}

/* Sedikit geser saat muncul supaya terasa halus */
[data-tooltip]:hover::after {
  transform: translate(12px, -50%);
}

/* Sidebar compact: scroll VERTIKAL, horizontal disembunyikan */
.editor-sidebar-inner.tools-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 4px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;     /* scroll ke bawah */
  overflow-x: hidden;   /* kalau ada overflow horizontal, jangan muncul scroll */
  box-sizing: border-box;
  border-right: 1px solid rgba(148, 163, 184, 0.4);
}

/* Sidebar kiri jangan ng-clip keluaran lain */
.editor-sidebar-left {
  width: 100%;
  overflow: visible;
}

.tool-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  width: 100%;
  max-width: 45px;   /* aman di kolom 80px */
  min-width: 0;      /* ⬅️ PENTING: override min-width dari .btn-ghost.full */

  padding: 6px 0;
  margin: 0 auto;

  border-radius: 10px;
  text-align: center;
  cursor: pointer;

  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
}

.tool-icon-btn .tool-icon {
  font-size: 15px;
  line-height: 1;
}

.tool-icon-btn .tool-label {
  display: block;
  font-size: 8px;
}

/* State aktif (kalau JS-mu pakai .is-active tinggal ikut) */
.tool-icon-btn.is-active {
  background: rgba(59, 130, 246, 0.1); /* biru muda */
  border-color: rgba(59, 130, 246, 0.6);
}

/* Matikan tooltip lama (pseudo-element) hanya di dalam editor */
.editor-shell [data-tooltip]::before,
.editor-shell [data-tooltip]::after {
  display: none !important;
  content: none !important;
}

/* Tooltip global editor */
#editorTooltip {
  position: fixed;
  max-width: 260px;
  z-index: 9999;
  pointer-events: none;

  background: #0f172a;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.3;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);

  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#editorTooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* Baris tools di bawah header */
.editor-tools-row {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3f4f6; /* abu terang */
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Tombol icon tools */
.editor-tools-row .tool-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  min-width: 56px;
  padding: 6px 4px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;

  background: transparent;
}

/* Icon besar di atas */
.editor-tools-row .tool-icon-btn .tool-icon {
  font-size: 20px;
  line-height: 1;
}

/* Label di bawah icon */
.editor-tools-row .tool-icon-btn .tool-label {
  font-size: 10px;
}

/* State aktif (kalau JS kasih .is-active) */
.editor-tools-row .tool-icon-btn.is-active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.7);
}

/* Tooltip ke BAWAH */
.editor-tools-row .tool-icon-btn {
  position: relative;
}

.editor-tools-row .tool-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: 100%;         /* di bawah tombol */
  transform: translate(-50%, 8px);
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
  z-index: 999;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.editor-tools-row .tool-icon-btn:hover::after {
  opacity: 1;
  transform: translate(-50%, 4px);
}

/* === Publish Modal: layout & form === */

/* Biar modal publish ukurannya pas */
#modalPublishDesign .editor-modal {
  max-width: 720px;
  width: 100%;
}

/* Header modal */
#modalPublishDesign .editor-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#modalPublishDesign .editor-modal-title {
  font-size: 1rem;
  font-weight: 600;
}

/* Body & footer */
#modalPublishDesign .editor-modal-body {
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

#modalPublishDesign .editor-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Grup form */
#modalPublishDesign .form-group {
  margin-bottom: 12px;
}

#modalPublishDesign .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #FFF;
}

/* Input/select textarea ala editor-input */
#modalPublishDesign .form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.875rem;
  background-color: #ffffff;
}

#modalPublishDesign .form-control:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}

/* Radio inline */
#modalPublishDesign .form-inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

#modalPublishDesign .radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Help text & estimasi */
#modalPublishDesign .form-text.text-muted {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #6b7280;
}

#modalPublishDesign .text-strong {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Alert info */
#modalPublishDesign .alert {
  border-radius: 8px;
  padding: 10px 12px;
}

#modalPublishDesign .alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.publish-pricing-group {
  display: none;
}
  /* ==== Kolaborasi Desain ==== */
  .collab-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #9ca3af;
  }

  .collab-plan {
    font-weight: 600;
    color: #e5e7eb;
  }

  .collab-limit {
    font-size: 12px;
  }

  .collab-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .collab-alert {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 4px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(248,113,113,0.8);
    color: #fecaca;
  }

  .collab-alert.success {
    background: rgba(22,163,74,0.12);
    border-color: rgba(34,197,94,0.8);
    color: #bbf7d0;
  }

  .collab-list-wrapper {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(148,163,184,0.35);
  }

  .collab-subtitle {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  .collab-empty {
    font-size: 12px;
    color: #9ca3af;
  }
  
  /* === Kolaborasi Desain: Layout Modal & List === */

.collab-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 12px;
  font-size: 12px;
}

.collab-plan {
  color: #e5e7eb;
  font-weight: 500;
}

.collab-limit {
  color: #9ca3af;
}

.collab-list-wrapper {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

.collab-subtitle {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #e5e7eb;
}

.collab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.collab-empty {
  font-size: 12px;
  color: #9ca3af;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.75);
  text-align: center;
}

/* Item kolaborator */

.collab-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.collab-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.collab-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.collab-email {
  font-size: 11px;
  color: #9ca3af;
  word-break: break-all;
}

.collab-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 2px;
}

.collab-role {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
}

.collab-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.collab-badge-default {
  background: #4b5563;
  color: #f9fafb;
  border: 1px solid #6b7280;
}

.collab-badge-pending {
  background: #f59e0b;
  color: #111827;
  border: 1px solid #fbbf24;
}

.collab-badge-accepted {
  background: #16a34a;
  color: #f9fafb;
  border: 1px solid #22c55e;
}

.collab-badge-removed {
  background: #dc2626;
  color: #f9fafb;
  border: 1px solid #fca5a5;
}

.collab-date {
  color: #9ca3af;
}

/* Pesan undangan */

.collab-item-message {
  margin-top: 4px;
  font-size: 12px;
  color: #d1d5db;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
}

/* Tombol aksi kecil (hapus / cabut akses) */

.collab-item-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

.btn-xsmall {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.8);
  background: rgba(127, 29, 29, 0.9);
  color: #fee2e2;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-xsmall:hover {
  background: rgba(185, 28, 28, 1);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3);
}

.btn-xsmall:active {
  transform: scale(0.97);
}

        /* FLOATING WHATSAPP BUTTON */
        .contactwa {
            position: fixed;
            bottom: 16px;
            right: 16px;
            cursor: pointer;
            z-index: 1001;
        }

        .contactwa .inner {
            background: #0434a7;
            color: #e5e7eb;
            border-radius: 999px;
            padding: 8px 14px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
            font-size: 0.86rem;
            font-weight: 500;
        }

        .contactwa .iconwa {
            width: 30px;
            height: 30px;
            border-radius: 999px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(248, 250, 252, 0.1);
        }

        .contactwa .iconwa i {
            font-size: 1.1rem;
            color: #22c55e;
        }

        /* WHATSAPP MODAL */
        .formWaBox {
            position: fixed;
            inset: 0;
            z-index: 1050;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(15, 23, 42, 0.65);
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease, visibility 0.2s ease;
        }

        .formWaBox.open {
            opacity: 1;
            visibility: visible;
        }

        .formWa {
            background: #ffffff;
            border-radius: 18px;
            width: calc(100% - 32px);
            max-width: 480px;
            position: relative;
            padding-top: 56px;
            box-shadow: 0 18px 45px rgba(15, 23, 42, 0.6);
        }

        .formWaBody {
            max-height: 80vh;
            overflow-y: auto;
        }

        .formWaBody .heading {
            position: absolute;
            inset: 0 0 auto 0;
            height: 56px;
            padding: 10px 18px;
            display: flex;
            align-items: center;
            gap: 10px;
            border-radius: 18px 18px 0 0;
            background: #00257b;
            color: #e5e7eb;
        }

        .formWaBody .heading i.fa-whatsapp {
            font-size: 1.6rem;
            color: #22c55e;
        }

        .formWaBody .heading h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 500;
        }

        .formWaBody .heading .close {
            margin-left: auto;
            cursor: pointer;
            font-size: 1.5rem;
            line-height: 1;
            color: #9ca3af;
        }

        .formWaBody .heading .close:hover {
            color: #f97316;
        }

        .formWaBody .form {
            padding: 20px 20px 20px;
            font-size: 0.9rem;
        }

        .formWaBody .input {
            position: relative;
            margin-bottom: 14px;
        }

        .formWaBody .input i.fa-user {
            position: absolute;
            top: 10px;
            left: 10px;
            color: #9ca3af;
        }

        .formWaBody .input input[type="text"],
        .formWaBody .input textarea {
            width: 100%;
            border-radius: 10px;
            border: 1px solid #e5e7eb;
            padding: 9px 12px 9px 32px;
            font-size: 0.9rem;
            outline: none;
        }

        .formWaBody .input textarea {
            min-height: 90px;
            padding-left: 12px;
        }

        .formWaBody .input input:focus,
        .formWaBody .input textarea:focus {
            border-color: var(--vibri-primary);
            box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
        }

        .formWaBody button[type="submit"] {
            width: 100%;
            border-radius: 999px;
            border: none;
            padding: 10px 16px;
            background: #0f172a;
            color: #e5e7eb;
            font-weight: 600;
            font-size: 0.92rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .formWaBody button[type="submit"] i {
            font-size: 1rem;
        }

        .formWaBody button[type="submit"]:hover {
            background: #1f2937;
        }
.btn-ghost.is-loading {
  position: relative;
  opacity: 0.7;
  cursor: wait;
}

.btn-ghost.is-loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.7);
  border-top-color: transparent;
  transform: translateY(-50%);
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}