/* ===== Peta Minda — tema terang ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #d9dce3;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --shadow: 0 4px 16px rgba(15, 23, 42, .14);
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ===== Toolbar ===== */
#toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  min-height: 46px;
  z-index: 30;
}

.tb-group { display: flex; align-items: center; gap: 4px; }
.tb-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.tb-spacer { flex: 1; }

#doc-name {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.tb-btn:hover { background: #eef1f6; }
.tb-btn:active { background: #e2e7ef; }
.tb-btn:disabled { opacity: .4; cursor: default; background: transparent; }
.tb-btn.icon-only { font-size: 16px; font-weight: 700; min-width: 34px; justify-content: center; padding: 6px 8px; }
.tb-btn.danger:hover { background: #fee2e2; color: var(--danger); }
.tb-btn.small { font-size: 12px; padding: 4px 10px; border-color: var(--border); }

.tb-segment { background: #eef1f6; border-radius: 9px; padding: 3px; }
.tb-segment .seg { border-radius: 7px; padding: 5px 12px; }
.tb-segment .seg.active { background: var(--panel); box-shadow: 0 1px 3px rgba(15, 23, 42, .18); font-weight: 600; }

#zoom-label {
  font-size: 12.5px;
  color: var(--muted);
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#tb-layout .tb-label { font-size: 12.5px; color: var(--muted); }
#layout-select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
#layout-select:hover { border-color: #b6bdc9; }
#layout-select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ===== Area utama ===== */
#main { flex: 1; position: relative; overflow: hidden; }

#canvas-wrap { position: absolute; inset: 0; user-select: none; }
#mm-canvas { width: 100%; height: 100%; display: block; cursor: default; touch-action: none; }
#mm-canvas.panning { cursor: grabbing; }
#mm-canvas.dragging { cursor: grabbing; }

g.mm-node { cursor: grab; }
g.mm-node .hit { fill: transparent; }
g.mm-node.selected .sel-ring { display: block; }
g.mm-node .sel-ring { display: none; fill: none; stroke: var(--accent); stroke-width: 1.6; }

@keyframes dropPulseRing {
  0%, 100% { stroke-width: 2.2px; filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.5)); }
  50% { stroke-width: 3.5px; filter: drop-shadow(0 0 9px rgba(37, 99, 235, 0.85)); }
}
g.mm-node.drop-target rect.box {
  stroke: var(--accent) !important;
  animation: dropPulseRing 0.8s ease-in-out infinite;
}
g.mm-node.drag-source { opacity: .35; }
g.mm-node.collapsed-branch > text.mm-label { opacity: .75; }

@keyframes mmBoxSpawn {
  0% { transform: scale(0.82); opacity: 0.4; }
  65% { transform: scale(1.06); opacity: 0.95; }
  100% { transform: scale(1); opacity: 1; }
}
g.mm-node.newly-spawned rect.box {
  transform-box: fill-box;
  transform-origin: center;
  animation: mmBoxSpawn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mm-collapse-btn {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.mm-collapse-btn:hover {
  transform: scale(1.28);
}
.mm-collapse-btn circle {
  fill: #fff;
  stroke: #9aa1ad;
  stroke-width: 1.2;
  transition: fill 0.15s ease, stroke 0.15s ease;
}
.mm-collapse-btn:hover circle {
  fill: var(--accent);
  stroke: var(--accent);
}
.mm-collapse-btn:hover text {
  fill: #fff;
}
.mm-collapse-btn text {
  font-size: 10px;
  fill: #4b5563;
  pointer-events: none;
  transition: fill 0.15s ease;
}

/* Edit overlay node */
#edit-input {
  position: fixed;
  z-index: 60;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  padding: 3px 8px;
  font-family: inherit;
  text-align: center;
  outline: none;
  box-shadow: var(--shadow);
}

/* Ghost yang mengikuti kursor saat drag node di peta */
.mm-ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  background: #fff;
  border: 1.5px dashed var(--accent);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13.5px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  box-shadow: var(--shadow);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Menu konteks ===== */
#ctx-menu {
  position: fixed;
  z-index: 100;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 5px;
  min-width: 210px;
  font-size: 13px;
}
#ctx-menu .ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}
#ctx-menu .ctx-item:hover { background: var(--accent-soft); }
#ctx-menu .ctx-item.danger { color: var(--danger); }
#ctx-menu .ctx-item.danger:hover { background: #fee2e2; }
#ctx-menu .ctx-item .kbd { margin-left: auto; font-size: 11px; color: var(--muted); }
#ctx-menu .ctx-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* ===== Picker ikon ===== */
#icon-picker {
  position: fixed;
  z-index: 100;
  width: 316px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
}
#icon-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
#icon-tabs button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 11.5px;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--muted);
}
#icon-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
#icon-grid button {
  font-size: 19px;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 4px 0;
  cursor: pointer;
}
#icon-grid button:hover { background: var(--accent-soft); }
#icon-footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

