/* ==========================================================================
   MANTAP! — stylesheet
   Breakpoint: < 768 (HP), 768–991 (tablet), ≥ 992 (desktop)
   ========================================================================== */

:root {
  --font: 'Plus Jakarta Sans', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f5f4ff;
  --surface: #ffffff;
  --surface-2: #f4f2fd;
  --text: #17163a;
  --muted: #6c6a8e;
  --border: #ebe8f7;
  --primary: #5b3fe4;
  --primary-strong: #4a30c9;
  --primary-soft: rgba(91, 63, 228, 0.1);
  --on-primary: #ffffff;
  --accent: #ec4899;
  --grad: linear-gradient(135deg, #5b3fe4 0%, #8257f0 100%);
  --topbar-grad: linear-gradient(135deg, #4f35d8 0%, #6d4cf0 55%, #8b5cf6 100%);
  --success: #0b9a6e;
  --warning: #c98200;
  --danger: #e0345a;
  --danger-soft: rgba(224, 52, 90, 0.1);
  --bubble-me: var(--primary);
  --bubble-me-text: #fff;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 160, 0.04), 0 10px 30px rgba(80, 60, 200, 0.08);
  --shadow-lg: 0 24px 60px rgba(30, 20, 90, 0.35);
  --topbar-h: 62px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[data-theme='dark'] {
  --bg: #0f0d22;
  --surface: #19172f;
  --surface-2: #221f40;
  --text: #ece9ff;
  --muted: #a29ec8;
  --border: #2c2951;
  --primary: #8d77ff;
  --primary-strong: #a898ff;
  --primary-soft: rgba(141, 119, 255, 0.16);
  --on-primary: #0d0a26;
  --grad: linear-gradient(135deg, #7a60ff 0%, #a98bff 100%);
  --topbar-grad: linear-gradient(135deg, #2b1f78 0%, #4a34c2 60%, #6a4bdb 100%);
  --success: #2fd29d;
  --warning: #f0b23e;
  --danger: #ff6b8d;
  --danger-soft: rgba(255, 107, 141, 0.14);
  --bubble-me-text: #0d0a26;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.28);
}

[data-theme='soft-blue'] {
  --bg: #eaf2fb;
  --surface: #ffffff;
  --surface-2: #f2f7fd;
  --text: #1c2b3d;
  --muted: #5f7186;
  --border: #d2dfed;
  --primary: #1b8de6;
  --primary-strong: #0f72c0;
  --primary-soft: rgba(27, 141, 230, 0.12);
  --grad: linear-gradient(135deg, #1b8de6 0%, #42b4ff 100%);
  --topbar-grad: linear-gradient(135deg, #1479d1 0%, #1b8de6 55%, #44b0f5 100%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
body:not(.is-admin) .admin-only { display: none !important; }

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

/* ---------- tombol & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 0.9rem; background: var(--surface-2); color: var(--text);
  transition: background 0.15s, transform 0.05s, opacity 0.15s; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.82rem; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 9px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.on { color: var(--primary); background: var(--primary-soft); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.76rem; }
.extnotice { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; font-size: 0.84rem; }
.extnotice-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.extnotice-text span { color: var(--muted); }
@media (max-width: 639.98px) { .extnotice { flex-wrap: wrap; } .extnotice .btn { flex: 1 1 auto; justify-content: center; } }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; }
.dialog-text { color: var(--muted); margin-bottom: 4px; white-space: pre-line; }
@media (max-width: 767.98px) { .input, .select, .textarea { font-size: 16px; } } /* cegah zoom otomatis iOS */

.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 1;
}
.badge.soft { background: var(--primary-soft); color: var(--primary); }
.badge.ok { background: rgba(11, 154, 110, 0.14); color: var(--success); }
.badge.warn { background: rgba(201, 130, 0, 0.16); color: var(--warning); }
.badge.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.dot-badge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; font-size: 0.65rem; border: 2px solid var(--surface); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.panel-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* ---------- boot & login ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 500; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; text-align: center; }
.login-card img { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 14px; }
.login-card h1 { font-size: 1.7rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.login-card .tag { color: var(--muted); font-weight: 700; font-size: 0.85rem; margin: 2px 0 24px; }
.login-card form { text-align: left; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60; height: calc(var(--topbar-h) + var(--safe-t)); padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1280px; height: var(--topbar-h); margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 11px; }
.brand b { display: block; font-size: 1.1rem; font-weight: 800; color: var(--primary); line-height: 1.1; letter-spacing: -0.01em; }
.brand small { display: block; color: var(--muted); font-weight: 700; font-size: 0.7rem; }
.topbar .spacer { flex: 1; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 0.72rem; font-weight: 800; flex: none; }
.user-btn .uname { font-weight: 700; font-size: 0.85rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; padding: 6px; z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head b { display: block; color: var(--primary); }
.menu-head small { color: var(--muted); font-weight: 600; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-weight: 600; font-size: 0.9rem; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item .badge { margin-left: auto; }

/* ---------- shell ---------- */
.shell { max-width: 1280px; margin: 0 auto; padding: 18px 16px 40px; display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--topbar-h) + var(--safe-t) + 18px); max-height: calc(100dvh - var(--topbar-h) - 36px); overflow-y: auto; display: grid; gap: 14px; scrollbar-width: thin; }
.drawer-head { display: none; }
.drawer-backdrop { display: none; }

.tab-list { display: grid; gap: 2px; }
.tab-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 0.9rem; text-align: left; color: var(--text); }
.tab-item .icon { color: var(--muted); }
.tab-item:hover { background: var(--surface-2); }
.tab-item .count { margin-left: auto; font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.tab-item.active { background: var(--primary-soft); color: var(--primary); }
.tab-item.active .icon, .tab-item.active .count { color: var(--primary); }

.chips { display: none; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 0.84rem; color: var(--muted); }
.chip .count { font-size: 0.74rem; opacity: 0.8; }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.filter-btn { display: none; border: 1px solid var(--border); background: var(--surface); }
.login-submit { margin-top: 14px; }
.field.tight { margin-bottom: 10px; }
.h-check { grid-area: check; } .h-no { grid-area: no; } .h-main { grid-area: main; } .h-url { grid-area: url; } .h-actions { grid-area: actions; }
.input-row { display: flex; gap: 8px; }
.input-row .select { flex: 1; min-width: 0; }

/* ---------- toolbar ---------- */
.content { min-width: 0; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; }
.search .icon { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; min-height: 44px; border-radius: 12px; }
.toolbar .select { width: auto; min-height: 44px; border-radius: 12px; }

.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 2px 10px; color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.list-meta h2 { font-size: 1rem; font-weight: 800; color: var(--text); }

/* ---------- daftar link ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-head, .link-row {
  display: grid; align-items: center; column-gap: 12px;
  grid-template-columns: 40px 52px minmax(0, 1.3fr) minmax(0, 1fr) 140px;
  grid-template-areas: 'check no main url actions';
  padding: 0 14px;
}
.list-head { min-height: 44px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 6px 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-btn:hover, .sort-btn.on { color: var(--primary); }
.link-row { min-height: 60px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.link-row:last-child { border-bottom: 0; }
.link-row:hover { background: var(--surface-2); }
.link-row.is-selected { background: var(--primary-soft); }
.cell-check { grid-area: check; display: grid; place-items: center; }
.cell-no { grid-area: no; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.cell-main { grid-area: main; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell-url { grid-area: url; color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-url:hover { color: var(--primary); text-decoration: underline; }
.cell-actions { grid-area: actions; display: flex; align-items: center; gap: 2px; }
.link-title { font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-title:hover { color: var(--primary); }
.link-title.raw { color: var(--warning); font-style: italic; }
.chk { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.star-btn { border: 0; background: transparent; padding: 4px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; flex: none; transition: transform 0.15s, color 0.15s; }
.star-btn:hover { transform: scale(1.18); color: var(--warning); }
.star-btn.on { color: var(--warning); }
.star-btn.on .icon { fill: currentColor; }
.discuss-btn { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 40px; padding: 0 10px; gap: 5px; font-weight: 700; font-size: 0.8rem; }
.discuss-btn.has { color: var(--primary); background: var(--primary-soft); }

.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .icon { margin: 0 auto 12px; opacity: 0.5; }
.empty b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }
.skeleton { height: 58px; margin: 0; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, transparent, var(--surface-2), transparent); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.page-btn { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }
.page-btn:hover:not(:disabled) { background: var(--surface-2); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-gap { display: grid; place-items: center; width: 24px; color: var(--muted); }

.bulk-bar {
  position: sticky; bottom: 16px; z-index: 40; margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 14px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg);
}
.bulk-bar .bulk-count { font-weight: 800; margin-right: auto; padding-left: 4px; }
.bulk-bar .btn { min-height: 38px; }
.bulk-bar .btn-ghost { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.bulk-bar .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: var(--bg); }

/* ---------- bottom nav & fab ---------- */
.bottom-nav { display: none; }
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--primary); color: var(--on-primary); display: grid; place-items: center; box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 45%, transparent);
  transition: transform 0.15s;
}
.chat-fab:hover { transform: scale(1.07); }

/* ---------- chat ---------- */
.chat-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 80; width: 390px; height: min(580px, calc(100dvh - 110px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--primary); color: var(--on-primary); }
.chat-head .t { flex: 1; min-width: 0; }
.chat-head b { display: block; font-size: 0.95rem; line-height: 1.2; }
.chat-head small { opacity: 0.85; font-size: 0.72rem; font-weight: 600; }
.chat-head .icon-btn { color: inherit; }
.chat-head .icon-btn:hover { background: rgba(255, 255, 255, 0.16); color: inherit; }

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); overscroll-behavior: contain; }
.day-sep { align-self: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 2px 10px; border-radius: 99px; margin: 6px 0; }
.msg { display: flex; flex-direction: column; max-width: 84%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 0.72rem; font-weight: 800; color: var(--success); margin: 0 6px 2px; }
.bubble { padding: 8px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow-wrap: anywhere; font-size: 0.92rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.msg:not(.me) .bubble { border-bottom-left-radius: 4px; }
.msg.me .bubble { background: var(--bubble-me); color: var(--bubble-me-text); border-color: transparent; border-bottom-right-radius: 4px; }
.bubble.deleted { background: var(--danger-soft); border: 1px dashed var(--danger); color: var(--danger); font-style: italic; font-size: 0.84rem; }
.msg .meta { display: flex; align-items: center; gap: 6px; margin: 2px 6px 0; font-size: 0.68rem; color: var(--muted); }
.mention { font-weight: 800; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 0 3px; }
.msg.me .mention { color: inherit; background: rgba(255, 255, 255, 0.22); }
.mini-btn { border: 0; background: transparent; color: inherit; font-size: 0.68rem; font-weight: 700; padding: 0; opacity: 0.8; text-decoration: underline; }

.composer { position: relative; display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.composer .input { min-height: 44px; border-radius: 22px; padding: 8px 16px; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; flex: none; border: 0; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.composer .send:disabled { opacity: 0.45; }
.mention-menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 2px); max-height: 190px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; z-index: 5; }
.mention-opt { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 0.9rem; }
.mention-opt.active, .mention-opt:hover { background: var(--primary-soft); }
.mention-opt small { color: var(--muted); margin-left: auto; font-weight: 600; }

/* ---------- sheet / modal ---------- */
#overlayRoot { position: relative; z-index: 300; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 11, 26, 0.55); animation: fade 0.15s ease-out; }
.sheet-backdrop.closing { opacity: 0; transition: opacity 0.15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(500px, 100%); max-height: min(86dvh, 760px); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop 0.18s ease-out; overflow: hidden; }
.sheet-sm { width: min(420px, 100%); }
.sheet-lg { width: min(660px, 100%); }
.sheet-grip { display: none; width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 8px auto 0; flex: none; touch-action: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 10px 20px; flex: none; touch-action: none; }
.sheet-title { font-size: 1.05rem; font-weight: 800; }
.sheet-body { padding: 4px 20px 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); flex: none; }
.sheet-chat .sheet-body { padding: 0; display: flex; flex-direction: column; }
.sheet-chat .messages { height: min(52dvh, 440px); flex: none; }
.sheet-chat .composer { border-top: 1px solid var(--border); padding-bottom: calc(10px + var(--safe-b)); }
.sheet-sub { color: var(--muted); font-size: 0.82rem; font-weight: 600; padding: 0 20px 10px; overflow-wrap: anywhere; }

.row-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.row-card .grow { min-width: 0; flex: 1; }
.row-card .grow b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.row-card .sub { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.row-card .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-card.unread { border-color: var(--primary); background: var(--primary-soft); cursor: pointer; }
.row-card.clickable { cursor: pointer; }
.row-card.done { opacity: 0.65; }
.section-title { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.section-title:first-child { margin-top: 4px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.seg button { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, 0.4); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-weight: 600; font-size: 0.9rem; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.stack { display: grid; gap: 8px; }

/* ---------- toast & loading ---------- */
#toastRoot { position: fixed; z-index: 700; top: calc(12px + var(--safe-t)); right: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 0.88rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px); transition: opacity 0.2s, transform 0.2s; border-left: 4px solid var(--primary); }
.toast.in { opacity: 1; transform: none; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-msg { flex: 1; overflow-wrap: anywhere; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.16); color: inherit; border-radius: 8px; padding: 6px 10px; font-weight: 800; font-size: 0.8rem; }
#loadingOverlay { position: fixed; inset: 0; z-index: 800; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: rgba(8, 11, 26, 0.55); color: #fff; font-weight: 700; }
#loadingOverlay .spinner { border-color: rgba(255, 255, 255, 0.25); border-top-color: #fff; }

/* ==========================================================================
   TABLET & HP
   ========================================================================== */
@media (max-width: 991.98px) {
  .shell { grid-template-columns: 1fr; padding: 12px 12px calc(var(--nav-h) + var(--safe-b) + 28px); gap: 0; }
  .chat-fab { display: none; }
  .filter-btn { display: inline-flex; }
  .chips { display: flex; }
  .tab-list-wrap { display: none; }

  .sidebar {
    position: fixed; z-index: 220; left: 0; right: 0; bottom: 0; top: auto; max-height: 88dvh; overflow-y: auto;
    padding: 6px 16px calc(20px + var(--safe-b)); background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); visibility: hidden; transition: transform 0.25s ease, visibility 0.25s; align-content: start;
  }
  .sidebar.open { transform: none; visibility: visible; }
  .sidebar .panel { box-shadow: none; padding: 14px; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 0; position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .drawer-head b { font-size: 1.05rem; font-weight: 800; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 210; background: rgba(8, 11, 26, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .drawer-backdrop.open { opacity: 1; pointer-events: auto; }

  .bottom-nav {
    position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    display: grid; grid-template-columns: repeat(3, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .nav-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
  .nav-item.active { color: var(--primary); }

  .chat-panel { z-index: 120; inset: var(--vvt, 0px) 0 auto 0; width: auto; height: var(--vvh, 100%); border-radius: 0; border: 0; animation: slide-up 0.2s ease-out; }
  .chat-head { padding-top: calc(12px + var(--safe-t)); }
  .composer { padding-bottom: calc(10px + var(--safe-b)); }
  @keyframes slide-up { from { transform: translateY(24px); opacity: 0; } }

  .bulk-bar { position: fixed; z-index: 85; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); margin: 0; }
  #toastRoot { left: 50%; right: auto; translate: -50% 0; }
}

@media (max-width: 767.98px) {
  body { font-size: 14.5px; }
  .topbar-inner { padding: 0 12px; }
  .brand small, .user-btn .uname { display: none; }
  .user-btn { padding: 0; border: 0; width: 40px; justify-content: center; }
  .user-btn .icon-chevD { display: none; }
  .avatar { width: 36px; height: 36px; font-size: 0.8rem; }

  .toolbar { grid-template-columns: minmax(0, 1fr) auto; position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 30; margin: 0 -12px 10px; padding: 8px 12px; background: var(--bg); }
  .toolbar .select, .toolbar .btn-reset { display: none; }

  .list { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .list-head { display: none; }
  .link-row {
    grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: 'check main actions' '. url url';
    row-gap: 4px; column-gap: 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  }
  .link-row:last-child { border-bottom: 1px solid var(--border); }
  .link-row:hover { background: var(--surface); }
  .link-row.is-selected { background: var(--primary-soft); border-color: var(--primary); }
  .cell-no { display: none; }
  .cell-url { font-size: 0.78rem; }
  .cell-actions { align-self: start; }
  .icon-btn { width: 42px; height: 42px; }
  .list-meta { margin-top: 2px; }
  .pager { flex-direction: column; }
  .skeleton { height: 86px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }

  /* Menu pengguna di HP dibuka sebagai bottom sheet lewat JS (lihat main.js) */
  .menu, .menu-backdrop { display: none !important; }

  /* Modal jadi bottom sheet */
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet, .sheet-sm, .sheet-lg { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; animation: sheet-up 0.22s ease-out; transition: transform 0.2s; }
  .sheet-grip { display: block; }
  .sheet-foot { padding-bottom: calc(14px + var(--safe-b)); }
  .sheet-foot .btn { flex: 1; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
  .sheet-chat .messages { height: min(56dvh, 460px); }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
}

.menu-backdrop { position: fixed; inset: 0; z-index: 65; }
@media (min-width: 992px) { .menu-backdrop { display: none; } }

/* Pengaturan urutan/baris ada di toolbar (≥768px) atau di drawer filter (HP) */
.drawer-only-tools { display: none; }
@media (max-width: 767.98px) { .drawer-only-tools { display: block; } }

.prefix-actions { margin-top: 8px; }
.prefix-actions .btn { flex: 1; }
.danger-text { color: var(--danger); }

/* ---------- pengaturan logo (admin) ---------- */
.logo-stage { display: grid; place-items: center; padding: 8px 0 14px; }
.logo-preview {
  width: 168px; height: 168px; border-radius: 38px; overflow: hidden; display: grid; place-items: center;
  border: 1px dashed var(--border); background-color: var(--surface-2);
  background-image: conic-gradient(rgba(128, 128, 128, 0.14) 25%, transparent 0 50%, rgba(128, 128, 128, 0.14) 0 75%, transparent 0);
  background-size: 16px 16px;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-hint { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 10px; }
.logo-sizes { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 16px; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.logo-sizes figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.logo-sizes img { border-radius: 22%; background: var(--surface-2); object-fit: contain; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.menu-role { color: var(--muted); font-weight: 700; font-size: 0.8rem; margin: -6px 0 8px; }
.menu-sheet { display: grid; gap: 2px; }
.menu-sheet .menu-item { padding: 13px 12px; font-size: 0.95rem; }

/* ---------- lencana obrolan: jumlah pesan baru (biru) + jumlah mention untuk saya (merah, @N) ---------- */
.chat-badges { position: absolute; top: -7px; right: -9px; display: flex; gap: 3px; pointer-events: none; }
.chat-badges .badge { border: 2px solid var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.chat-unread { background: var(--primary); color: var(--on-primary); }
.chat-fab .chat-unread { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.nav-item .chat-badges { top: 3px; right: auto; left: calc(50% + 2px); }
.nav-item .chat-badges .badge { border-color: var(--surface); }
.nav-item .chat-badges:has(.chat-unread:not([hidden])):has(.chat-mention:not([hidden])) { left: calc(50% - 6px); }

.day-sep.new-sep { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.msg.mentions-me .bubble { border-color: var(--warning); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 30%, transparent); }

/* ==========================================================================
   TAMPILAN BARU — gaya "Appify": ungu-indigo, kartu putih membulat, chip pill,
   header gradien, navigasi bawah melayang. Semua warna lewat token di atas
   (tema Terang / Gelap / Soft Blue ikut menyesuaikan).
   ========================================================================== */
body {
  background-color: var(--bg);
  background-image: radial-gradient(900px 380px at 90% -140px, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%);
  background-repeat: no-repeat;
  letter-spacing: -0.005em;
}
h1, h2, h3, .sheet-title, .brand b { letter-spacing: -0.02em; }

/* judul panel: kalimat biasa, tebal (bukan huruf kapital kecil) */
.panel { border-radius: var(--radius); padding: 18px; }
.panel-title { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.01em; text-transform: none; color: var(--text); margin-bottom: 12px; }
.section-title { text-transform: none; letter-spacing: 0; font-size: 0.82rem; }

/* tombol */
.btn { border-radius: 12px; min-height: 42px; }
.btn-sm { border-radius: 10px; }
.btn-primary { background: var(--grad); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.07); }
.btn-outline { background: var(--surface); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.icon-btn { border-radius: 14px; }
.badge { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.badge.soft { background: var(--primary-soft); box-shadow: none; }
.badge.ok { background: rgba(11, 154, 110, 0.14); box-shadow: none; }

/* form: kolom terisi lembut */
.input, .select, .textarea { border-radius: 12px; background-color: var(--surface-2); border-color: transparent; }
.input:focus, .select:focus, .textarea:focus { background-color: var(--surface); }
.field label { font-weight: 700; }

/* ---------- header gradien ---------- */
.topbar {
  background: var(--topbar-grad); color: #fff; border-bottom: 0; backdrop-filter: none;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 26%, transparent);
}
.topbar .brand b { color: #fff; }
.topbar .brand small { color: rgba(255, 255, 255, 0.78); }
.topbar .brand img { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.topbar .icon-btn { color: rgba(255, 255, 255, 0.94); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.topbar .user-btn { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.topbar .user-btn:hover { background: rgba(255, 255, 255, 0.22); }
.topbar .avatar { background: #fff; color: #4a30c9; }
.menu { color: var(--text); border-radius: 18px; border-color: transparent; }
.menu-head b { color: var(--primary); }
.menu-item { border-radius: 12px; }

/* ---------- sidebar & kategori ---------- */
.tab-item { border-radius: 12px; padding: 10px 12px; }
.tab-item .count { padding: 1px 9px; border-radius: 99px; background: var(--surface-2); }
.tab-item.active { background: var(--primary-soft); font-weight: 800; }
.tab-item.active .count { background: var(--primary); color: var(--on-primary); }

.chips { padding: 4px 6px 12px; margin: 0 -6px; }
.chip { height: 38px; padding: 0 16px; background: var(--surface); box-shadow: 0 2px 8px rgba(80, 60, 200, 0.08); border-color: transparent; }
.chip .count { padding: 0 7px; border-radius: 99px; background: var(--surface-2); opacity: 1; }
.chip.active { background: var(--grad); border-color: transparent; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 34%, transparent); }
.chip.active .count { background: rgba(255, 255, 255, 0.24); color: inherit; }
#sourceChips { padding-top: 0; margin-top: -4px; }
#sourceChips .chip { height: 34px; font-size: 0.8rem; }

/* ---------- toolbar & daftar ---------- */
.search .input { background-color: var(--surface); border-color: transparent; box-shadow: var(--shadow); border-radius: 16px; min-height: 48px; }
.toolbar .select { border-radius: 14px; background-color: var(--surface); box-shadow: var(--shadow); min-height: 48px; }
.filter-btn { border-radius: 14px; background: var(--surface); border-color: transparent; box-shadow: var(--shadow); }
.list-meta h2 { font-size: 1.1rem; }

.list { border-radius: 22px; border-color: transparent; }
.list-head { background: transparent; }
.link-row { min-height: 66px; }
.link-row:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.link-title { font-weight: 700; }

/* petak sumber (Vidoy / Videy / Slicedrive / …) di tiap baris */
.src-tile {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.01em; background: var(--primary-soft); color: var(--primary);
}
.src-tile.s-vidoy { background: #ffe6f1; color: #d6336c; }
.src-tile.s-videy { background: #e4edff; color: #2f66f5; }
.src-tile.s-slicedrive { background: #dcf7ec; color: #0b8f68; }
.src-tile.s-lainnya { background: var(--surface-2); color: var(--muted); }
[data-theme='dark'] .src-tile.s-vidoy { background: rgba(255, 110, 165, 0.16); color: #ff8fba; }
[data-theme='dark'] .src-tile.s-videy { background: rgba(100, 150, 255, 0.16); color: #8db1ff; }
[data-theme='dark'] .src-tile.s-slicedrive { background: rgba(47, 210, 157, 0.15); color: #52e0b2; }

.page-btn { border-radius: 12px; border-color: transparent; box-shadow: var(--shadow); }
.page-btn.active { background: var(--grad); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.bulk-bar { border-radius: 18px; }

/* ---------- obrolan ---------- */
.chat-fab { background: var(--grad); box-shadow: 0 14px 32px color-mix(in srgb, var(--primary) 45%, transparent); }
.chat-panel { border-radius: 24px; border-color: transparent; }
.chat-head { background: var(--topbar-grad); }
.msg.me .bubble { background: var(--grad); }
.bubble { border-radius: 18px; }
.composer .send { background: var(--grad); box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 30%, transparent); }

/* ---------- sheet, toast, switch ---------- */
.sheet { border-radius: 26px; }
.sheet-title { font-size: 1.12rem; }
.row-card { border-radius: 16px; border-color: var(--border); }
.seg button { border-radius: 14px; }
.switch input:checked + span { background: var(--grad); }
.toast { border-radius: 16px; }

/* ---------- login ---------- */
.login { background: var(--topbar-grad) top / 100% 48dvh no-repeat, var(--bg); }
.login-card { border-radius: 30px; border-color: transparent; box-shadow: 0 30px 70px rgba(40, 25, 120, 0.22); padding: 36px 28px 30px; }
.login-card img { border-radius: 26px; box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 28%, transparent); }
.login-card h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.85rem; }
.login-submit { min-height: 48px; border-radius: 14px; }

/* ---------- HP & tablet ---------- */
@media (max-width: 991.98px) {
  .shell { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 44px); }
  .sidebar { border-radius: 28px 28px 0 0; }
  .sidebar .panel { background: var(--surface-2); border-color: transparent; }
  .sidebar .input, .sidebar .select, .sidebar .textarea { background-color: var(--surface); }

  /* navigasi bawah melayang, berwarna */
  .bottom-nav {
    left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: var(--nav-h); padding: 6px; gap: 4px;
    border: 0; border-radius: 26px; background: var(--topbar-grad); backdrop-filter: none;
    box-shadow: 0 16px 36px color-mix(in srgb, var(--primary) 40%, transparent);
  }
  .nav-item { border-radius: 20px; color: rgba(255, 255, 255, 0.68); transition: background 0.18s, color 0.18s; }
  .nav-item.active { color: #fff; background: rgba(255, 255, 255, 0.2); }
  .nav-item .chat-badges .badge { border-color: #5a3fe0; }
  .bulk-bar { bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }
}

@media (max-width: 767.98px) {
  .topbar { border-radius: 0 0 26px 26px; }
  .toolbar { padding-top: 12px; }
  .link-row {
    border-color: transparent; border-radius: 20px; padding: 14px; box-shadow: var(--shadow);
    grid-template-columns: 24px minmax(0, 1fr) auto; row-gap: 6px;
  }
  .link-row:last-child { border-bottom: 1px solid transparent; }
  .link-row.is-selected { border-color: var(--primary); }
  .cell-url { padding-left: 2px; }
  .skeleton { border-radius: 20px; border-color: transparent; }
  .sheet, .sheet-sm, .sheet-lg { border-radius: 28px 28px 0 0; }
  .sheet-grip { width: 44px; height: 5px; }
}

/* bayangan panel sidebar tidak terpotong oleh area gulir */
@media (min-width: 992px) {
  .sidebar { padding: 4px 8px 20px; margin: -4px -8px -20px; }
}

/* ---------- folder asal: label di baris + filter ---------- */
.title-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1; }
.folder-pill {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 0; border-radius: 99px; cursor: pointer;
  padding: 2px 10px 2px 7px; background: var(--primary-soft); color: var(--primary); font: 700 0.72rem/1.5 var(--font);
}
.folder-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-pill:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.folder-scroll { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.fl-text { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: left; line-height: 1.25; }
.fl-text b { font-weight: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-text small { color: var(--muted); font-weight: 500; font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-item.active .fl-text small { color: var(--primary); }
#folderChips { padding-top: 0; margin-top: -4px; }
#folderChips[hidden] { display: none; }
#folderChip { height: 34px; font-size: 0.8rem; max-width: 100%; }
#folderChip.active { background: var(--grad); border-color: transparent; color: var(--on-primary); }
.sheet .folder-scroll { max-height: 55vh; margin-top: 4px; }

/* nama folder panjang: kolom grid tidak boleh melebar mengikuti teks (penyebab scroll horizontal di sidebar) */
.sidebar { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.sidebar > .panel { min-width: 0; }
.tab-list { grid-template-columns: minmax(0, 1fr); }
.tab-item { min-width: 0; }
.fl-text b { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.batch-bar { width: 100%; height: 10px; accent-color: var(--primary); }

/* thumbnail di baris (gambar kecil dari situs asal) */
.row-thumb { flex: none; width: 68px; height: 42px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 767.98px) { .row-thumb { width: 64px; height: 40px; } }


/* Badge sementara (dari ringkasan tersimpan) selama data masih dimuat */
.count.pending { opacity: 0.55; }

/* ---- Bersihkan link redundan ---- */
.dd-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .dd-summary { grid-template-columns: 1fr; } }
.dd-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.dd-card.strong { border-color: var(--primary); }
.dd-card b { font-size: 0.8rem; color: var(--muted); }
.dd-num { font-size: 1.3rem; font-weight: 800; }
.dd-sub { color: var(--muted); font-size: 0.76rem; overflow-wrap: anywhere; }
.dd-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 6px; }
.dd-group { border: 1px solid var(--border); border-radius: 14px; margin: 10px 0; overflow: hidden; background: var(--surface); }
.dd-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); }
.dd-name { font-weight: 700; flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.dd-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.dd-row img, .dd-noimg { width: 36px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; border: 1px solid var(--border); }
.dd-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; }
.dd-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.dd-tags { display: flex; flex-wrap: wrap; gap: 4px; }


/* ---------- progres muat awal (#loadCard) + pesan layar boot ---------- */
.boot-in { display: grid; justify-items: center; gap: 14px; }
.boot-msg { margin: 0; min-height: 1.2em; color: var(--muted); font-weight: 600; font-size: 0.85rem; }

.loadcard { margin: 0 0 14px; padding: 14px 16px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.lc-head { display: flex; align-items: center; gap: 10px; }
.lc-head b { font-size: 0.95rem; }
.lc-total { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; font-weight: 700; }
.lc-x { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.lc-x:hover { background: var(--surface-2); color: var(--text); }
.lc-bar { height: 6px; margin: 10px 0 8px; border-radius: 6px; background: var(--primary-soft); overflow: hidden; }
.lc-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--primary); transition: width 0.25s ease; }
.lc-bar.indet i { width: 38%; animation: lc-slide 1.2s ease-in-out infinite; }
@keyframes lc-slide { from { transform: translateX(-110%); } to { transform: translateX(290%); } }
.lc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lc-step { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.lc-step .lc-name { display: grid; color: var(--text); font-weight: 600; min-width: 0; }
.lc-step .lc-name small { color: var(--muted); font-weight: 500; font-size: 0.78rem; overflow-wrap: anywhere; }
.lc-step time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.8rem; }
.lc-ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; border: 2px solid var(--border); color: #fff; }
.lc-step.run .lc-ico { border-color: var(--primary-soft); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
.lc-step.done .lc-ico { background: var(--success); border-color: var(--success); }
.lc-step.err .lc-ico { background: var(--danger); border-color: var(--danger); }
.lc-step.warn .lc-ico { border-top-color: var(--warning); }
.lc-step.warn time, .lc-step.warn.run .lc-name { color: var(--warning); }
.lc-step.bad.run .lc-ico { border-top-color: var(--danger); }
.lc-step.bad time { color: var(--danger); }
.lc-hint { margin: 10px 0 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.82rem; line-height: 1.45; background: var(--surface-2); color: var(--text); border-left: 3px solid var(--primary); }
.lc-hint.warn { border-left-color: var(--warning); }
.lc-hint.bad { border-left-color: var(--danger); background: var(--danger-soft); }
.lc-actions { margin-top: 10px; display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .lc-bar.indet i, .lc-step.run .lc-ico { animation-duration: 3s; } }
