/* Catatan review: lapisan penanda di atas mockup, menu klik kanan, pop-up detail,
   form catatan, dan halaman Task Review. Palet emas mengikuti identitas Jejak Imani. */

:root {
    --note-gold: #d1ac50;
    --note-gold-soft: #f3e7c9;
    --note-gold-deep: #a8812f;
    --note-ink: #1f1b16;
    --note-muted: #857c6e;
    --note-line: #ece5d7;
    --note-line-soft: #f5f1e9;
    --note-surface: #fff;
    --note-surface-soft: #faf7f1;
    --note-red: #d0493b;
    --note-red-soft: #fbeae6;
    --note-orange: #c8821f;
    --note-orange-soft: #fcf1dc;
    --note-green: #3e9268;
    --note-green-soft: #e7f4ec;
    --note-blue: #3e77c4;
    --note-blue-soft: #e9f0fb;
    --note-neutral: #7d7466;
    --note-neutral-soft: #f1ede5;
    --note-shadow: 0 18px 44px rgba(31, 27, 22, 0.16);
    --note-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== Lapisan penanda ===== */
.review-layer {
    position: fixed;
    inset: 0;
    z-index: 1035;
    pointer-events: none;
}

/* Penanda di dalam dialog harus berada di atas backdrop modal Vuexy (1040/1050). */
.review-layer--overlay {
    z-index: 1061;
}

.review-point {
    position: fixed;
    width: 1px;
    height: 1px;
}

.review-marker {
    position: fixed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: var(--note-neutral);
    box-shadow: 0 4px 12px rgba(31, 27, 22, 0.28);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 160ms var(--note-ease), box-shadow 160ms var(--note-ease);
}

.review-marker:hover,
.review-marker:focus-visible {
    transform: scale(1.18);
    outline: none;
    box-shadow: 0 6px 18px rgba(31, 27, 22, 0.34);
}

.review-marker--red { background: var(--note-red); }
.review-marker--orange { background: var(--note-orange); }
.review-marker--green { background: var(--note-green); }
.review-marker--blue { background: var(--note-blue); }
.review-marker--neutral { background: var(--note-neutral); }

/* Catatan yang permukaannya tertutup parkir di tombol pembukanya. */
.review-marker--parked {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    box-shadow: 0 0 0 3px rgba(209, 172, 80, 0.3);
}

.review-marker.is-radar::before,
.review-marker.is-radar::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px solid currentColor;
    border-radius: 50%;
    animation: review-radar 1600ms var(--note-ease) infinite;
}

.review-marker.is-radar::after {
    animation-delay: 800ms;
}

@keyframes review-radar {
    from { opacity: 0.75; transform: scale(1); }
    to { opacity: 0; transform: scale(2.6); }
}

/* ===== Dock mengambang ===== */
.review-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1036;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-dock__hint {
    max-width: 0;
    overflow: hidden;
    color: var(--note-muted);
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 200ms var(--note-ease), max-width 200ms var(--note-ease);
}

.review-dock:hover .review-dock__hint,
.review-dock:focus-within .review-dock__hint {
    max-width: 320px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--note-shadow);
    opacity: 1;
}

.review-dock__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--note-line);
    border-radius: 50%;
    color: var(--note-gold-deep);
    background: linear-gradient(180deg, #fff, var(--note-surface-soft));
    box-shadow: var(--note-shadow);
    cursor: pointer;
    transition: transform 160ms var(--note-ease), color 160ms var(--note-ease);
}

.review-dock__btn:hover {
    transform: translateY(-2px);
    color: var(--note-ink);
}

.review-dock__count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    background: var(--note-red);
}

@media (max-width: 600px) {
    .review-dock__hint { display: none; }
}

/* ===== Pop-up (menu klik kanan & detail) ===== */
.note-popover {
    position: fixed;
    z-index: 1070;
    min-width: 232px;
    max-width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--note-line);
    border-radius: 14px;
    background: var(--note-surface);
    box-shadow: var(--note-shadow);
}

.note-popover--detail {
    min-width: 300px;
    padding: 14px 16px;
}

