/* RPD — Admin Panel
   Glassmorphism biru-putih, dioptimalkan untuk desktop hingga mobile 360px. */

:root {
    --primary: #3988ff;
    --primary-dark: #2274e8;
    --primary-soft: rgba(57, 136, 255, 0.12);
    --bg: #dce8f3;
    --bg-2: #eef4fb;
    --surface: rgba(245, 250, 255, 0.75);
    --surface-solid: #f7fbff;
    --text: #17263c;
    --muted: #718299;
    --success: #31b780;
    --warning: #d9a828;
    --danger: #e05263;
    --line: rgba(23, 38, 60, 0.09);
    --shadow-sm: 0 4px 14px rgba(23, 38, 60, 0.06);
    --shadow: 0 18px 40px rgba(23, 38, 60, 0.09);
    --shadow-lg: 0 28px 60px rgba(23, 38, 60, 0.14);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --sidebar-w: 268px;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --font: "Plus Jakarta Sans", "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Atribut hidden harus menang atas display pada kelas layout seperti .field. */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1100px 640px at 88% -8%, rgba(57, 136, 255, 0.24), transparent 62%),
        radial-gradient(900px 520px at -10% 8%, rgba(255, 255, 255, 0.85), transparent 60%),
        linear-gradient(160deg, var(--bg-2) 0%, var(--bg) 58%, #cfdff0 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.55;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

a {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 0.7rem 1.1rem;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

.muted {
    color: var(--muted);
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.icon--trail {
    width: 15px;
    height: 15px;
    opacity: 0.6;
}

.icon--xl {
    width: 42px;
    height: 42px;
    opacity: 0.35;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.68rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 0.93rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(57, 136, 255, 0.32);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--line);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.btn--danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 10px 22px rgba(224, 82, 99, 0.3);
}

.btn--block {
    width: 100%;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
    color: var(--primary-dark);
    border-color: rgba(57, 136, 255, 0.45);
    background: #fff;
}

.icon-btn.is-on {
    color: var(--success);
    border-color: rgba(49, 183, 128, 0.42);
    background: rgba(49, 183, 128, 0.1);
}

.icon-btn--danger:hover {
    color: var(--danger);
    border-color: rgba(224, 82, 99, 0.45);
}

.link-more {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.link-more:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------ alerts */

/* ------------------------------------------------------------------ toast */

/* Notifikasi bertumpuk di pojok kanan bawah. Wadahnya tembus klik; hanya kartu
   toast yang menerima kursor, sehingga halaman di belakangnya tetap bisa
   dipakai selagi notifikasi tampil. */
.toast-stack {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(380px, calc(100vw - 2.8rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    font-size: 0.92rem;

    /* Transisi, bukan keyframes: toast bisa muncul beruntun, dan transisi
       melanjutkan dari nilai saat ini alih-alih mengulang dari nol.
       @starting-style memberi titik awal tanpa perlu menunggu frame di JS —
       kalau browser tidak mendukungnya, toast tetap tampil, hanya tanpa
       animasi masuk. */
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Naik dari arah tepi tempatnya muncul, lalu keluar ke arah yang sama. */
@starting-style {
    .toast {
        opacity: 0;
        transform: translateY(1.2rem) scale(0.96);
    }
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(0.4rem) scale(0.98);
    transition-duration: 0.3s;
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
}

.toast-icon svg {
    width: 17px;
    height: 17px;
}

.toast-body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.toast-message {
    margin: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.toast-close {
    flex: none;
    appearance: none;
    border: 0;
    background: none;
    padding: 0 0.15rem;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
}

.toast-close:hover {
    color: var(--text);
}

.toast--success .toast-icon { background: rgba(49, 183, 128, 0.16); color: #1c8f60; }
.toast--error   .toast-icon { background: rgba(224, 82, 99, 0.16);  color: #c23a4e; }
.toast--warning .toast-icon { background: rgba(217, 168, 40, 0.18); color: #9a7410; }
.toast--info    .toast-icon { background: var(--primary-soft);      color: var(--primary-dark); }

.toast--success { border-left: 4px solid var(--success); }
.toast--error   { border-left: 4px solid var(--danger); }
.toast--warning { border-left: 4px solid var(--warning); }
.toast--info    { border-left: 4px solid var(--primary); }

/* Garis ikon digambar saat toast muncul. Elemennya baru dibuat setiap kali,
   jadi keyframes tepat di sini — tidak ada keadaan awal untuk ditransisikan. */
@keyframes toast-draw {
    from { stroke-dashoffset: 26; }
    to   { stroke-dashoffset: 0; }
}

.toast-draw {
    stroke-dasharray: 26;
    animation: toast-draw 0.42s cubic-bezier(0.23, 1, 0.32, 1) 0.1s both;
}

.toast-draw--2 {
    animation-delay: 0.22s;
}

@media (max-width: 640px) {
    .toast-stack {
        right: 0.8rem;
        left: 0.8rem;
        bottom: 0.8rem;
        width: auto;
    }
}

/* Gerak dikurangi: toast tetap muncul dan tetap memudar, tanpa geseran. */
@media (prefers-reduced-motion: reduce) {
    @starting-style {
        .toast {
            transform: none;
        }
    }

    .toast.is-leaving {
        transform: none;
    }

    .toast-draw {
        animation: none;
        stroke-dasharray: none;
    }
}

.alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1.1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    font-size: 0.93rem;
}

.alert p {
    margin-top: 0.15rem;
    color: var(--muted);
}

.alert--success { border-left: 4px solid var(--success); }
.alert--danger  { border-left: 4px solid var(--danger); }
.alert--warning { border-left: 4px solid var(--warning); }
.alert--info    { border-left: 4px solid var(--primary); }
.alert--warning .icon { color: var(--warning); }

/* ------------------------------------------------------------------ auth & installer */

.auth-body {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-shell {
    width: 100%;
    max-width: 430px;
}

.auth-shell--wide {
    max-width: 720px;
}

.auth-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.auth-head {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 1.6rem;
}

.auth-head h1 {
    font-size: 1.4rem;
}

.auth-head .muted {
    font-size: 0.92rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-weight: 800;
    /* Singkatan tiga huruf, jadi ukurannya diturunkan agar tetap muat. */
    font-size: 0.84rem;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(57, 136, 255, 0.35);
}

.auth-foot {
    margin-top: 1.4rem;
    text-align: center;
    font-size: 0.9rem;
}

.requirements {
    margin-bottom: 1.6rem;
}

.requirements h2 {
    font-size: 0.98rem;
    margin-bottom: 0.7rem;
}

.req-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.req-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.req-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}

.req-item.is-ok .req-icon { background: var(--success); }
.req-item.is-fail .req-icon { background: var(--danger); }
.req-state { font-size: 0.8rem; color: var(--muted); }
.req-item.is-fail .req-state { color: var(--danger); }

/* ------------------------------------------------------------------ forms */

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-section {
    font-size: 0.95rem;
    margin-top: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.field {
    display: grid;
    gap: 0.35rem;
    position: relative;
}

.field + .field {
    margin-top: 1rem;
}

.field label {
    font-size: 0.88rem;
    font-weight: 600;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field--narrow {
    max-width: 140px;
}

.req {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-size: 0.94rem;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(57, 136, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(57, 136, 255, 0.14);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

/* ------------------------------------------------------------------ tanggal */

/* Sebelumnya input[type="date"] sama sekali tidak ikut aturan di atas, sehingga
   tampil sebagai kontrol bawaan browser di tengah formulir yang sudah bergaya. */
input[type="date"],
input[type="datetime-local"] {
    cursor: pointer;
}

/* Ikon kalender bawaan dipertahankan — posisinya selalu pas — tetapi diberi
   area klik yang jelas beserta keadaan hover. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    padding: 0.32rem;
    margin-right: -0.3rem;
    margin-left: 0.3rem;
    border-radius: 9px;
    opacity: 0.5;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    background: var(--primary-soft);
    opacity: 1;
}

input[type="date"]:focus::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* Bagian tanggal yang sedang disunting ditandai, bukan disorot biru polos. */
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-day-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-month-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field:focus {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 5px;
    outline: none;
}

/* ------------------------------------------------------------------ berkas */

/* Garis putus-putus membedakan kolom unggahan dari kolom isian biasa. */
input[type="file"] {
    padding: 0.45rem 0.5rem;
    border-style: dashed;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: rgba(57, 136, 255, 0.55);
    background: rgba(57, 136, 255, 0.05);
}

input[type="file"]::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

input[type="file"]:hover::file-selector-button {
    background: var(--primary);
    color: #fff;
}

.field-hint {
    font-size: 0.82rem;
    color: var(--muted);
}

.field-error {
    font-size: 0.82rem;
    color: var(--danger);
    font-weight: 600;
}

/* ------------------------------------------------------------------ shell */

.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.4rem;
    min-height: 100vh;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    height: calc(100vh - 2.8rem);
    padding: 1.4rem 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-text {
    display: grid;
    min-width: 0;
}

/* Nama aplikasi kini panjang, jadi dibiarkan turun sampai dua baris. Dipotong
   satu baris hanya menyisakan beberapa kata pertama dan tidak berguna. */
.brand-text strong {
    font-size: 0.93rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.brand-text span {
    font-size: 0.8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    display: grid;
    gap: 0.3rem;
    flex: 1;
    align-content: start;

    /* Item flex tidak boleh menyusut di bawah tinggi isinya selama min-height
       masih auto. Tanpa baris ini daftar menu yang panjang melewati tinggi
       sidebar dan mendorong profil serta tombol Keluar keluar layar. */
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;

    /* Ruang untuk scrollbar, ditarik kembali agar menu tetap selebar sidebar. */
    padding-right: 0.3rem;
    margin-right: -0.3rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(23, 38, 60, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(23, 38, 60, 0.16);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(23, 38, 60, 0.3);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.9rem;
    border-radius: 14px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
}

.nav-link.is-active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(57, 136, 255, 0.28);
}

.nav-link.is-active .icon--trail {
    opacity: 0.8;
}

/* ------------------------------------------------------------------ grup menu */

.nav-group {
    display: grid;
    gap: 0.3rem;
}

.nav-group-toggle {
    width: 100%;
    appearance: none;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}

.nav-group-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-group-count {
    flex: none;
    min-width: 21px;
    height: 21px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 21px;
    text-align: center;
}

.nav-group-caret {
    flex: none;
    transition: transform 0.2s var(--ease-out);
}

.nav-group.is-open .nav-group-caret {
    transform: rotate(180deg);
}

/* Accordion lewat grid-template-rows: menganimasikan tinggi tanpa perlu
   mengukurnya di JS, dan tetap berhenti tepat di tinggi isi sebenarnya. */
.nav-group-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s var(--ease-out);
}

.nav-group.is-open .nav-group-panel {
    grid-template-rows: 1fr;
}

.nav-group-items {
    overflow: hidden;
    display: grid;
    gap: 0.2rem;
    position: relative;
    padding-left: 1.55rem;
}

/* Garis penuntun yang menandai kedalaman grup. */
.nav-group-items::before {
    content: "";
    position: absolute;
    left: 1.12rem;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 2px;
    border-radius: 999px;
    background: var(--line);
}

.nav-link--child {
    gap: 0.6rem;
    padding: 0.56rem 0.85rem;
    font-size: 0.88rem;
}

.nav-child-dot {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.nav-link--child:hover .nav-child-dot,
.nav-link--child.is-active .nav-child-dot {
    opacity: 1;
}

.sidebar-foot {
    display: grid;
    gap: 0.7rem;
    flex: none;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
}

.user-meta {
    display: grid;
    min-width: 0;
}

.user-meta strong {
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta span {
    font-size: 0.78rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-scrim {
    display: none;
}

.admin-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 1.32rem;
}

.topbar-title p {
    font-size: 0.88rem;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(49, 183, 128, 0.18);
}

.drawer-toggle {
    display: none;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-bottom: 0.5rem;
}

.page-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.4rem 0.6rem 0.8rem;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ------------------------------------------------------------------ cards */

.card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem;
}

.card-title {
    font-size: 1.02rem;
    margin-bottom: 1rem;
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-head .card-title {
    margin-bottom: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}

.stat-card {
    display: grid;
    gap: 0.25rem;
    align-content: start;
    padding: 1.25rem;
}

.stat-icon {
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

.stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat-value--text {
    font-size: 1.45rem;
}

.stat-foot {
    font-size: 0.8rem;
    color: var(--muted);
}

.stat-card--accent {
    background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 16px 34px rgba(57, 136, 255, 0.32);
}

.stat-card--accent .stat-label,
.stat-card--accent .stat-foot {
    color: rgba(255, 255, 255, 0.85);
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.quick-link:hover {
    transform: translateY(-2px);
    border-color: rgba(57, 136, 255, 0.4);
    box-shadow: var(--shadow-sm);
}

.quick-link .icon {
    color: var(--primary-dark);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 0.9rem;
    padding: 2.6rem 1rem;
    text-align: center;
    color: var(--muted);
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
    overflow-x: auto;
    margin: 0 -0.35rem;
    padding: 0 0.35rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 0 0.75rem 0.7rem;
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 0.75rem;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.55);
}

.cell-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.cell-title-text {
    display: grid;
    min-width: 0;
}

.cell-title-text strong {
    font-weight: 600;
}

.cell-title-text .muted {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 22ch;
}

.cell-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.schedule-cell {
    display: grid;
    font-size: 0.82rem;
    white-space: nowrap;
}

.type-badge {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.type-badge--image { background: rgba(49, 183, 128, 0.14); color: #23805a; }
.type-badge--pdf   { background: rgba(224, 82, 99, 0.14); color: #b23c4c; }

.thumb {
    display: block;
    width: 52px;
    height: 40px;
    flex: none;
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb--lg {
    width: 96px;
    height: 72px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge--live      { background: rgba(49, 183, 128, 0.15); color: #1f7a54; }
.badge--scheduled { background: rgba(57, 136, 255, 0.15); color: var(--primary-dark); }
.badge--expired   { background: rgba(217, 168, 40, 0.18); color: #8d6a0f; }
.badge--inactive  { background: rgba(113, 130, 153, 0.16); color: #566577; }

/* ------------------------------------------------------------------ filters */

.filter-bar {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.field--search {
    flex: 1 1 240px;
    min-width: 200px;
}

.field--search input {
    padding-left: 2.5rem;
}

.field-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
}

.field--inline {
    flex: 0 1 180px;
}

.field--inline label {
    font-size: 0.8rem;
    color: var(--muted);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* ------------------------------------------------------------------ content form */

.content-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.form-col {
    display: grid;
    gap: 1.2rem;
    min-width: 0;
}

.type-picker,
.mode-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.type-option,
.mode-option {
    position: relative;
    cursor: pointer;
}

.type-option input,
.mode-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-option-body,
.mode-option-body {
    display: block;
    height: 100%;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.type-option-body {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.type-option input:checked + .type-option-body,
.mode-option input:checked + .mode-option-body {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(57, 136, 255, 0.14);
}

.type-option input:focus-visible + .type-option-body,
.mode-option input:focus-visible + .mode-option-body {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

.type-option-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.type-option-text {
    display: grid;
    gap: 0.15rem;
    font-size: 0.85rem;
}

.type-option-text strong {
    font-size: 0.94rem;
}

.type-option-text span {
    color: var(--muted);
}

.mode-option-body strong {
    display: block;
    margin: 0.7rem 0 0.2rem;
    font-size: 0.96rem;
}

.mode-option-body > span:last-child {
    font-size: 0.84rem;
    color: var(--muted);
}

.mode-preview {
    display: grid;
    gap: 4px;
    height: 58px;
    padding: 6px;
    border-radius: 10px;
    background: linear-gradient(140deg, #e7f0fb, #d6e5f6);
}

.mode-preview span {
    background: rgba(57, 136, 255, 0.55);
    border-radius: 5px;
}

.mode-preview--stack {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.4rem;
}

.switch-row > span:first-child {
    display: grid;
    gap: 0.1rem;
    font-size: 0.88rem;
}

.switch-row .muted {
    font-size: 0.8rem;
}

.switch {
    position: relative;
    display: inline-flex;
    flex: none;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    width: 50px;
    height: 28px;
    border-radius: 999px;
    background: rgba(113, 130, 153, 0.3);
    position: relative;
    transition: background 0.18s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(23, 38, 60, 0.25);
    transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
    background: var(--success);
}

.switch input:checked + .switch-track::after {
    transform: translateX(22px);
}

.switch input:focus-visible + .switch-track {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

.current-file {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    margin-bottom: 0.6rem;
}

.current-file-meta {
    display: grid;
    gap: 0.15rem;
    font-size: 0.85rem;
    min-width: 0;
}

.current-file-meta a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    text-decoration: none;
}

.current-file-meta a:hover {
    text-decoration: underline;
}

.current-file-meta .muted {
    font-size: 0.8rem;
}

.form-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-lg);
    background: rgba(247, 251, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.info-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-list span {
    color: var(--muted);
}

/* ------------------------------------------------------------------ modal */

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 60;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 38, 60, 0.42);
    backdrop-filter: blur(3px);
}

.modal-card {
    position: relative;
    width: min(440px, 100%);
    padding: 1.6rem;
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    box-shadow: var(--shadow-lg);
}

.modal-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.modal-card p {
    color: var(--muted);
    font-size: 0.92rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.4rem;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
    .form-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .admin-shell {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        width: min(300px, 86vw);
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        transform: translateX(-104%);
        transition: transform 0.24s ease;
        z-index: 50;
    }

    .admin-shell.drawer-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(23, 38, 60, 0.4);
        z-index: 45;
    }

    .sidebar-scrim[hidden] {
        display: none;
    }

    .drawer-toggle {
        display: inline-flex;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 14.5px;
    }

    .topbar {
        padding: 0.9rem 1rem;
        flex-wrap: wrap;
    }

    .topbar-title h1 {
        font-size: 1.15rem;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .card {
        padding: 1.1rem;
        border-radius: var(--radius);
    }

    .auth-card {
        padding: 1.4rem;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .field--narrow {
        max-width: none;
    }

    .table-wrap {
        overflow: visible;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.72);
        padding: 0.35rem 0.85rem;
        margin-bottom: 0.7rem;
    }

    .data-table td {
        border-top: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.5rem 0;
        border-bottom: 1px dashed var(--line);
        text-align: right;
    }

    .data-table td:last-child {
        border-bottom: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        font-size: 0.74rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
        font-weight: 700;
        text-align: left;
        flex: none;
    }

    .cell-title {
        text-align: left;
    }

    .cell-title-text .muted {
        max-width: 16ch;
    }

    .schedule-cell {
        text-align: right;
    }

    .form-bar {
        flex-direction: column-reverse;
    }

    .form-bar .btn {
        width: 100%;
    }
}

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

/* ------------------------------------------------------------------ V2 reporting */

.field--tiny {
    flex: 0 1 120px;
    max-width: 140px;
}

.division-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.division-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 4px solid var(--primary);
}

.division-card--environment   { border-top-color: #16a394; }
.division-card--process_me    { border-top-color: #3988ff; }
.division-card--mechanical    { border-top-color: #e8590c; }
.division-card--admin_finance { border-top-color: #c2255c; }
.division-card--ga_adm        { border-top-color: #6c5ce7; }

.division-card-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.division-card-head h2 {
    font-size: 1.02rem;
}

.division-card-head p {
    font-size: 0.84rem;
}

.division-chip {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.6rem;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.division-card--environment .division-chip { background: rgba(22, 163, 148, 0.14); color: #0f7c70; }
.division-card--mechanical .division-chip { background: rgba(232, 89, 12, 0.14); color: #b8460a; }
.division-card--admin_finance .division-chip { background: rgba(194, 37, 92, 0.14); color: #a21d4c; }
.division-card--ga_adm .division-chip { background: rgba(108, 92, 231, 0.14); color: #5245c4; }

.division-progress {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.division-stats,
.report-stat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
    flex: 1;
    font-size: 0.86rem;
}

.division-stats li,
.report-stat-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
}

.division-stats span,
.report-stat-list span {
    color: var(--muted);
}

.division-meta {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.6;
}

.division-empty {
    padding: 1.2rem 0;
    text-align: center;
    font-size: 0.9rem;
}

.division-actions,
.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.division-actions .btn,
.report-actions .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

/* Progress ring dipakai dashboard admin dan editor report. */

.progress-ring {
    --value: 0;
    position: relative;
    width: 84px;
    height: 84px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring-color, var(--primary)) calc(var(--value) * 1%), rgba(57, 136, 255, 0.15) 0);
}

.progress-ring::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--surface-solid);
}

.progress-ring span {
    position: relative;
    z-index: 1;
    font-weight: 800;
    font-size: 1.02rem;
}

.progress-ring--lg {
    width: 108px;
    height: 108px;
}

.progress-ring--lg span {
    font-size: 1.3rem;
}

.progress-ring--attention { --ring-color: #e05263; }
.progress-ring--warn      { --ring-color: #d9a828; }
.progress-ring--good      { --ring-color: #3988ff; }
.progress-ring--complete  { --ring-color: #31b780; }

.progress-pill {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(57, 136, 255, 0.14);
    color: var(--primary-dark);
}

.progress-pill--attention { background: rgba(224, 82, 99, 0.15); color: #b23c4c; }
.progress-pill--warn      { background: rgba(217, 168, 40, 0.2); color: #8d6a0f; }
.progress-pill--complete  { background: rgba(49, 183, 128, 0.16); color: #1f7a54; }

.progress-input {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.progress-input .field {
    flex: 1;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

/* Detail report */

.report-summary-head {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 1.1rem;
}

.report-meta {
    flex: 1;
    min-width: 220px;
    display: grid;
    gap: 0.35rem;
    justify-items: start;
}

.report-meta h2 {
    font-size: 1.15rem;
}

.report-meta-list {
    margin: 0.5rem 0 0;
    display: grid;
    gap: 0.3rem;
    font-size: 0.85rem;
    width: 100%;
}

.report-meta-list > div {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.report-meta-list dt {
    color: var(--muted);
    min-width: 12rem;
}

.report-meta-list dd {
    margin: 0;
    font-weight: 600;
}

.report-stat-list {
    flex: 0 1 240px;
}

.report-exec {
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
    margin-bottom: 1.1rem;
}

.report-exec h3 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.report-exec p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Editor item */

.item-group .card-head {
    align-items: flex-start;
}

.item-group .card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tv-counter {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(57, 136, 255, 0.1);
    white-space: nowrap;
}

.tv-counter.is-over {
    background: rgba(224, 82, 99, 0.16);
    color: #b23c4c;
}

.item-rows {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.item-row {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.68);
    padding: 0.85rem;
}

.item-row-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.item-handle {
    color: var(--muted);
    margin-top: 0.55rem;
    flex: none;
}

.item-title-field {
    flex: 1;
    min-width: 0;
}

.item-row-tools {
    display: flex;
    gap: 0.3rem;
    flex: none;
}

.item-row-tools .icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.item-row-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-left: 1.9rem;
    align-items: flex-end;
}

.item-desc-field {
    flex: 1 1 100%;
}

.item-row-body .field {
    margin-top: 0;
}

.item-row-body .field label {
    font-size: 0.76rem;
    color: var(--muted);
}

/* Item Progress kini punya dua kotak uraian — Uraian Pekerjaan dan Tindak
   Lanjut — sehingga labelnya perlu lebih tegas agar tidak tertukar. */
.item-row-body .field label.item-field-label {
    font-weight: 700;
    color: var(--text);
}

/* Label di kiri, tombol poin di kanan, tepat di atas kotak uraiannya. */
.item-field-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-height: 1.5rem;
}

.list-tools {
    display: inline-flex;
    gap: 0.2rem;
}

.list-tool {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.list-tool .icon {
    width: 15px;
    height: 15px;
}

.list-tool:hover {
    background: var(--primary-soft);
    border-color: rgba(57, 136, 255, 0.28);
    color: var(--primary-dark);
}

.list-tool:focus-visible {
    outline: 2px solid rgba(57, 136, 255, 0.55);
    outline-offset: 1px;
}

/* ------------------------------------------------------------------ item diringkas */

.item-row-actions {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 100%;
    padding-top: 0.2rem;
}

.btn--sm {
    padding: 0.42rem 0.9rem;
    font-size: 0.85rem;
}

/* Judul item saat diringkas: sebuah tombol selebar sisa baris, sehingga
   mengklik judulnya membuka kembali formulir rinciannya. */
.item-collapsed-title {
    flex: 1;
    min-width: 0;
    appearance: none;
    border: 0;
    background: none;
    padding: 0.5rem 0.2rem;
    font: inherit;
    font-weight: 600;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 8px;
}

.item-collapsed-title:hover {
    color: var(--primary-dark);
}

.item-collapsed-title:empty::before {
    content: "(tanpa judul)";
    color: var(--muted);
}

.item-row.is-collapsed .item-row-body,
.item-row.is-collapsed .item-title-field {
    display: none;
}

/* Baris yang diringkas dibuat lebih rapat agar daftar item mudah dipindai. */
.item-row.is-collapsed {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.icon-btn--accent {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.client-save-row {
    display: grid;
    gap: 0.4rem;
    justify-items: start;
    margin-top: 0.9rem;
}

.client-save-row .btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

/* Tombol berbentuk tautan untuk aksi sekunder di dalam teks bantuan. */
.btn-link {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--primary);
}

.item-tv-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
    position: relative;
}

.item-tv-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.item-tv-toggle .switch-track {
    width: 42px;
    height: 24px;
}

.item-tv-toggle .switch-track::after {
    width: 18px;
    height: 18px;
}

.item-tv-toggle input:checked + .switch-track {
    background: var(--success);
}

.item-tv-toggle input:checked + .switch-track::after {
    transform: translateX(18px);
}

.item-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
    padding: 0.8rem 0;
}

/* Pemilih minggu dalam bulan */

.week-picker {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.week-option {
    position: relative;
}

.week-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.week-option span {
    display: block;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.week-option input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.week-option input:focus-visible + span {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

/* Revision timeline */

.revision-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.revision-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.68);
}

.revision-version {
    display: grid;
    place-items: center;
    min-width: 46px;
    height: 32px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.82rem;
    flex: none;
}

.revision-body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.revision-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.revision-note {
    font-size: 0.86rem;
    line-height: 1.5;
}

.revision-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.revision-detail {
    border-left: 4px solid var(--primary);
}

@media (max-width: 720px) {
    .report-summary-head,
    .division-progress {
        flex-direction: column;
        align-items: stretch;
    }

    .item-row-body {
        padding-left: 0;
    }

    .item-tv-toggle {
        margin-left: 0;
    }

    .revision-entry {
        flex-direction: column;
    }
}

/* ------------------------------------------------------------------ V2.2: menu bagian

   Setiap bagian reporting punya halamannya sendiri dengan tiga tab: daftar
   report, pengaturan tampilan TV, dan history pembaruan. */

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.tab-link {
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.tab-link:hover {
    background: rgba(57, 136, 255, 0.08);
    color: var(--text);
}

.tab-link.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(57, 136, 255, 0.3);
}

.tab-link:focus-visible {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

.stat-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.division-counts {
    list-style: none;
    margin: 0 0 0.2rem;
    padding: 0.7rem 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.division-counts li {
    display: grid;
    gap: 0.1rem;
}

.division-counts span {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.division-counts strong {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ---- tombol switch tayang pada daftar report */

.switch-btn {
    appearance: none;
    border: 0;
    background: none;
    font: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--muted);
}

.switch-btn .switch-track {
    width: 40px;
    height: 22px;
    flex: none;
}

.switch-btn .switch-track::after {
    width: 16px;
    height: 16px;
    top: 3px;
    left: 3px;
}

.switch-btn.is-on .switch-track {
    background: var(--success);
}

.switch-btn.is-on .switch-track::after {
    transform: translateX(18px);
}

.switch-btn.is-on {
    color: var(--text);
}

.switch-text {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.switch-btn:focus-visible {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 3px;
    border-radius: 999px;
}

/* ---- panel pengaturan tampilan TV */

.tv-settings-table input[type="number"],
.tv-settings-table input[type="datetime-local"] {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm, 10px);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    width: 100%;
    max-width: 200px;
}

.tv-settings-table .input-tiny {
    max-width: 92px;
}

.tv-settings-form .field-hint {
    margin: 0.9rem 0 0;
}

.form-bar--inline {
    position: static;
    margin-top: 1rem;
    justify-content: space-between;
}

/* ---- pagination daftar report */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pager-state {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

/* ------------------------------------------------------------------ V2.3: tag client

   Tag selalu menampilkan teksnya; warna hanya penanda tambahan. Nilai warna
   sudah divalidasi sebagai HEX enam digit sebelum sampai ke atribut style. */

.client-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-tag--internal {
    background: rgba(113, 130, 153, 0.16);
    color: #566577;
}

.client-tag--lg {
    padding: 0.4rem 0.95rem;
    font-size: 0.95rem;
}

.client-tag-name {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.76rem;
}

.report-tag-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
}

/* ---- pemilih jenis report */

.scope-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.scope-option {
    position: relative;
    cursor: pointer;
}

.scope-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.scope-option span {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.scope-option input:checked + span {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(57, 136, 255, 0.28);
}

.scope-option input:focus-visible + span {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

/* ---- selector client */

.client-zone {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.client-select {
    position: relative;
}

.client-results {
    position: absolute;
    z-index: 5;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    max-height: 15rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.client-result button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.client-result button:hover,
.client-result button:focus-visible {
    background: rgba(57, 136, 255, 0.08);
}

.client-result--empty {
    padding: 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.client-chosen {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.6rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.link-btn {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

.client-quick-add {
    margin-top: 0.9rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(57, 136, 255, 0.05);
    border: 1px dashed rgba(57, 136, 255, 0.3);
}

/* ---- pemilih warna */

.color-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input input[type="color"] {
    width: 3rem;
    height: 2.6rem;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}

.color-input input[type="text"] {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
}

.tag-preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: repeating-conic-gradient(rgba(113, 130, 153, 0.08) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    border: 1px solid var(--line);
}

.color-palette {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line);
    cursor: pointer;
    padding: 0;
}

.color-swatch:focus-visible {
    outline: 3px solid rgba(57, 136, 255, 0.45);
    outline-offset: 2px;
}

.field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
}

/* ==========================================================================
   V2.6 — Matriks akses, Action Status, dan Special View
   ========================================================================== */

/* ------------------------------------------------ chip penyaring */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 160ms var(--ease-out), color 160ms var(--ease-out),
                border-color 160ms var(--ease-out);
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ------------------------------------------------ matriks akses */

.division-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.4rem;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.access-col {
    width: 1%;
    text-align: center;
    white-space: nowrap;
}

/* Pemisah tipis antar bagian agar pasangan Report/Special terbaca berkelompok. */
.access-col--divider {
    border-right: 1px solid var(--line);
}

.access-col .switch {
    justify-content: center;
    margin: 0 auto;
}

.access-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.access-all input {
    width: 0.85rem;
    height: 0.85rem;
    accent-color: var(--primary);
}

.access-matrix-user {
    min-width: 13rem;
    text-align: left;
}

.access-matrix-division {
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.data-table tbody tr.is-muted {
    opacity: 0.55;
}

/* ------------------------------------------------ Action Status */

.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.action-item {
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

/* Yang belum dikonfirmasi ditandai agar terlihat lebih dahulu. */
.action-item.is-pending {
    border-left-color: var(--warning);
    background: var(--bg-2);
}

.action-item-head {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.action-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 14rem;
    min-width: 0;
    font-size: 0.86rem;
}

.action-item-meta .muted {
    font-size: 0.78rem;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.action-badge--danger  { background: #fee2e2; color: #991b1b; }
.action-badge--warning { background: #fef3c7; color: #92400e; }
.action-badge--info    { background: var(--primary-soft); color: var(--primary-dark); }
.action-badge--success { background: #dcfce7; color: #166534; }
.action-badge--muted   { background: var(--bg-2); color: var(--muted); }

.action-badge--pending {
    background: transparent;
    border: 1px dashed var(--line);
    color: var(--muted);
}

.action-note {
    margin: 0 0 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text);
    overflow-wrap: anywhere;
}

.action-item.is-pending .action-note {
    background: var(--surface);
}

.action-response {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--line);
}

.action-respond {
    margin-top: 0.7rem;
}

.action-respond > summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--primary);
    list-style: none;
}

.action-respond > summary::-webkit-details-marker { display: none; }

.action-respond > summary::before {
    content: "+ ";
    font-weight: 700;
}

.action-respond[open] > summary::before { content: "\2212 "; }

.action-respond-form {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.7rem;
    grid-template-columns: minmax(10rem, 14rem) 1fr auto;
    align-items: end;
}

.action-respond-form .field { margin: 0; }

.action-list--compact .action-item {
    padding: 0.8rem 0.9rem;
}

/* ------------------------------------------------ Special View */

.sv-hero-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}

.sv-hero-head .cell-title-text { flex: 1 1 16rem; min-width: 0; }

.sv-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sv-stats {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.sv-stat {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.sv-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sv-stat-label {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.sv-summary {
    margin: 1.1rem 0 0;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text);
}

.sv-bar {
    position: relative;
    height: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

.sv-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.sv-bar-fill--low      { background: #ef4444; }
.sv-bar-fill--mid      { background: #f59e0b; }
.sv-bar-fill--high     { background: var(--primary); }
.sv-bar-fill--complete { background: var(--success); }

.sv-columns {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    align-items: start;
}

.sv-col {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-width: 0;
}

.sv-items {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sv-item {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.sv-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.7rem;
}

.sv-item-percent {
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
}

.sv-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.sv-item-text {
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.sv-tag,
.sv-status {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.sv-tag {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
}

.sv-tag--overdue {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.sv-status { background: var(--bg-2); color: var(--muted); }
.sv-status--on_track    { background: #dcfce7; color: #166534; }
.sv-status--at_risk     { background: #fef3c7; color: #92400e; }
.sv-status--blocked     { background: #fee2e2; color: #991b1b; }
.sv-status--completed   { background: var(--primary-soft); color: var(--primary-dark); }
.sv-status--done        { background: #dcfce7; color: #166534; }
.sv-status--not_started { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.sv-status--in_progress { background: var(--primary-soft); color: var(--primary-dark); }

.sv-detail { margin-top: 0.7rem; }

.sv-detail > summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    list-style: none;
}

.sv-detail > summary::-webkit-details-marker { display: none; }
.sv-detail > summary::before { content: "+ "; font-weight: 700; }
.sv-detail[open] > summary::before { content: "\2212 "; }

.sv-detail-block {
    margin-top: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.sv-detail-block--work { border-left-color: var(--primary); }
.sv-detail-block--next { border-left-color: var(--warning); }

.sv-detail-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.sv-detail-block p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.sv-action-form .field { margin-bottom: 0.8rem; }

/* ------------------------------------------------ layar sempit */

@media (max-width: 1100px) {
    .sv-columns { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .action-respond-form { grid-template-columns: 1fr; }
    .sv-hero-head { flex-direction: column; align-items: flex-start; }
    .sv-hero-actions { width: 100%; }
}

/* ==========================================================================
   V2.7 — Notifikasi WhatsApp
   ========================================================================== */

.wa-number {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.wa-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin: 1.1rem 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.wa-tool-form {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    flex: 1 1 18rem;
}

.wa-tool-form .field {
    flex: 1 1 auto;
    margin: 0;
}

.wa-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .wa-tool-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Kolom izin yang melekat pada role, bukan pilihan — mis. Special View Manager. */
.access-locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    cursor: help;
}

.access-locked .icon {
    width: 1rem;
    height: 1rem;
}

/* ==========================================================================
   V2.8 — Lampiran item report (panel admin)
   ========================================================================== */

.item-attachments {
    margin: 0.9rem 0;
    padding: 0.85rem 0.95rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.item-attachments.is-uploading {
    opacity: 0.75;
    pointer-events: none;
}

.item-attachments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.item-attachments-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}

.item-attachments-title .icon {
    width: 1rem;
    height: 1rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0 0 0.6rem;
    padding: 0;
    list-style: none;
}

.attachment-list:empty {
    margin-bottom: 0;
}

.attachment-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

/* Penanda jenis berkas; warnanya membedakan yang dapat dipratinjau dan tidak. */
.attachment-kind {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--muted);
}

.attachment-kind--image  { background: #10b981; }
.attachment-kind--pdf    { background: #ef4444; }
.attachment-kind--office { background: #2563eb; }

.attachment-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.attachment-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.attachment-size {
    flex: 0 0 auto;
    font-size: 0.74rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.icon-btn--sm {
    width: 1.8rem;
    height: 1.8rem;
}

.icon-btn--sm .icon {
    width: 0.95rem;
    height: 0.95rem;
}

.attachment-add {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Input berkas disembunyikan; labelnya yang berperan sebagai tombol. */
.attachment-pick {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.attachment-pick input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.attachment-hint {
    flex: 1 1 14rem;
    font-size: 0.74rem;
    line-height: 1.4;
}

.item-attachments [data-attachment-error] {
    margin: 0.5rem 0 0;
}

/* Daftar kesalahan per item di dalam banner peringatan formulir report. */
.alert-list {
    margin: 0.45rem 0 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.2rem;
    font-size: 0.86rem;
    line-height: 1.45;
}

/* ------------------------------------------------ halaman Backup (V2.9) */

.backup-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    margin-bottom: 1.2rem;
}

.backup-grid .card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* Tombol backup selalu menempel di dasar kartu agar kedua kartu sejajar. */
.backup-grid form {
    margin-top: auto;
    padding-top: 0.6rem;
}

.backup-sample {
    margin: 0.5rem 0;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    overflow-x: auto;
}

.backup-sample code {
    font-size: 0.78rem;
    white-space: nowrap;
}
