/* Simple Kanban — panel kaca lembut, aksen indigo, light/dark.
   Tema: ikut sistem; <html data-theme="light|dark"> menimpa (diatur lewat tombol di header). */
:root {
  color-scheme: light dark;
  --bg-a: light-dark(#f3f4fb, #0d1017);
  --bg-b: light-dark(#fcfcfe, #141927);
  --glow: light-dark(rgba(99, 102, 241, .11), rgba(99, 102, 241, .17));
  --surface: light-dark(#ffffff, #1a2030);
  --surface-2: light-dark(#f5f6fb, #151a28);
  --col: light-dark(rgba(255, 255, 255, .6), rgba(255, 255, 255, .035));
  --col-line: light-dark(rgba(79, 70, 229, .10), rgba(255, 255, 255, .07));
  --ink: light-dark(#1b1f33, #e8eaf6);
  --mute: light-dark(#5a6078, #9ba2bd);
  --line: light-dark(#d9dcea, #2d3449);
  --line-soft: light-dark(#e6e8f2, #252b3d);
  --accent: light-dark(#4f46e5, #8b93f8);
  --accent-ink: light-dark(#ffffff, #0d0f1c);
  --accent-soft: light-dark(#eceefe, #272b52);
  --danger: light-dark(#c0262d, #f59a9f);
  --danger-soft: light-dark(#fdeff0, #3a1f27);
  --danger-line: light-dark(#f2c3c8, #6b2f39);
  --ok: light-dark(#17794a, #6fdca4);
  --ok-soft: light-dark(#e1f5ea, #173a2c);
  --warn-soft: light-dark(#fff6e0, #3a3116);
  --p-low-fg: light-dark(#4b5469, #c3cad9);   --p-low-bg: light-dark(#eceff5, #2b3243);   --p-low-line: light-dark(#dde1ec, #3a4258);
  --p-medium-fg: light-dark(#8a5700, #f4cd78); --p-medium-bg: light-dark(#fff3d4, #3b3118); --p-medium-line: light-dark(#f5dc9b, #5c4a1f);
  --p-high-fg: light-dark(#b4232a, #f7a3a8);  --p-high-bg: light-dark(#fde8ea, #3d2128);  --p-high-line: light-dark(#f6c6cb, #6b2f39);
  --dot-todo: light-dark(#8b93a8, #7e869c);
  --dot-in_progress: #3b82f6;
  --dot-done: #22c55e;
  --shadow: 0 1px 2px rgba(25, 28, 70, .05), 0 6px 16px -8px rgba(25, 28, 70, .14);
  --shadow-lift: 0 10px 30px rgba(25, 28, 70, .22);
  --shadow-lg: 0 20px 60px rgba(15, 18, 50, .32);
  --backdrop: light-dark(rgba(25, 28, 60, .42), rgba(0, 0, 0, .62));
  --sk: light-dark(#dfe2ee, #262d40);
  --sk-hi: light-dark(#eef0f7, #313950);
  --radius: 10px;
  --radius-lg: 16px;
  --topbar-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root { accent-color: var(--accent); scrollbar-color: var(--line) transparent; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6078' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ba2bd' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ba2bd' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; }
input, textarea { caret-color: var(--accent); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background:
    radial-gradient(1100px 520px at 72% -8%, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--bg-a), var(--bg-b)) fixed;
  background-color: var(--bg-a);
  font: 400 14px/1.5 var(--font);
  display: flex; flex-direction: column;
}
body:has(dialog[open]) { overflow: hidden; }
body.dragging { cursor: grabbing; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
.muted { color: var(--mute); }
.spacer { flex: 1; }
.icon { flex: none; }

/* ---- Kontrol ---- */
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; min-height: 36px; }
textarea { resize: vertical; line-height: 1.55; }
select {
  cursor: pointer; appearance: none; -webkit-appearance: none; text-overflow: ellipsis;
  padding-right: 36px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
select:disabled { cursor: not-allowed; }
input[type="date"] { padding-right: 10px; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; margin-left: 4px; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; cursor: not-allowed; }
[aria-invalid="true"] { border-color: var(--danger); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, filter .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--mute); font-weight: 500; }
.btn-quiet:hover { background: var(--accent-soft); color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); justify-content: flex-start; padding-left: 8px; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 9px; background: transparent; color: var(--mute); cursor: pointer; }
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }
.hint { color: var(--mute); font-size: 12.5px; }
.sep { width: 1px; height: 22px; background: var(--line); flex: none; }

.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; border: 1px solid transparent;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.prio-low { background: var(--p-low-bg); color: var(--p-low-fg); border-color: var(--p-low-line); }
.prio-medium { background: var(--p-medium-bg); color: var(--p-medium-fg); border-color: var(--p-medium-line); }
.prio-high { background: var(--p-high-bg); color: var(--p-high-fg); border-color: var(--p-high-line); }
.badge-overdue { background: transparent; color: var(--danger); border: 0; padding: 0; height: auto; margin-left: 5px; font-size: 10px; }
.key { font-size: 11.5px; font-weight: 600; color: var(--mute); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.key-lg { font-size: 13px; }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap;
  padding: 12px max(24px, calc((100vw - 1500px) / 2 + 24px)); border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg-a) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 4px 12px -3px rgba(79, 70, 229, .55);
}
h1 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.mode-pill { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); border: 1px solid var(--line); cursor: help; white-space: nowrap; }
.seg { display: inline-flex; gap: 2px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 3px; background: var(--surface); }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--mute); cursor: pointer; min-height: 28px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.filters { display: flex; align-items: center; gap: 8px; flex: 1 1 340px; min-width: 0; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; display: flex; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.search input { width: 100%; padding-left: 33px; background: var(--surface); border-color: var(--line-soft); }
.filters select { border-color: var(--line-soft); font-size: 13px; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.banner { display: flex; align-items: center; gap: 10px; width: calc(100% - 48px); max-width: 1452px; margin: 14px auto 0; padding: 10px 14px; border-radius: var(--radius); background: var(--danger-soft); border: 1px solid var(--danger-line); }
.banner .icon { color: var(--danger); }
.banner span { flex: 1; }
main { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 20px; }
.no-match { display: flex; align-items: center; gap: 12px; width: calc(100% - 48px); max-width: 1452px; margin: 0 auto 16px; padding: 12px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.no-match p { flex: 1; color: var(--mute); }

/* ---- Board ---- */
.board { display: grid; grid-template-columns: repeat(3, minmax(290px, 1fr)); gap: 18px; padding: 0 24px 28px; align-items: start; max-width: 1500px; width: 100%; margin: 0 auto; }
.col {
  display: flex; flex-direction: column; min-height: 200px; max-height: calc(100dvh - var(--topbar-h) - 56px);
  background: var(--col); border: 1px solid var(--col-line); border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .12s, background-color .12s;
}
.col.drop-target { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--col)); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 14px 16px 10px; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot-todo); flex: none; }
.col[data-status="todo"] .col-dot { background: var(--dot-todo); }
.col[data-status="in_progress"] .col-dot { background: var(--dot-in_progress); }
.col[data-status="done"] .col-dot { background: var(--dot-done); }
.col-head h2 { font-size: 14px; font-weight: 700; letter-spacing: -.005em; }
.col-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 11.5px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.quick-add { padding: 0 12px 10px; }
.quick-input { width: 100%; min-height: 34px; font-size: 13px; background: var(--surface); border-color: var(--line-soft); border-radius: 10px; box-shadow: var(--shadow); }
.quick-input::placeholder { color: var(--mute); }
.quick-input:focus { border-color: var(--accent); }
.cards { flex: 1; overflow-y: auto; padding: 2px 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; overscroll-behavior: contain; }
.col-empty { border: 1px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--mute); padding: 16px; cursor: text; text-align: center; }

.card {
  position: relative; display: grid; gap: 8px; padding: 12px 14px; cursor: grab;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; box-shadow: var(--shadow);
  transition: border-color .12s, box-shadow .12s;
}
.card:hover { border-color: var(--line); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.card.is-dragging { display: none; }
.card-top { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.card-menu { width: 26px; height: 24px; opacity: 0; transition: opacity .12s; }
.card:hover .card-menu, .card:focus-within .card-menu, .card-menu[aria-expanded="true"] { opacity: 1; }
.card-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.is-done .card-title { color: var(--mute); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mute) 60%, transparent); }
.card.is-overdue { border-color: var(--danger-line); background: linear-gradient(180deg, var(--danger-soft), var(--surface) 75%); }
.card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 9px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--mute); }
.card-meta .count { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-variant-numeric: tabular-nums; }
.card-meta .count.has { color: var(--ink); }
.card-meta .count-comment.has { color: var(--accent); font-weight: 600; }
.card-meta .due { padding: 2px 7px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface-2); font-weight: 500; }
.card-meta .due.overdue { background: var(--danger-soft); border-color: var(--danger-line); }
.due { display: inline-flex; align-items: center; gap: 5px; }
.due.overdue { color: var(--danger); font-weight: 600; }
.placeholder { border: 2px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); min-height: 56px; flex: none; }

/* ---- Skeleton ---- */
.sk { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--sk) 25%, var(--sk-hi) 50%, var(--sk) 75%) 0 0 / 300% 100%; animation: shimmer 1.3s infinite linear; }
.sk-line { width: 100%; } .sk-line.mid { width: 70%; } .sk-line.short { width: 35%; }
.sk-title { height: 26px; width: 60%; margin-bottom: 14px; }
.sk-block { height: 120px; margin-top: 14px; }
.card.skeleton { cursor: default; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ---- List ---- */
.list-wrap { width: calc(100% - 48px); max-width: 1452px; margin: 0 auto 24px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow); }
.list { width: 100%; border-collapse: collapse; min-width: 860px; }
.list th, .list td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.list thead th { background: var(--surface-2); font-weight: 600; font-size: 12px; padding: 0; text-transform: uppercase; letter-spacing: .04em; }
.th-sort { display: flex; align-items: center; gap: 4px; width: 100%; padding: 11px 12px; border: 0; background: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer; color: var(--mute); text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover { background: var(--accent-soft); color: var(--ink); }
.sort-ind { display: inline-flex; width: 14px; color: var(--accent); }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--surface-2); }
.list tbody tr:last-child td { border-bottom: 0; }
.col-key { width: 80px; white-space: nowrap; }
.col-title { min-width: 240px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.col-status { width: 150px; }
.row-status { min-height: 32px; padding: 3px 32px 3px 10px; width: 100%; font-size: 13px; background-position: right 10px center; }
.col-priority { width: 100px; }
.col-due { width: 160px; white-space: nowrap; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; width: 100px; }
.list th.col-attachment_count .th-sort, .list th.col-comment_count .th-sort { justify-content: flex-end; }
.col-updated_at { width: 140px; white-space: nowrap; color: var(--mute); }
.list-empty { text-align: center !important; color: var(--mute); padding: 32px !important; }
.skeleton-row td { padding: 14px 12px; }

/* ---- Dialog ---- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal { border-radius: var(--radius-lg); width: min(560px, 94vw); max-height: 92dvh; border: 1px solid var(--line-soft); }
.modal[open] { display: flex; flex-direction: column; }
.modal-lg { width: min(1060px, 96vw); height: min(880px, 92dvh); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line-soft); flex: none; }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.form { display: flex; flex-direction: column; min-height: 0; }
.form-body { padding: 18px 22px; display: grid; gap: 14px; overflow-y: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line-soft); }
.field { display: grid; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--mute); }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field-error { color: var(--danger); font-size: 13px; }
.field-error:empty { display: none; }

/* ---- Detail ---- */
.modal-lg .modal-head { background: var(--surface-2); padding-block: 10px; }
.key-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.crumb-sep { color: var(--line); font-weight: 400; }
.crumb { font-size: 13px; font-weight: 600; color: var(--mute); }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); margin-right: 4px; }
.save-state.saved { color: var(--ok); }
.save-state.error { color: var(--danger); font-weight: 600; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.archived-banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 22px; flex: none; background: var(--warn-soft); border-bottom: 1px solid var(--line-soft); }
.archived-text { flex: 1 1 240px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.inline-field select { min-height: 32px; padding: 4px 32px 4px 10px; background-position: right 10px center; }

.modal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.modal-body.single { display: block; overflow-y: auto; }
.detail-main { padding: 26px 34px 40px; display: grid; gap: 30px; align-content: start; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.detail-main > .sk + .sk { margin-top: 10px; }
.detail-side { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line-soft); background: var(--surface-2); }
.detail-side > .sk { width: calc(100% - 44px); margin: 20px 22px 0; }
.side-block { padding: 22px; }
.side-fields { display: grid; gap: 16px; }
.side-activity { display: grid; gap: 14px; align-content: start; flex: 1; border-top: 1px solid var(--line-soft); }
.side-danger { position: sticky; bottom: 0; margin-top: auto; padding: 12px 22px; display: flex; justify-content: center; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.load-error { display: grid; justify-items: start; gap: 10px; padding: 32px 24px; color: var(--danger); }
.load-error p { color: var(--ink); }

.title-input { font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; border-color: transparent; background: transparent; resize: none; overflow: hidden; padding: 4px 8px; margin: 0 -8px -16px; min-height: 0; }
.title-input:hover:not([readonly]) { border-color: var(--line-soft); }
.title-input:focus { border-color: var(--accent); background: var(--surface); }
.title-input[readonly] { cursor: default; }
#title-err { margin-top: 12px; }

.section { display: grid; gap: 12px; }
.section-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.section-h { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--mute); font-variant-numeric: tabular-nums; }
.pill:empty { display: none; }
.tabs { display: inline-flex; gap: 2px; border: 1px solid var(--line-soft); border-radius: 9px; padding: 2px; background: var(--surface-2); }
.tab { border: 0; background: none; padding: 3px 12px; border-radius: 7px; color: var(--mute); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.desc-input { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 13px; line-height: 1.65; padding: 12px 14px; border-radius: 12px; }
.hint-row { display: flex; justify-content: space-between; gap: 12px; margin-top: -4px; }
.hint-row .hint { font-style: italic; }
.counter { font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.md { overflow-wrap: anywhere; line-height: 1.6; }
.md > * + * { margin-top: .6em; }
.md ul, .md ol { padding-left: 1.4em; margin-bottom: 0; }
.md blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--mute); }
.md code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line-soft); padding: 0 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); border: 1px solid var(--line-soft); padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin-bottom: 0; }
.md pre code { border: 0; padding: 0; background: none; }
.md .md-h { font-size: 15px; font-weight: 700; }
.md hr { border: 0; border-top: 1px solid var(--line); }
.desc-pane > .md { min-height: 150px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }

/* Panel samping */
.field { display: grid; gap: 6px; }
.field label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }
#d-priority[data-value="low"] { color: var(--p-low-fg); font-weight: 600; }
#d-priority[data-value="medium"] { color: var(--p-medium-fg); font-weight: 600; }
#d-priority[data-value="high"] { color: var(--p-high-fg); font-weight: 600; }
.side-fields input[type="date"] { width: 100%; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 2px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.meta-list dt { color: var(--mute); }
.meta-list dd { margin: 0; text-align: right; font-weight: 500; }

/* Lampiran */
.dropzone { display: grid; justify-items: center; gap: 4px; padding: 22px 16px; text-align: center; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--mute); background: var(--surface-2); transition: border-color .12s, background-color .12s; }
.dz-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 4px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-soft); color: var(--accent); }
.dz-title { color: var(--ink); font-weight: 600; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.att-list, .queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.queue:empty { display: none; }
.att-item, .queue-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }
.queue-item { padding-left: 12px; }
.queue-item.failed { border-color: var(--danger-line); background: var(--danger-soft); }
.queue-item.failed > .icon { color: var(--danger); }
.thumb { width: 48px; height: 48px; border-radius: 8px; flex: none; overflow: hidden; padding: 0; border: 1px solid var(--line-soft); background: var(--surface-2); display: grid; place-items: center; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-file { cursor: default; color: var(--mute); align-content: center; }
.thumb-file .ext { font-size: 9.5px; font-weight: 700; }
.att-text, .queue-text { flex: 1; min-width: 0; display: grid; }
.att-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.att-name { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); }
.att-sub { font-size: 12.5px; color: var(--mute); }
.empty-line { list-style: none; font-size: 13.5px; }

/* Komentar */
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); display: grid; gap: 8px; }
.comment.editing { border-color: var(--accent); background: var(--surface); }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head .anon { color: var(--mute); font-weight: 600; }
.comment-head .icon-btn { width: 28px; height: 26px; margin: -4px -6px -4px 0; }
.edited { font-size: 12px; color: var(--mute); font-style: italic; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; flex: none; }
.av-0 { background: light-dark(#e3e6ff, #2a2f63); color: light-dark(#3a3fb0, #b9bfff); }
.av-1 { background: light-dark(#d9f3e6, #173a2c); color: light-dark(#176b43, #7fe0ad); }
.av-2 { background: light-dark(#ffeccd, #3b3118); color: light-dark(#8a5700, #f4cd78); }
.av-3 { background: light-dark(#fde0e4, #3d2128); color: light-dark(#a8203a, #f7a3ae); }
.av-4 { background: light-dark(#d8eefb, #16344a); color: light-dark(#0f628f, #7cc8ef); }
.av-anon { background: var(--surface); color: var(--mute); border: 1px solid var(--line-soft); }
.comment-form { display: grid; gap: 8px; }
.comment-input { width: 100%; padding: 10px 12px; border-radius: 12px; }
.comment-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-actions.end { justify-content: flex-end; }
.comment-actions .hint { flex: 1; text-align: right; }
.author-input { width: 210px; max-width: 100%; min-height: 34px; padding: 5px 10px; }

/* Timeline & feed */
.timeline, .feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tl-item, .feed-item { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.feed-item { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.feed-item[aria-hidden] { display: grid; gap: 8px; }
.tl-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--mute); }
.tl-body { display: grid; gap: 1px; min-width: 0; flex: 1; }
.tl-detail { color: var(--mute); overflow-wrap: anywhere; }
.tl-time { font-size: 12px; color: var(--mute); }
.side-activity .timeline { gap: 0; }
.side-activity .tl-item { position: relative; padding: 0 0 16px; font-size: 12.5px; line-height: 1.45; }
.side-activity .tl-item:last-child { padding-bottom: 0; }
.side-activity .tl-item:not(:last-child)::before { content: ""; position: absolute; left: 11.5px; top: 28px; bottom: 2px; width: 1px; background: var(--line); }
.side-activity .tl-icon { background: var(--surface); }

/* ---- Drawer ---- */
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); max-width: 100vw; border-radius: 0; border-left: 1px solid var(--line-soft); display: none; }
.drawer[open] { display: flex; flex-direction: column; animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h2 { font-size: 17px; font-weight: 700; }
.drawer-sub { padding: 12px 22px; border-bottom: 1px solid var(--line-soft); }
.drawer-sub input { width: 100%; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 22px 22px; }
.drawer-empty { list-style: none; color: var(--mute); padding: 28px 0; text-align: center; display: grid; gap: 10px; justify-items: center; }
.feed-foot { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.feed-ref { border: 0; background: none; padding: 0; text-align: left; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.feed-ref:hover { text-decoration: underline; }
.feed-ref .key { color: inherit; }
.feed-ref.gone { color: var(--mute); cursor: default; text-decoration: line-through; }
.feed-ref.gone:hover { text-decoration: line-through; }
.arc-list { list-style: none; margin: 0; padding: 0; }
.arc-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.arc-item[aria-hidden] { display: grid; gap: 8px; }
.arc-open { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; border: 0; background: none; padding: 4px 8px; margin-left: -8px; border-radius: 8px; cursor: pointer; }
.arc-open:hover { background: var(--surface-2); }
.arc-title { font-weight: 600; overflow-wrap: anywhere; }
.arc-date { font-size: 12.5px; color: var(--mute); }

/* ---- Lightbox ---- */
.lightbox { background: transparent; box-shadow: none; max-width: 96vw; max-height: 96dvh; overflow: visible; }
.lightbox figure { margin: 0; display: grid; gap: 8px; justify-items: center; }
.lightbox img { max-width: 92vw; max-height: 84dvh; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-lg); }
.lightbox figcaption { color: #fff; font-size: 13px; text-shadow: 0 1px 2px #000; }
.lightbox-close { position: fixed; top: 14px; right: 14px; background: var(--surface); color: var(--ink); }
.lightbox::backdrop { background: rgba(8, 10, 22, .84); }

/* ---- Menu & toast ---- */
.menu { position: fixed; inset: auto; margin: 0; padding: 5px; min-width: 190px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); }
.menu-fallback { z-index: 50; }
.menu-heading { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-weight: 500; cursor: pointer; }
.menu-item:hover, .menu-item:focus { background: var(--accent-soft); outline: none; }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-item:disabled { color: var(--mute); cursor: default; background: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover, .menu-item.danger:focus { background: var(--danger-soft); }
.menu-item .icon { color: var(--mute); }
.menu-item.danger .icon { color: inherit; }
.toasts { position: fixed; inset: auto auto 20px 50%; transform: translateX(-50%); margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: center; width: min(440px, calc(100vw - 32px)); }
.toasts:not(:popover-open) { display: none; }
.toast { display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; padding: 8px 8px 8px 10px; border-radius: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lift); font-size: 13.5px; font-weight: 500; animation: toast-in .22s cubic-bezier(.16, 1, .3, 1); }
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; }
.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-ok .toast-icon { background: var(--ok-soft); color: var(--ok); }
.toast-msg { overflow-wrap: anywhere; padding-right: 2px; }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--mute); cursor: pointer; }
.toast-close:hover { background: var(--surface-2); color: var(--ink); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---- Konfirmasi ---- */
.confirm { width: min(430px, 92vw); }
.confirm-body { display: flex; gap: 14px; padding: 22px 22px 6px; }
.confirm-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--accent-soft); color: var(--accent); }
.confirm.is-danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
.confirm h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.confirm p { color: var(--mute); overflow-wrap: anywhere; }
.confirm .form-actions { border-top: 0; padding: 16px 22px 20px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: light-dark(#ffffff, #2a0d10); }
.btn-danger:hover { background: var(--danger); filter: brightness(1.08); }

/* ---- Responsif ---- */
@media (max-width: 1100px) {
  .filters { order: 3; flex-basis: 100%; }
  .search { max-width: none; }
}
@media (max-width: 900px) {
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; padding: 0 16px 20px; gap: 12px; max-width: none; }
  .col { flex: 0 0 min(86vw, 340px); scroll-snap-align: start; max-height: calc(100dvh - 190px); }
  .modal-body { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: max-content; overflow-y: auto; }
  .detail-main { overflow: visible; padding: 22px 24px 28px; }
  .detail-side { display: contents; }
  .side-fields { order: -1; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line-soft); }
  .side-fields .meta-list { grid-column: 1 / -1; }
  .side-activity { order: 1; background: var(--surface-2); }
  .side-danger { order: 2; position: static; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .topbar > .sep { display: none; }
  .actions { margin-left: 0; width: 100%; }
  .actions .btn-quiet, .actions .btn-primary { flex: 1; padding: 6px 8px; }
  .actions .sep { display: none; }
  .banner, .no-match, .list-wrap { width: calc(100% - 32px); }
  .list-wrap { margin-bottom: 16px; }
  .modal, .modal-lg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .detail-main { padding: 18px 16px 24px; }
  .side-fields { grid-template-columns: 1fr 1fr; padding: 16px; }
  .title-input { font-size: 22px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .comment-actions .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