.note-popover__title,
.note-popover__note {
    margin: 4px 8px 6px;
    color: var(--note-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.note-popover__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    color: var(--note-ink);
    font-size: 13px;
    text-align: left;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    transition: background 140ms var(--note-ease);
}

.note-popover__item:hover {
    color: var(--note-ink);
    background: var(--note-surface-soft);
}

.note-popover__item .feather {
    flex: none;
    margin-top: 2px;
    color: var(--note-gold-deep);
}

.note-popover__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.note-popover__label small {
    color: var(--note-muted);
    font-size: 11px;
}

.note-popover__check {
    margin-left: auto;
    color: var(--note-green);
}

.note-popover__divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--note-line-soft);
}

/* ===== Detail catatan ===== */
.note-detail__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.note-detail__title {
    margin: 0 0 6px;
    color: var(--note-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.note-detail__body {
    margin-bottom: 8px;
    color: #4a4338;
    font-size: 13px;
    line-height: 1.55;
}

.note-detail__meta {
    margin: 0 0 10px;
    color: var(--note-muted);
    font-size: 11px;
}

.note-detail__statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--note-line-soft);
}

.note-detail__actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.note-detail__due {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--note-muted);
    font-size: 11px;
    font-weight: 600;
    background: var(--note-line-soft);
}

.note-detail__due--overdue { color: var(--note-red); background: var(--note-red-soft); }
.note-detail__due--today { color: var(--note-orange); background: var(--note-orange-soft); }

.note-detail__empty {
    margin: 0 0 8px;
    color: var(--note-muted);
    font-size: 13px;
    font-style: italic;
}

.note-detail__section {
    padding-top: 10px;
    margin-bottom: 10px;
    border-top: 1px solid var(--note-line-soft);
}

.note-detail__section-title {
    margin: 0 0 6px;
    color: var(--note-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.note-history {
    margin: 0;
    padding: 0;
    list-style: none;
}

.note-history__item {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--note-ink);
    font-size: 12px;
}

.note-history__item + .note-history__item { border-top: 1px dashed var(--note-line-soft); }

/* ===== Chip & pill status ===== */
.note-status-chip,
.note-status-pill {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.note-status-chip { cursor: pointer; }

.note-status-pill {
    color: var(--note-muted);
    background: var(--note-surface-soft);
    cursor: pointer;
    transition: border-color 140ms var(--note-ease), background 140ms var(--note-ease);
}

.note-status-pill:hover { border-color: var(--note-gold); }

.note-status-chip--red, .note-status-pill--red.is-active { color: var(--note-red); background: var(--note-red-soft); border-color: var(--note-red-soft); }
.note-status-chip--orange, .note-status-pill--orange.is-active { color: var(--note-orange); background: var(--note-orange-soft); border-color: var(--note-orange-soft); }
.note-status-chip--green, .note-status-pill--green.is-active { color: var(--note-green); background: var(--note-green-soft); border-color: var(--note-green-soft); }
.note-status-chip--blue, .note-status-pill--blue.is-active { color: var(--note-blue); background: var(--note-blue-soft); border-color: var(--note-blue-soft); }
.note-status-chip--neutral, .note-status-pill--neutral.is-active { color: var(--note-neutral); background: var(--note-neutral-soft); border-color: var(--note-neutral-soft); }

/* ===== Form catatan ===== */
.note-form {
    display: grid;
    gap: 16px;
}

.note-form__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
}

.note-field {
    display: block;
    margin: 0;
    border: 0;
    padding: 0;
}

.note-field__label {
    display: block;
    margin-bottom: 6px;
    color: var(--note-muted);
    font-size: 12px;
    font-weight: 600;
}

.note-field__hint {
    display: block;
    margin-top: 6px;
    color: var(--note-muted);
    font-size: 11px;
    line-height: 1.45;
}

.note-field__error {
    display: block;
    margin-top: 6px;
    color: var(--note-red);
    font-size: 11px;
    font-weight: 600;
}

.note-form__location {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--note-line);
    border-radius: 12px;
    color: #4a4338;
    font-size: 12px;
    line-height: 1.5;
    background: var(--note-surface-soft);
}

.note-form__location .feather {
    flex: none;
    margin-top: 2px;
    color: var(--note-gold-deep);
}

.note-status-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.note-status-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.note-status-choice__face {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid var(--note-line);
    border-radius: 999px;
    color: var(--note-muted);
    font-size: 11px;
    font-weight: 700;
    background: var(--note-surface);
    cursor: pointer;
    transition: border-color 140ms var(--note-ease), background 140ms var(--note-ease);
}

.note-status-choice { margin: 0; }
.note-status-choice__face:hover { border-color: var(--note-gold); }