/* ===== Panel gaya node ===== */
#style-panel {
  position: fixed;
  z-index: 100;
  width: 300px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.sp-title { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.sp-row { margin-bottom: 10px; }
.sp-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.sp-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.sp-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .18);
  cursor: pointer;
  padding: 0;
}
.sp-swatch:hover { transform: scale(1.15); }
.sp-swatch.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-pick { display: flex; align-items: center; gap: 6px; }
.sp-pick input[type="color"] {
  width: 40px; height: 28px;
  padding: 1px 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.sp-size { display: flex; align-items: center; gap: 6px; }
#sp-size-val {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sp-footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }

/* ===== Outline ===== */
#outline-panel {
  position: absolute;
  inset: 0;
  background: var(--panel);
  overflow: auto;
  padding: 18px 24px 60px;
  outline: none;
}

.ol-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 0;
  border-radius: 7px;
  min-height: 32px;
  width: fit-content;
  min-width: min(720px, 100%);
}
.ol-row:hover { background: #f1f4f9; }
.ol-row.sel { background: var(--accent-soft); outline: 1px solid #bfdbfe; }
.ol-row.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.ol-row.dragging { opacity: .4; }

.ol-caret {
  width: 20px; height: 20px;
  border: none; background: none; cursor: pointer;
  font-size: 11px; color: var(--muted);
  border-radius: 5px;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.ol-caret:hover { background: #e2e8f2; color: var(--text); }
.ol-caret.empty { visibility: hidden; }

.ol-icon { font-size: 16px; flex: none; }
.ol-img { height: 22px; max-width: 44px; object-fit: contain; border-radius: 3px; flex: none; }

.ol-text {
  font-size: 14.5px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: text;
  min-width: 24px;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.ol-row.root-row .ol-text { font-size: 17px; font-weight: 700; }
.ol-text.editing { background: #fff; box-shadow: 0 0 0 2px var(--accent); cursor: text; }

.ol-actions { display: none; gap: 2px; margin-left: 6px; }
.ol-row:hover .ol-actions { display: inline-flex; }
.ol-actions button {
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--muted);
  border-radius: 5px; padding: 3px 6px;
}
.ol-actions button:hover { background: #e2e8f2; color: var(--text); }
.ol-actions button.danger:hover { color: var(--danger); background: #fee2e2; }

.ol-input {
  font: inherit;
  font-size: 14.5px;
  padding: 2px 8px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  outline: none;
  min-width: 160px;
}

/* ===== Drop hint saat drag di peta ===== */
#drop-hint {
  position: fixed;
  z-index: 90;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: var(--shadow);
  transform: translate(-50%, -160%);
}

/* Scrollbar halus */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3c9d4; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a8b0be; }

/* ===== Sistem layar (auth / dashboard / editor) ===== */
.screen { display: flex; flex-direction: column; height: 100%; }
.muted { color: var(--muted); font-size: 12.5px; }

/* --- Layar masuk --- */
#screen-auth {
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2ff 0%, #f4f5f7 55%, #ecfeff 100%);
}
.auth-card {
  width: min(400px, calc(100vw - 40px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 34px 26px;
  text-align: center;
}
.auth-logo { line-height: 1; display: flex; justify-content: center; margin-bottom: 6px; }
.auth-icon-img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25); }
.auth-card h1 { font-size: 22px; margin: 8px 0 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-note { color: var(--muted); font-size: 12px; margin-top: 18px; }

.field-label {
  display: block;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 0 5px;
}
.field-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  outline: none;
  transition: border-color .12s;
}
.field-input:focus { border-color: var(--accent); }
#auth-otp { text-align: center; letter-spacing: 6px; font-size: 18px; }

.btn-primary {
  width: 100%;
  margin-top: 16px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background .12s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: .5; cursor: default; }

.btn-link {
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  cursor: pointer;
  width: 100%;
}
.btn-link:hover { color: var(--text); text-decoration: underline; }

.form-error {
  background: #fee2e2;
  color: #991b1b;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 10px;
  text-align: left;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.auth-links .btn-link { width: auto; }
.otp-demo {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 12px;
}
.otp-demo b { font-size: 15px; letter-spacing: 3px; }

/* --- Dashboard --- */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.dash-brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand-icon { width: 24px; height: 24px; border-radius: 6px; display: inline-block; vertical-align: middle; }
.dash-user { display: flex; align-items: center; gap: 10px; }
.dash-user #dash-user-name { font-weight: 600; font-size: 13.5px; }

.dash-main { flex: 1; overflow-y: auto; padding: 22px; }
.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto 18px;
}
.quota-wrap { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 420px; }
.quota-bar {
  flex: 1;
  height: 8px;
  background: #e5e9f0;
  border-radius: 999px;
  overflow: hidden;
}
#quota-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .25s; }
#quota-fill.full { background: var(--danger); }
.dash-toolbar .btn-primary { width: auto; margin-top: 0; white-space: nowrap; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}
.map-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .12s, border-color .12s;
}
.map-card:hover { box-shadow: var(--shadow); border-color: #b9c2d0; }
.map-card-info {
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.map-card-name {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-card-meta { font-size: 12.5px; }
.map-card-actions { display: flex; gap: 6px; }
.map-act {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  padding: 5px 9px;
  cursor: pointer;
  color: var(--muted);
}
.map-act:hover { background: #eef1f6; color: var(--text); }
.map-act.danger:hover { background: #fee2e2; color: var(--danger); }

.dash-empty {
  text-align: center;
  color: var(--muted);
  margin-top: 9vh;
  font-size: 15px;
}
.dash-empty-icon { font-size: 52px; margin-bottom: 10px; }

/* --- Toast --- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 120;
  background: #1f2430;
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* ===== Media pada node ===== */
g.mm-node image.mm-img { cursor: zoom-in; }
g.mm-node .mm-video-badge { cursor: pointer; }
g.mm-node .mm-video-badge:hover rect:first-child { fill: #1e3a8a; }

.ol-video {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: #0f172a;
  border: none;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  flex: none;
}
.ol-video:hover { background: #1e3a8a; }

/* ===== Lightbox (gambar / video layar penuh) ===== */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 25, 0.87);
  cursor: zoom-out;
}
#lb-body { position: relative; max-width: 94vw; max-height: 90vh; }
#lb-body img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  transform-origin: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
#lb-body img.dragging { cursor: grabbing; }

/* kontrol zoom gambar lightbox */
.lb-img-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, .8);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 5px 8px;
  z-index: 5;
}
.lb-z-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.lb-z-btn:hover { background: rgba(255, 255, 255, .3); }
.lb-zoom-val {
  color: #e2e8f0;
  font-size: 12.5px;
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.lb-video-wrap {
  width: min(92vw, 1200px);
  aspect-ratio: 16 / 9;
  max-height: 86vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lb-video-wrap iframe,
.lb-video-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  transition: background .12s;
}
#lb-close:hover { background: rgba(255, 255, 255, .3); }

/* ===== Layar admin ===== */
.admin-tools { display: flex; align-items: center; gap: 10px; }
.admin-search { width: 260px; padding: 8px 12px; font-size: 13.5px; }

.admin-table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  max-width: 1080px;
  margin: 0 auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 720px;
}
.admin-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 11px 16px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f6f8fb; }
.admin-table .cell-name { font-weight: 600; }
.admin-table .cell-actions { white-space: nowrap; text-align: right; }

.role-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
}
.role-badge.admin { background: #ede9fe; color: #6d28d9; }
.role-badge.user { background: #e0e7ff; color: #3730a3; }

.quota-chip.full { color: var(--danger); font-weight: 700; }

.admin-act {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  padding: 5px 9px;
  cursor: pointer;
  color: var(--muted);
  margin-left: 4px;
}
.admin-act:hover { background: #eef1f6; color: var(--text); }
.admin-act.danger:hover { background: #fee2e2; color: var(--danger); }
.admin-act:disabled { opacity: .35; cursor: default; }

/* modal admin & ganti password */
#admin-modal,
#pw-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10, 14, 25, .55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.am-card {
  width: min(420px, calc(100vw - 40px));
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px 26px 18px;
  text-align: left;
}
.am-card h3 { font-size: 17px; margin-bottom: 4px; }
.am-quota-row { display: flex; align-items: center; gap: 12px; }
.am-quota-row .field-input { width: 110px; }
.am-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.am-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.am-actions .btn-primary { width: auto; margin-top: 0; }

/* ===== Floating Action Toolbar (Kontekstual di atas node aktif) ===== */
@keyframes ftPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(5px) scale(0.93);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}
#floating-toolbar {
  position: fixed;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  padding: 3px;
  transform: translateX(-50%);
  pointer-events: auto;
  transition: opacity 0.14s ease, top 0.15s cubic-bezier(0.16, 1, 0.3, 1), left 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
#floating-toolbar:not(.hidden) {
  animation: ftPop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.ft-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.ft-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
.ft-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent !important;
  color: var(--muted) !important;
  transform: none !important;
}
.ft-btn.ft-danger:hover {
  background: #fee2e2;
  color: var(--danger);
  transform: translateY(-1px);
}

/* ===== Animasi Modal & Dialog ===== */
@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalCardIn {
  0% { opacity: 0; transform: scale(0.93) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-backdrop,
#export-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10, 14, 25, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop:not(.hidden),
#export-modal:not(.hidden),
#admin-modal:not(.hidden),
#pw-modal:not(.hidden),
#lightbox:not(.hidden) {
  animation: backdropFadeIn 0.18s ease;
}
.modal-backdrop:not(.hidden) .modal-card,
#export-modal:not(.hidden) .export-card,
#admin-modal:not(.hidden) .am-card,
#pw-modal:not(.hidden) .am-card,
#lightbox:not(.hidden) #lb-body {
  animation: modalCardIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Modal Ekspor ===== */
.export-card {
  width: min(640px, calc(100vw - 32px));
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
}
.export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.export-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 8px;
  line-height: 1;
}
.modal-close-btn:hover {
  background: #eef1f6;
  color: var(--text);
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.export-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .15s, background .15s;
}
.export-item:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}
.export-item-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.export-item-icon {
  font-size: 22px;
  line-height: 1;
  flex: none;
}
.export-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.export-item-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.export-item-options {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}
.export-opt-label {
  font-weight: 600;
  color: var(--text);
}
.export-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
}

/* ===== Pemilih Tema Global ===== */
#tb-theme .tb-label { font-size: 12.5px; color: var(--muted); }
#theme-select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
#theme-select:hover { border-color: #b6bdc9; }
#theme-select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ===== Indikator Catatan di Kanvas & Outline ===== */
.mm-note-badge { cursor: pointer; transition: transform .12s ease; }
.mm-note-badge:hover { transform: scale(1.2); }
.ol-notes-badge {
  border: none;
  background: #fef3c7;
  color: #b45309;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ol-notes-badge:hover { background: #fde68a; }

/* ===== Side Drawer Catatan Panjang ===== */
@keyframes drawerFadeIn {
  from {
    opacity: 0;
    box-shadow: none;
  }
  to {
    opacity: 1;
    box-shadow: -6px 0 28px rgba(15, 23, 42, 0.15);
  }
}
.notes-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 28px rgba(15, 23, 42, 0.15);
  z-index: 85;
  display: flex;
  flex-direction: column;
}
.notes-drawer:not(.hidden) {
  animation: drawerFadeIn 0.18s ease;
}
.nd-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nd-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.nd-icon { font-size: 18px; line-height: 1; flex: none; }
#nd-node-title {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.nd-toolbar {
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nd-tool-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: all .1s;
}
.nd-tool-btn:hover { background: #eef1f6; border-color: #94a3b8; }
.nd-hint { font-size: 11px; color: var(--muted); margin-left: auto; }
.nd-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#nd-textarea {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  resize: none;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#nd-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.nd-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

/* ===== Modal Galeri Template ===== */
.templates-card {
  width: min(860px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.templates-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.templates-header h2 { font-size: 19px; font-weight: 700; color: var(--text); }
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.tmpl-card {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all .16s ease;
  position: relative;
}
.tmpl-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.tmpl-icon { font-size: 32px; line-height: 1; margin-bottom: 12px; }
.tmpl-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.tmpl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-bottom: 16px; }
.tmpl-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #eef1f6;
}
.tmpl-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}
.tmpl-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}