.note-status-choice--red input:checked + .note-status-choice__face { color: var(--note-red); border-color: var(--note-red); background: var(--note-red-soft); }
.note-status-choice--orange input:checked + .note-status-choice__face { color: var(--note-orange); border-color: var(--note-orange); background: var(--note-orange-soft); }
.note-status-choice--green input:checked + .note-status-choice__face { color: var(--note-green); border-color: var(--note-green); background: var(--note-green-soft); }
.note-status-choice--blue input:checked + .note-status-choice__face { color: var(--note-blue); border-color: var(--note-blue); background: var(--note-blue-soft); }
.note-status-choice--neutral input:checked + .note-status-choice__face { color: var(--note-neutral); border-color: var(--note-neutral); background: var(--note-neutral-soft); }

.note-status-choice input:focus-visible + .note-status-choice__face {
    outline: 2px solid var(--note-gold);
    outline-offset: 2px;
}

/* ===== Editor teks ===== */
.rich-text {
    border: 1px solid var(--note-line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--note-surface);
}

.rich-text__tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid var(--note-line-soft);
    background: var(--note-surface-soft);
}

.rich-text__tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    color: var(--note-muted);
    background: transparent;
    cursor: pointer;
    transition: color 140ms var(--note-ease), background 140ms var(--note-ease);
}

.rich-text__tool:hover {
    color: var(--note-ink);
    background: #fff;
}

.rich-text__glyph { font-size: 13px; font-weight: 800; }
.rich-text__glyph--bold { font-weight: 900; }
.rich-text__glyph--italic { font-style: italic; }

.rich-text__hint {
    margin-left: auto;
    color: var(--note-muted);
    font-size: 11px;
}

.rich-text__hint code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #fff;
}

.rich-text__area {
    border: 0;
    border-radius: 0;
    resize: vertical;
}

.rich-text__area:focus { box-shadow: none; }

/* Daftar hasil render isi catatan */
.rich-li { display: flex; gap: 6px; align-items: flex-start; }
.rich-li--num { display: list-item; margin-left: 16px; }
.rich-li__dot { flex: none; width: 5px; height: 5px; margin-top: 7px; border-radius: 50%; background: var(--note-gold-deep); }
.rich-li__icon { flex: none; margin-top: 2px; color: var(--note-green); }
.rich-li--task.is-done .rich-li__text { color: var(--note-muted); text-decoration: line-through; }
.note-detail__body ul, .note-detail__body ol { margin: 0 0 6px; padding-left: 0; list-style: none; }
.note-detail__body ol { list-style: decimal; padding-left: 18px; }
.note-detail__body p { margin: 0 0 6px; }

/* ===== Halaman Task Review ===== */
.note-card {
    display: grid;
    gap: 16px;
    padding: 20px;
    /* Tabel lebar menggulir di dalam .table-responsive; kartu ikut dipotong supaya
       lebarnya tidak merembet jadi scroll horizontal halaman di layar sempit.
       Pop-up status dilampirkan ke <body>, jadi tidak ikut terpotong. */
    overflow: hidden;
    border: 1px solid var(--note-line);
    border-radius: 18px;
    background: var(--note-surface);
    box-shadow: 0 2px 10px rgba(31, 27, 22, 0.05);
}

.note-card__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.note-card__title {
    margin: 0;
    color: var(--note-ink);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.note-card__lead {
    max-width: 68ch;
    margin: 6px 0 0;
    color: var(--note-muted);
    font-size: 12px;
    line-height: 1.55;
}

.note-card__count {
    flex: none;
    margin: 0;
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--note-gold-deep);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--note-gold-soft);
}

.note-tabs {
    display: flex;
    gap: 4px;
    width: fit-content;
    padding: 4px;
    border-radius: 999px;
    background: var(--note-line-soft);
}

.note-tab {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 7px 16px;
    border: 0;
    border-radius: 999px;
    color: var(--note-muted);
    font-size: 12px;
    font-weight: 700;
    background: transparent;
    cursor: pointer;
    transition: color 160ms var(--note-ease), background 160ms var(--note-ease);
}

.note-tab:hover { color: var(--note-ink); }

.note-tab[aria-pressed="true"] {
    color: var(--note-ink);
    background: var(--note-surface);
    box-shadow: 0 1px 3px rgba(31, 27, 22, 0.1);
}

.note-tab__count,
.note-summary__count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    color: var(--note-ink);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    background: #e6e2db;
}

.note-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.note-summary__chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid var(--note-line);
    border-radius: 999px;
    color: var(--note-muted);
    font-size: 12px;
    font-weight: 600;
    background: var(--note-surface);
    cursor: pointer;
    transition: color 160ms var(--note-ease), border-color 160ms var(--note-ease), background 160ms var(--note-ease);
}

.note-summary__chip:hover { border-color: var(--note-gold); }

.note-summary__chip--red.is-active { color: var(--note-red); border-color: var(--note-red); background: var(--note-red-soft); }
.note-summary__chip--orange.is-active { color: var(--note-orange); border-color: var(--note-orange); background: var(--note-orange-soft); }
.note-summary__chip--green.is-active { color: var(--note-green); border-color: var(--note-green); background: var(--note-green-soft); }
.note-summary__chip--blue.is-active { color: var(--note-blue); border-color: var(--note-blue); background: var(--note-blue-soft); }
.note-summary__chip--neutral.is-active { color: var(--note-ink); border-color: var(--note-muted); background: var(--note-neutral-soft); }

.note-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--note-line-soft);
    border-radius: 14px;
    background: var(--note-surface-soft);
}

.note-filters__search { grid-column: span 2; }
.note-filters .form-control { height: auto; padding: 7px 12px; font-size: 13px; }

.note-table th {
    padding: 10px 16px;
    border-bottom: 2px solid var(--note-line);
    color: var(--note-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--note-line-soft);
}

.note-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--note-line-soft);
    vertical-align: top;
}

.note-table tbody tr:hover td { background: #fcfaf6; }
.note-table tr.is-highlight td { background: var(--note-gold-soft); }
.note-table th:nth-child(2) { min-width: 260px; }

.note-table__empty {
    padding: 36px 16px;
    color: var(--note-muted);
    text-align: center;
}

.note-table__actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.note-table__actions > * + * { margin-left: 6px; }

/* Judul adalah tombol pembuka pop-up detail; tampilannya dibuat seperti teks biasa. */
.note-cell__title {
    display: block;
    padding: 0;
    border: 0;
    color: var(--note-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    background: none;
    cursor: pointer;
}

.note-cell__title:hover,
.note-cell__title:focus-visible {
    color: var(--note-gold-deep);
    text-decoration: underline;
}

.note-cell__location {
    display: inline-flex;
    gap: 6px;
    align-items: flex-start;
    color: var(--note-muted);
    font-size: 11px;
    line-height: 1.45;
    text-decoration: none;
}

.note-cell__location--plain { cursor: default; }
.note-cell__location:hover strong { color: var(--note-gold-deep); }
.note-cell__location .feather { flex: none; margin-top: 1px; color: var(--note-gold-deep); }
.note-cell__location strong { display: block; color: var(--note-ink); font-size: 12px; }
.note-cell__location small { display: block; color: var(--note-muted); }

.note-cell__surface {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-top: 2px;
    padding: 1px 7px 1px 5px;
    border-radius: 999px;
    color: var(--note-muted);
    background: var(--note-line-soft);
}

.note-cell__author { display: block; color: var(--note-ink); font-size: 12px; font-weight: 600; }
.note-cell__muted { display: block; color: var(--note-muted); font-size: 10px; }

.note-due { display: block; color: var(--note-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.note-due small { display: block; font-size: 10px; font-weight: 600; }
.note-due--overdue, .note-due--overdue small { color: var(--note-red); }
.note-due--today, .note-due--today small { color: var(--note-orange); }

.note-storage {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--note-green);
    font-size: 11px;
    font-weight: 600;
    background: var(--note-green-soft);
}

.note-storage--local { color: var(--note-orange); background: var(--note-orange-soft); }

@media (max-width: 1099px) {
    .note-filters__search { grid-column: span 1; }
}

@media (max-width: 767px) {
    .note-form__grid { grid-template-columns: 1fr; }
    .note-filters { grid-template-columns: 1fr 1fr; }
    .note-filters__search { grid-column: span 2; }
}

/* .note-card memakai grid; anaknya perlu min-width 0 agar .table-responsive benar-benar
   bisa menyusut dan tabelnya yang menggulir, bukan seluruh halaman. */
.note-card > * {
    min-width: 0;
}

@media (max-width: 575px) {
    .note-card { padding: 14px; }
    .note-filters { grid-template-columns: 1fr; }
    .note-filters__search { grid-column: span 1; }
}
