/* ================================================================
   SIGMA - UI Components
   File 4 of 5: Reusable component library.
   Each component: base + variants + states (hover/focus/active/disabled).
   Depends on: sigma-tokens.css, sigma-base.css
   ================================================================ */

/* ================================================================
   Buttons
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font);
    font-size: var(--text-base);
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--radius-btn, 8px);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--t-base);
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    height: 2.375rem;
    /* height: 2.5rem; */
    padding: 0 1rem;
}
.btn .ti {
    font-size: 1rem;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.btn:disabled,
.btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

@media (max-width: 520px) { 
    .btn { 
        height: 1.85rem;
        padding: 0 0.6rem;
        font-size: var(--text-sm);
        gap: 0.25rem;
    }
    .btn .ti {
        font-size: 0.85rem;
    }
    .btn svg {
        width: 0.85rem;
        height: 0.85rem;
    }
}

/* Primary */
.btn--primary {
    background: var(--accent);
    color: var(--on-accent);
    border-color: transparent;
}
.btn--primary:hover {
    background: var(--accent-hover);
}

/* Secondary */
.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn--secondary:hover {
    background: var(--surface-sunken);
    border-color: var(--accent);
    color: var(--accent);
}

/* Ghost - visible border + subtle bg, biar jelas itu tombol (bukan plain text) */
.btn--ghost {
    background: var(--surface-raised);
    color: var(--text-muted);
    border-color: var(--border);
}
.btn--ghost:hover {
    background: var(--surface-sunken);
    color: var(--text);
    border-color: var(--text-muted);
}
.btn--ghost:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    color: var(--accent);
}

/* Ghost danger - subtle destructive (transparent, danger text/border) */
.btn--ghost-danger {
    background: transparent;
    color: var(--danger-text);
    border-color: var(--danger-border);
}
.btn--ghost-danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger-text);
    color: var(--danger-text);
}
.btn--ghost-danger:focus-visible {
    outline: none;
    border-color: var(--danger-text);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

/* Danger */
.btn--danger {
    background: var(--danger-text);
    color: #fff;
    border-color: transparent;
}
.btn--danger:hover {
    filter: brightness(0.88);
}

/* Success */
.btn--success {
    background: var(--success-text);
    color: #fff;
    border-color: transparent;
}
.btn--success:hover {
    filter: brightness(0.88);
}

/* Accent ghost */
.btn--accent-ghost {
    background: var(--accent-light);
    color: var(--accent);
    border-color: transparent;
}
.btn--accent-ghost:hover {
    background: var(--accent);
    color: var(--on-accent);
}

/* Link style */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-link:hover { opacity: 0.8; }

/* Sizes */
.btn--xs {
    height: 1.75rem;
    padding: 0 0.55rem;
    font-size: 0.75rem;
    gap: 0.25rem;
    border-radius: var(--radius-sm);
}
.btn--sm {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: var(--text-sm);
    gap: 0.35rem;
    border-radius: var(--radius-btn, 10px);
}
.btn--lg {
    height: 2.875rem;
    padding: 0 var(--sp-6);
    font-size: var(--text-md);
    gap: 0.55rem;
    border-radius: var(--radius-btn, 10px);
}
.btn--xl {
    height: 3.375rem;
    padding: 0 var(--sp-8);
    font-size: var(--text-md);
    gap: 0.6rem;
    border-radius: var(--radius-btn, 10px);
}

/* Icon-only square */
.btn--icon {
    width: 2.375rem;
    padding: 0;
    border-radius: var(--radius-md);
}
.btn--icon.btn--xs { width: 1.75rem; padding: 0; }
.btn--icon.btn--sm { width: 2rem; }
.btn--icon.btn--lg { width: 2.875rem; }

/* Loading state */
.btn.is-loading { pointer-events: none; }
.btn__spinner {
    display: none;
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: s-spin 0.6s linear infinite;
    flex-shrink: 0;
}
.btn--secondary .btn__spinner,
.btn--ghost .btn__spinner     { border-color: var(--border); border-top-color: currentColor; }
.btn.is-loading .btn__spinner { display: block; }

/* Navbar search - border-radius override (defined in sigma-layout.css) */
.navbar-search { border-radius: var(--radius-input, 10px); }

/* Button group */
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.btn-group .btn + .btn      { margin-left: -1px; }

/* Reset filter pill */
.btn--reset {
    display: none;
    align-items: center;
    gap: 0.3rem;
    height: 2.1rem;
    padding: 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: filter var(--t-fast);
    line-height: 1;
}
.btn--reset.is-visible { display: inline-flex; }
.btn--reset:hover { filter: brightness(0.92); }
.btn--reset svg { width: 0.78rem; height: 0.78rem; flex-shrink: 0; }

/* Advanced filter active state */
.btn--adv-active {
    background: var(--accent-light) !important;
    color: var(--accent) !important;
    border-color: var(--accent-ring) !important;
}

/* ================================================================
   Cards
   ================================================================ */
.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.card--hover {
    cursor: pointer;
}
.card--hover:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.card--loading { opacity: 0.6; pointer-events: none; }

.card__header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.card__title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
}
.card__subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 2px;
}
.card__body { padding: var(--sp-5); }
.card__footer {
    padding: 0.9rem var(--sp-5);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
    background: var(--surface-sunken);
}

/* ── Variant: card dengan tabs di header (title kiri, tabs kanan) ── */
.card__header--with-tabs {
    align-items: center;
    gap: var(--sp-3) var(--sp-5);
    flex-wrap: wrap;
}
.card__header-meta {
    min-width: 0;
    flex: 1 1 auto;
}
.card__header--with-tabs .tabs {
    margin-bottom: 0;
    flex: 0 0 auto;
}
.card__header-meta .card__title {
    font-family: var(--font-d);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.card__header-meta .card__subtitle { margin-top: 0.2rem; }

/* Panel slot inside .card - host untuk konten per-tab. No extra padding;
   konten (tabel/list) menempel langsung ke edge card. */
.card__panel { padding: 0; }
.card__panel[hidden] { display: none; }

/* Variant: card yang membungkus tabs + panel (utk pattern Riwayat Aktivitas) */
.card--with-tabs > .card__panel:last-child .table-wrap--flush {
    border-bottom-left-radius:  inherit;
    border-bottom-right-radius: inherit;
}

/* Top-border accent variants */
.card--accent-top   { border-top: 3px solid var(--accent); }
.card--success-top  { border-top: 3px solid var(--success-text); }
.card--warning-top  { border-top: 3px solid var(--warning-text); }
.card--danger-top   { border-top: 3px solid var(--danger-text); }

/* Panel (no overflow hidden) */
.s-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ================================================================
   Badges / Tags
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
}
.badge svg { width: 0.65rem; height: 0.65rem; flex-shrink: 0; }

.badge--neutral { background: var(--surface-sunken);  color: var(--text-muted);   border-color: var(--border); }
.badge--primary { background: var(--accent-light);     color: var(--accent);       border-color: var(--accent-ring); }
.badge--accent  { background: var(--accent-light);     color: var(--accent);       border-color: var(--accent-ring); }
.badge--success { background: var(--success-bg);       color: var(--success-text); border-color: var(--success-border); }
.badge--warning { background: var(--warning-bg);       color: var(--warning-text); border-color: var(--warning-border); }
.badge--danger  { background: var(--danger-bg);        color: var(--danger-text);  border-color: var(--danger-border); }
.badge--info    { background: var(--info-bg);          color: var(--info-text);    border-color: var(--info-border); }
.badge--teal    { background: var(--teal-bg);          color: var(--teal);         border-color: var(--teal-border); }

.badge--lg {
    padding: 0.25rem 0.75rem;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}
/* Badge ikon-saja — status yang cukup diwakili simbol, keterangan lewat tooltip.
   Wajib punya aria-label/tooltip karena tidak ada teks yang bisa dibaca. */
.badge--icon {
    padding: 0;
    gap: 0;
    background: none;
    border-color: transparent;
}
.badge--icon .ti {
    font-size: 0.95rem;
    line-height: 1;
}

/* Sel status yang memuat lebih dari satu badge (mis. Aktif + ikon terkunci). */
.status-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
/* Dot prefix */
.badge--dot::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}
.badge--success.badge--dot::before { box-shadow: 0 0 5px var(--success-text); }
/* Live pulse */
.badge--live::before {
    animation: badge-pulse 2s ease-in-out infinite;
}

/* Small tags (non-uppercase, slightly different shape) */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    white-space: nowrap;
}
.tag--success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.tag--warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }
.tag--danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger-border); }
.tag--info    { background: var(--info-bg);    color: var(--info-text);    border-color: var(--info-border); }

/* ================================================================
   Alerts / Banners - distinctive with left strip + icon disc
   ================================================================ */
.alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem 0.9rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.55;
    border: 1px solid;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

/* Left accent strip - 4px solid tinta tone untuk anchor visual */
.alert::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.85;
}

/* Icon dalam disc tinted - bukan icon mengambang */
.alert > svg,
.alert .alert__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, currentColor 14%, transparent);
    margin-left: 0.25rem;  /* space dari strip kiri */
}
.alert > svg svg,
.alert .alert__icon svg {
    width: 100%;
    height: 100%;
}

.alert__content { flex: 1; min-width: 0; padding-top: 0.1rem; }
.alert__title {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.2rem;
    letter-spacing: -0.005em;
}
.alert__msg { color: var(--text); opacity: 0.92; }
.alert__close {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.55;
    border-radius: var(--radius-sm);
    transition: opacity var(--t-fast), background var(--t-fast);
    color: inherit;
    padding: 0;
}
.alert__close:hover  { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.alert__close svg    { width: 0.875rem; height: 0.875rem; }

.alert--info    { background: var(--info-bg);    color: var(--info-text);    border-color: var(--info-border); }
.alert--success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.alert--warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }
.alert--error,
.alert--danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger-border); }
.alert[hidden]  { display: none; }

/* ================================================================
   Form fields
   ================================================================ */
.field {
    margin-bottom: var(--sp-4);
}
.field:last-child { margin-bottom: 0; }

.field__label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;            /* naik dari 0.6875 → 0.78 */
    font-weight: 700;
    letter-spacing: 0.025em;       /* turun dari 0.055 supaya tidak terlalu wide */
    text-transform: none;          /* lepas uppercase - lebih readable */
    color: var(--text);            /* dari --text-muted → --text (tegas) */
    line-height: 1.3;
}
.field__label .required,
.field__required { color: var(--danger-text); margin-left: 0.2em; font-weight: 700; }
.field__optional {
    margin-left: 0.3em; font-size: var(--text-xs); font-weight: 500;
    color: var(--text-faint); text-transform: none; letter-spacing: 0;
}

.field__hint {
    margin-top: 0.45rem;
    font-size: 0.8rem;             /* naik dari 0.78 */
    color: var(--text-muted);      /* dari --text-faint → --text-muted (lebih kebaca) */
    line-height: 1.5;
}
/* Optional inline info icon - auto-add via ::before kalau hint tidak punya icon */
.field__hint::before {
    content: "";
    flex-shrink: 0;
    width: 0.95rem;
    height: 0.95rem;
    margin-top: 0.15rem;
    background-color: currentColor;
    opacity: 0.6;
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'><circle cx='12' cy='12' r='9'/><path d='M12 8h.01M12 12v4'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'><circle cx='12' cy='12' r='9'/><path d='M12 8h.01M12 12v4'/></svg>");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}
.field__hint code {
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text);
}
/* Hint dalam keadaan gagal, mis. data master tidak dapat dimuat. Beda dengan
   .field__error: ini bukan galat validasi input, jadi selalu tampil (tidak
   bergantung .has-error) dan dipakai untuk pesan + tombol "Coba lagi". */
.field__hint--error { color: var(--danger-text); font-weight: 600; }

.field__error {
    display: none;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger-text);
}
.field.has-error .field__error { display: block; }
.field__control { position: relative; }

/* Base input - border tegas 1.5px + bg slightly tinted untuk feel "field" */
.field__input,
.field__textarea,
.field__select {
    display: block;
    width: 100%;
    font-family: var(--font);
    font-size: 0.85rem;            /* sedikit lebih besar dari base (0.875) */
    font-weight: 500;
    color: var(--text);
    background: var(--surface-raised);   /* solid white di light, lebih terang dari surface */
    border: 1.5px solid var(--border-strong);   /* lebih tegas - dari --border → --border-strong */
    border-radius: var(--radius-input, 10px);
    transition:
        border-color var(--t-base),
        box-shadow var(--t-base),
        background var(--t-fast);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.field__input,
.field__select {
    height: 2.5rem;
    padding: 0 1rem;
}
.field__textarea {
    padding: 0.75rem 1rem;
    min-height: 7rem;
    resize: vertical;
    line-height: 1.6;
}
.field__input::placeholder,
.field__textarea::placeholder {
    color: var(--text-faint);
    font-weight: 400;
    opacity: 0.9;
}
.field__input:hover,
.field__textarea:hover,
.field__select:hover {
    border-color: var(--accent);
    background: var(--surface-raised);
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);   /* dari 2px → 3px */
    outline: none;
    background: var(--surface-raised);
}
/* Disabled state - clearly disabled */
.field__input:disabled,
.field__textarea:disabled,
.field__select:disabled {
    background: var(--surface-sunken);
    border-color: var(--border);
    color: var(--text-faint);
    cursor: not-allowed;
    opacity: 0.7;
}
.field.has-error .field__input,
.field.has-error .field__textarea,
.field.has-error .field__select {
    border-color: var(--danger-border);
    box-shadow: 0 0 0 3px rgba(248,81,73,0.16);
}
.field__input:disabled,
.field__textarea:disabled,
.field__select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--surface-sunken);
}

/* Select arrow */
.field__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Input with icon prefix/suffix */
.field__control--prefix .field__input { padding-left: 2.5rem; }
.field__control--suffix .field__input { padding-right: 2.5rem; }
.field__icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-faint);
    pointer-events: none;
}
.field__icon--prefix { left: 0.8rem; }
.field__icon--suffix { right: 0.8rem; }

/* Password visibility toggle */
.field__toggle {
    position: absolute;
    top: 0; right: 0;
    height: 100%; width: 2.8rem;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent;
    color: var(--text-faint); cursor: pointer;
    transition: color var(--t-base);
    padding: 0;
}
.field__toggle:hover { color: var(--accent); }
.field__toggle svg { width: 1.05rem; height: 1.05rem; }
.field__toggle .icon-off { display: none; }
.field__toggle.is-visible .icon-on  { display: none; }
.field__toggle.is-visible .icon-off { display: block; }
.field--has-toggle .field__input { padding-right: 2.8rem; }

/* Checkbox & Radio */
.field__check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}
/* ── Custom Checkbox & Radio - theme-aware, appearance-none ──────
   Berlaku global untuk semua input[type="checkbox"] dan
   input[type="radio"] di seluruh aplikasi.
   ────────────────────────────────────────────────────────────── */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-strong);
    background: var(--bg1);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    vertical-align: middle;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
input[type="checkbox"] { border-radius: 3px; }
input[type="radio"]    { border-radius: 50%; }

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

/* Checkmark tick */
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 8px; height: 5px;
    border: 2px solid #fff;
    border-top: none; border-right: none;
    transform: rotate(-45deg);
}
/* Radio dot */
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #fff;
    border-radius: 50%;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
input[type="checkbox"]:hover:not(:checked):not(:disabled),
input[type="radio"]:hover:not(:checked):not(:disabled) {
    border-color: var(--accent);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Inline wrapper: label + checkbox/radio + text */
.check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.check-label:hover { color: var(--text); }
.check-label input  { margin-top: 0; }

/* ── .field__check (wrapper used in form fields) ─────────────── */
.field__check input[type="checkbox"],
.field__check input[type="radio"] {
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.field__check-label { font-size: var(--text-base); color: var(--text); line-height: 1.5; }
.field__check-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Checkbox / radio group - vertical stack of .field__check */
.field__checkbox-group,
.field__radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.25rem 0;
}

/* Checkbox label variant */
.field__label--checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

/* Switch / Toggle */
.field__switch {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
}
.field__switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    position: relative;
    width: 2.5rem;
    height: 1.4rem;
    background: var(--border-strong);
    border-radius: var(--radius-full);
    transition: background var(--t-base);
    flex-shrink: 0;
}
.switch-track::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 1rem; height: 1rem;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--t-base), box-shadow var(--t-base);
    box-shadow: var(--shadow-xs);
}
.field__switch input:checked ~ .switch-track             { background: var(--accent); }
.field__switch input:checked ~ .switch-track::after       { transform: translateX(1.1rem); }
.field__switch input:focus-visible ~ .switch-track         { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch-label { font-size: var(--text-base); color: var(--text); }

/* Field row (two-column grid) */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* Inline checkbox - alias dari .check-label untuk backward compatibility */
.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.check-inline:hover { color: var(--text); }

/* ================================================================
   Table
   ================================================================ */
.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
/* Flush variant - hilangkan border/radius/bg sendiri. Dipakai saat
   table-wrap ditempatkan di dalam parent yang sudah punya bingkai
   (misalnya .card / .card__panel) agar tabel menempel ke edge parent. */
.table-wrap--flush {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.table-container {
    overflow: auto;
    max-height: calc(100vh - 19rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    position: relative;
}
.table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
    color: var(--text);
}
.table thead,
.data-table thead { background: rgba(0,0,0,0.18); }
[data-theme="light"] .table thead,
[data-theme="light"] .data-table thead { background: rgba(0,0,0,0.04); }

.table th,
.data-table th {
    padding: 0.65rem var(--sp-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table td,
.data-table td {
    padding: 0.75rem var(--sp-4);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.5;
}
.table tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: none; }
.table tbody tr,
.data-table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover td,
.data-table tbody tr:hover td { background: rgba(255,255,255,0.025); }
[data-theme="light"] .table tbody tr:hover td,
[data-theme="light"] .data-table tbody tr:hover td { background: rgba(0,0,0,0.025); }
/* Left-border accent on hover */
.table--striped tbody tr:nth-child(even) td { background: var(--surface-sunken); }
.table--compact th, .table--compact td { padding: 0.45rem 0.75rem; }
.data-table--striped tbody tr:nth-child(even) td { background: var(--surface-sunken); }

/* Sticky header */
.table-container .table thead th,
.table-container .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-sunken);
    box-shadow: 0 1px 0 var(--border);
}

/* Sort controls */
.table .col-sort { cursor: pointer; user-select: none; }
.table .col-sort:hover { color: var(--text); }
.table .col-sort::after          { content: " ↕"; opacity: 0.35; font-size: 0.7em; }
.table .col-sort.sort-asc::after  { content: " ↑"; opacity: 0.8; }
.table .col-sort.sort-desc::after { content: " ↓"; opacity: 0.8; }

/* Column freeze */
.col-frozen {
    position: sticky;
    background: inherit;
    z-index: 1;
}
.table-container .table thead .col-frozen,
.table-container .data-table thead .col-frozen {
    z-index: 3;
    background: var(--surface-sunken);
}
.col-freeze-last::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 6px;
    background: linear-gradient(to right, rgba(0,0,0,0.07), transparent);
    pointer-events: none;
}

/* Pin button in column header */
.th-inner { display: flex; align-items: center; gap: 0.3rem; }
.col-pin-btn {
    opacity: 0;
    background: none; border: none; cursor: pointer;
    padding: 0.1rem; border-radius: 3px;
    color: var(--text-faint);
    display: flex; align-items: center;
    transition: opacity var(--t-fast), color var(--t-fast), background var(--t-fast);
    flex-shrink: 0; margin-left: auto;
}
.col-pin-btn svg { width: 0.7rem; height: 0.7rem; }
th:hover .col-pin-btn, .col-pin-btn.is-pinned { opacity: 1; }
.col-pin-btn.is-pinned { color: var(--accent); }
.col-pin-btn:hover { background: var(--border); color: var(--text); }

/* Sticky col support */
.table--sticky-col td:first-child,
.table--sticky-col th:first-child {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
    box-shadow: 1px 0 0 var(--border);
}

.table__empty {
    padding: 3rem var(--sp-8);
    text-align: center;
    color: var(--text-muted);
}
.table__empty svg { width: 2.5rem; height: 2.5rem; color: var(--border-strong); margin: 0 auto 0.75rem; display: block; }

/* Skeleton table rows */
.skel-row td { padding: 0.75rem 0.65rem; }
.skel-row .skeleton--text { display: block; height: 0.75rem; }

/* ================================================================
   View toggle - segmented pill control (reusable)
   ----------------------------------------------------------------
   Reusable di mana saja dibutuhkan toggle antar mode tampilan
   (table/grid/list/map/timeline, dll). Gunakan data-view sebagai
   identifier mode di JS.

   HTML pattern:
   <div class="view-toggle" role="group" aria-label="Mode tampilan">
     <button class="view-toggle__btn is-active" data-view="table"
             type="button" aria-pressed="true" title="Tabel">
       <svg class="view-toggle__icon">...</svg>
       <span class="view-toggle__label">Tabel</span>
     </button>
     <button class="view-toggle__btn" data-view="grid"
             type="button" aria-pressed="false" title="Kartu">
       <svg class="view-toggle__icon">...</svg>
       <span class="view-toggle__label">Kartu</span>
     </button>
   </div>

   Modifier:
   - .view-toggle--sm    : compact 1.85rem height
   - .view-toggle--icon  : icon-only (label disembunyikan)
   ================================================================ */
.view-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    height: 2.2rem;
    flex-shrink: 0;
    transition: border-color var(--t-fast);
}
.view-toggle:hover { border-color: var(--accent-ring); }
.view-toggle:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.view-toggle__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 100%;
    width: 2rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-faint);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
}
.view-toggle__btn .ti {
    font-size: 1rem;
}
.view-toggle__btn:hover { color: var(--text); }
.view-toggle__btn:focus-visible { outline: none; }
.view-toggle__btn.is-active {
    background: var(--accent);
    color: var(--on-accent, #fff);
}
.view-toggle__icon { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }
.view-toggle__label { font-weight: 600; }

/* Size: compact */
.view-toggle--sm { height: 1.85rem; padding: 0.18rem; }
.view-toggle--sm .view-toggle__btn { padding: 0 0.55rem; font-size: 0.72rem; }
.view-toggle--sm .view-toggle__icon { width: 0.85rem; height: 0.85rem; }

/* Icon-only - label disembunyikan tapi tetap ada untuk a11y */
.view-toggle--icon .view-toggle__label,
.view-toggle--icon-mobile .view-toggle__label { display: none; }
.view-toggle--icon .view-toggle__btn,
.view-toggle--icon-mobile .view-toggle__btn { padding: 0; min-width: 2rem; }

/* Responsive: di layar kecil sembunyikan label saja, tetap pakai icon */
@media (max-width: 768px) {
    .view-toggle__label { display: none; }
    .view-toggle__btn   { padding: 0; min-width: 2rem; }
}

/* ================================================================
   Modal / Dialog
   ================================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    animation: s-fade-in 0.18s ease both;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop.is-closing { animation: s-fade-out 0.2s ease forwards; }

.modal {
    position: relative;
    background: var(--surface-raised);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 32rem;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    animation: modal-in var(--t-spring) both;
}
.modal-backdrop.is-closing .modal { animation: modal-out 0.2s ease forwards; }
.modal--sm   { max-width: 22rem; }
.modal--lg   { max-width: 46rem; }
.modal--xl   { max-width: 60rem; }
.modal--full { max-width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); }

.modal__header {
    padding: var(--sp-5) var(--sp-6) var(--sp-4);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal__title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
    margin: 0;
    line-height: 1.3;
}
.modal__subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.modal__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid transparent;
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--t-base), background var(--t-base), border-color var(--t-base);
    padding: 0;
}
.modal__close:hover { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.modal__close svg   { width: 0.9rem; height: 0.9rem; }
/* form as direct child of .modal (wraps body+footer) must
   participate in the flex layout so .modal__body can scroll */
.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.modal__body {
    padding: var(--sp-5) var(--sp-6);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}
.modal__footer {
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
    flex-shrink: 0;
    background: var(--surface-sunken);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal__footer--start   { justify-content: flex-start; }
.modal__footer--between { justify-content: space-between; }

/* ================================================================
   Modal hero - standard .modal__header dengan gradient + icon strip
   ----------------------------------------------------------------
   Pakai pattern visual "panduan-modal hero" tapi dengan class modal
   standar (.modal, .modal__header, .modal__body, .modal__footer).

   HTML pattern:
   <div class="modal modal--hero modal--hero-warning modal--md">
     <div class="modal__header">
       <div class="modal__header-icon">
         <svg>…</svg>
       </div>
       <div>
         <h2 class="modal__title">Reset Password</h2>
         <p class="modal__subtitle">…</p>
       </div>
       <button type="button" class="modal__close"><svg>…</svg></button>
     </div>
     <div class="modal__body">…</div>
     <div class="modal__footer modal__footer--between">
       <button class="btn-link">Batal</button>
       <button class="btn btn--danger">Konfirmasi</button>
     </div>
   </div>

   Variants (tinta header strip):
   - .modal--hero          → accent (default, hijau)
   - .modal--hero-info     → biru
   - .modal--hero-teal     → teal
   - .modal--hero-warning  → amber
   - .modal--hero-danger   → merah
   ================================================================ */
.modal--hero { --mh-tint: var(--accent); }
.modal--hero-info    { --mh-tint: var(--info-text); }
.modal--hero-teal    { --mh-tint: var(--teal); }
.modal--hero-warning { --mh-tint: var(--warning-text); }
.modal--hero-danger  { --mh-tint: var(--danger-text); }

.modal--hero .modal__header {
    position: relative;
    padding: 1.45rem 1.6rem;
    gap: var(--sp-4);
    align-items: center;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--mh-tint) 32%, transparent),
            color-mix(in srgb, var(--mh-tint) 10%, transparent) 70%,
            transparent);
    overflow: hidden;
}
.modal--hero .modal__header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right,
        color-mix(in srgb, var(--mh-tint) 18%, transparent),
        transparent 60%);
    pointer-events: none;
}
.modal--hero .modal__header > * { position: relative; }

.modal__header-icon {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.modal__header-icon svg { width: 1.4rem; height: 1.4rem; }

.modal--hero .modal__title {
    font-family: var(--font-d);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.modal--hero .modal__subtitle {
    font-size: 0.85rem;
    margin-top: 0.3rem;
    line-height: 1.45;
}

.modal--hero .modal__close {
    width: 2.25rem;
    height: 2.25rem;
    background: var(--surface-sunken);
    border-color: var(--border);
}
.modal--hero .modal__close svg { width: 1rem; height: 1rem; }

.modal--hero .modal__footer {
    background: var(--surface-sunken);
}
.modal--hero .modal__footer .btn-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Body padding consistent with hero header */
.modal--hero .modal__body {
    padding: 1.4rem 1.6rem;
}

@media (max-width: 640px) {
    .modal--hero .modal__header { padding: 1.1rem 1.25rem; gap: var(--sp-3); }
    .modal__header-icon { width: 2.75rem; height: 2.75rem; }
    .modal__header-icon svg { width: 1.15rem; height: 1.15rem; }
    .modal--hero .modal__title { font-size: 1.1rem; }
    .modal--hero .modal__body { padding: 1.1rem 1.25rem; }
}

/* ================================================================
   Dropdown menu
   ================================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown__menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    min-width: 10rem;
    padding: 0.35rem 0.25rem;
    background: var(--bg-1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top left;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.dropdown__menu--right {
    left: auto;
    right: 0;
    transform-origin: top right;
}
.dropdown__menu--up {
    top: auto;
    bottom: calc(100% + 6px);
    transform: translateY(6px) scale(0.97);
    transform-origin: bottom left;
}
.dropdown.is-open > .dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    text-align: left;
    font-family: var(--font);
    white-space: nowrap;
}
.dropdown__item i {font-size: 0.9rem;}
.dropdown__item:hover { background: var(--surface-sunken); }
.dropdown__item.is-active { background: var(--accent-light); color: var(--accent); }
.dropdown__item--danger:hover { background: var(--danger-bg); color: var(--danger-text); }
.dropdown__item svg { width: 0.9rem; height: 0.9rem; flex-shrink: 0; color: var(--text-muted); }
.dropdown__item:hover svg, .dropdown__item.is-active svg { color: inherit; }
.dropdown__divider  { height: 1px; background: var(--border); margin: 0.35rem 0; }
.dropdown__header {
    padding: 0.4rem 0.75rem 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}
/* Fluid dropdown: fixed width di desktop */
.dropdown--fluid { width: 22rem; }

@media (max-width: 640px) {
    .dropdown__menu { min-width: 10rem; }
    /* Notif & export: fixed ke viewport agar tidak overflow kiri/kanan */
    .dropdown--fluid {
        position: fixed;
        top: 56px;           /* --navbar-h */
        left: var(--sp-3);
        right: var(--sp-3);
        width: auto;
        max-height: calc(100dvh - 56px - var(--sp-4));
        overflow-y: auto;
        overscroll-behavior: contain;
        /* reset transform-origin agar animasi dari atas */
        transform-origin: top center;
    }
}
/* Notif list: max-height scroll agar tak meluber layar */
.dropdown--notifications .notif-list {
    max-height: min(22rem, 60dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ── Notification dropdown ── */
.notif-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4) var(--sp-2);
    border-bottom: 1px solid var(--border);
}
.notif-header__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.notif-header__badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
    font-family: var(--font-mono);
}
.notif-header__action {
    background: transparent;
    border: none;
    font-size: 0.72rem;
    color: var(--text-faint);
    cursor: pointer;
    font-family: var(--font);
    padding: 0;
    transition: color var(--t-fast);
}
.notif-header__action:hover { color: var(--accent); }

.notif-list { 
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--sp-1) var(--sp-2); 
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--t-fast);
    /* reset untuk <button> */
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font: inherit;
    color: inherit;
}
.notif-loading { display: flex; flex-direction: column; gap: .5rem; padding: var(--sp-3); }
.notif-item:hover { background: var(--surface-sunken); }
.notif-item--unread { background: var(--accent-light); }
.notif-item--unread:hover { background: rgba(34,217,124,0.18); }
[data-theme="light"] .notif-item--unread { background: var(--accent-light); }

.notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.notif-item__dot--info    { background: var(--accent-ring); }
.notif-item__dot--success { background: var(--success-text); }
.notif-item__dot--warning { background: var(--warning-text); }
.notif-item__dot--danger  { background: var(--danger-text); }

/* Notif bell dropdown - icon + meta redesign */
.notif-item__ico {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .85rem;
}
.notif-item__meta {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .7rem;
    color: var(--text-faint);
    margin-top: .1rem;
    flex-wrap: nowrap;
    overflow: hidden;
}
.notif-item__cat {
    font-weight: 500;
    color: var(--text-muted);
}
.notif-item__sep { opacity: .5; }
.notif-item__unread-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}

.notif-item__body { flex: 1; min-width: 0; }
.notif-item__title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    /* allow wrapping to 2 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.notif-item__desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item__time {
    font-size: 0.68rem;
    color: var(--text-faint);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-8) var(--sp-4);
    color: var(--text-faint);
    font-size: 0.82rem;
}
.notif-empty svg { width: 2rem; height: 2rem; opacity: 0.4; }

.notif-footer {
    padding: var(--sp-2) var(--sp-4) var(--sp-3);
    border-top: 1px solid var(--border);
    text-align: center;
}
.notif-footer__link {
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--t-fast);
}
.notif-footer__link:hover { opacity: 0.8; }

@media (max-width: 600px) { 
    .notif-item__title { font-size: .75rem; }
    .notif-item__meta { font-size: .65rem; }
}
/* ── Profile card dropdown ── */
.profile-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.profile-card__avatar {
    flex-shrink: 0;
}
.profile-card__info { flex: 1; min-width: 0; }
.profile-card__name {
    font-size: 0.855rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.profile-card__role {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 1px;
    line-height: 1.3;
}
.profile-card__email {
    font-size: 0.68rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    font-family: var(--font-mono);
}

/* ================================================================
   Tabs
   ================================================================ */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem var(--sp-4);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--t-base), border-color var(--t-base);
    font-family: var(--font);
    user-select: none;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab svg { width: 0.9rem; height: 0.9rem; flex-shrink: 0; }
.tab .badge { font-size: 0.65rem; }

.tab-panels { padding-top: var(--sp-5); }
.tab-panel  { display: none; }
.tab-panel.is-active { display: block; animation: s-fade-in 0.2s ease; }

/* Pill tabs */
.tabs--pills {
    border-bottom: none;
    gap: 0.25rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    width: fit-content;
}
.tabs--pills .tab {
    border-bottom: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    margin-bottom: 0;
}
.tabs--pills .tab.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* Inline tabs - compact pill style cocok untuk diletakkan di samping
   section title. Lebih rapat dari .tabs--pills, font lebih kecil. */
.tabs--inline {
    border-bottom: none;
    gap: 0.2rem;
    padding: 0.25rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: fit-content;
    flex-wrap: wrap;
    overflow: visible;
}
.tabs--inline .tab {
    border-bottom: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    margin-bottom: 0;
    font-size: 0.8rem;
}
.tabs--inline .tab:hover:not(.is-active) {
    color: var(--text);
    background: var(--surface);
}
.tabs--inline .tab.is-active {
    background: var(--accent-light);
    color: var(--accent);
}
.tabs--inline .tab svg,
.tabs--inline .tab i { width: 0.85rem; height: 0.85rem; }

/* Tab nav (detail page variant) */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 0;
    margin-bottom: var(--sp-6);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem var(--sp-4);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--t-base), border-color var(--t-base);
    border-radius: 0;
    font-family: var(--font);
}
.tab-nav__item svg { width: 0.8rem; height: 0.8rem; flex-shrink: 0; }
.tab-nav__item:hover { color: var(--text); }
.tab-nav__item--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-nav__badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 0.05rem 0.42rem;
    min-width: 1.2em;
    text-align: center;
}
.tab-pane { display: none; }
.tab-pane--active { display: block; }

/* ================================================================
   Pagination
   ================================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.pagination__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 0.55rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    user-select: none;
}
.pagination__link:hover { background: var(--surface-sunken); color: var(--text); border-color: var(--border); }
.pagination__link.is-active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-ring);
    font-weight: 700;
}
.pagination__link.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.pagination__ellipsis {
    display: flex; align-items: center; justify-content: center;
    min-width: 2.2rem; height: 2.2rem;
    font-size: 0.84rem; color: var(--text-faint); user-select: none;
}

/* ────────────────────────────────────────────────────────────────
   Pagination bar - reusable composite di bawah list/tabel
   Struktur 3 area: info range (kiri) | nav halaman (tengah) | page-size (kanan)
   Wrap responsive di layar sempit.

   HTML pattern (di-render oleh JS list module):
   <div class="pagination-bar">
     <div class="pagination-bar__info">Menampilkan 1–20 dari 2.000 data</div>
     <nav class="pagination-bar__nav">
       <button class="pagination-bar__btn">«</button>
       <button class="pagination-bar__btn is-active">1</button>
       …
     </nav>
     <div class="pagination-bar__size">
       <label class="pagination-bar__size-label">Per halaman</label>
       <select class="pagination-bar__size-select">…</select>
     </div>
   </div>
   ──────────────────────────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3) var(--sp-5);
    margin-top: var(--sp-4);
    padding: var(--sp-3) 0 0;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    font-family: var(--font);
}
/* Bar yang diisi via JS - saat kosong (mis. tanpa data / lazy view) jangan
   tampilkan border-top & margin yang menggantung. */
.pagination-bar:empty { display: none; }

.pagination-bar__info {
    flex: 0 0 auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    min-width: 0;
}
.pagination-bar__info strong {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pagination-bar__muted { color: var(--text-faint); font-style: italic; }

/* Nav - center segment */
.pagination-bar__nav {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    flex-wrap: wrap;
}
.pagination-bar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    background: var(--accent-light);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    user-select: none;
}
.pagination-bar__btn:hover {
    background: var(--accent);
    color: var(--text);
    border-color: var(--border);
}
.pagination-bar__btn:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.pagination-bar__btn.is-active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-ring);
    font-weight: 700;
}
.pagination-bar__btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}
.pagination-bar__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 2rem;
    color: var(--text-faint);
    font-size: 0.85rem;
    user-select: none;
}

/* Size selector - right segment */
.pagination-bar__size {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.pagination-bar__size-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.pagination-bar__size-select {
    height: 2rem;
    padding: 0 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    font-variant-numeric: tabular-nums;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.pagination-bar__size-select:hover { border-color: var(--border-strong); }
.pagination-bar__size-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Responsive - mobile: stack vertikal */
@media (max-width: 640px) {
    .pagination-bar { flex-direction: column; align-items: stretch; }
    .pagination-bar__info { text-align: center; }
    .pagination-bar__nav { justify-content: center; }
    .pagination-bar__size { justify-content: center; }
}

/* ================================================================
   Skeleton / Loading placeholders
   ================================================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-sunken) 25%,
        var(--border) 50%,
        var(--surface-sunken) 75%
    );
    background-size: 400% 100%;
    animation: s-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton--text   { height: 0.875rem; width: 100%; border-radius: var(--radius-full); }
.skeleton--block  { height: 8rem; border-radius: var(--radius-md); }
.skeleton--short  { width: 60%; }
.skeleton--circle { border-radius: 50%; aspect-ratio: 1; }
.skeleton--avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.skeleton--rect   { height: 8rem; border-radius: var(--radius-md); }

/* ================================================================
   Avatar
   ================================================================ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-xs);
}
.avatar img   { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm   { width: 1.75rem; height: 1.75rem; font-size: 0.68rem; }
.avatar--md   { width: 2.25rem; height: 2.25rem; }
.avatar--lg   { width: 3rem;    height: 3rem;    font-size: 1rem; }
.avatar--xl   { width: 4rem;    height: 4rem;    font-size: 1.25rem; }
.avatar-group { display: flex; flex-direction: row-reverse; }
.avatar-group .avatar { margin-left: -0.6rem; }
.avatar-group .avatar:last-child { margin-left: 0; }

/* ================================================================
   Spinner
   ================================================================ */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: s-spin 0.6s linear infinite;
    flex-shrink: 0;
}
.spinner--sm { width: 0.9rem;  height: 0.9rem; }
.spinner--lg { width: 2rem;    height: 2rem;   border-width: 3px; }

/* ================================================================
   Progress bar
   ================================================================ */
.progress {
    height: 0.5rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress--sm { height: 0.35rem; }
.progress--lg { height: 0.75rem; }
.progress__bar {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
    min-width: 0;
}
.progress--success .progress__bar { background: var(--success-text); }
.progress--warning .progress__bar { background: var(--warning-text); }
.progress--danger  .progress__bar { background: var(--danger-text); }
.progress--info    .progress__bar { background: var(--info-text); }
.progress--striped .progress__bar {
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.15) 25%, transparent 25%,
        transparent 50%, rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.15) 75%, transparent 75%, transparent
    );
    background-size: 1rem 1rem;
    animation: s-progress-stripe 0.6s linear infinite;
}

/* ================================================================
   Timeline
   ================================================================ */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 0.6875rem;
    top: 1.5rem;
    bottom: 1rem;
    width: 2px;
    background: var(--border);
}
.timeline__item {
    display: flex;
    gap: var(--sp-4);
    padding-bottom: var(--sp-5);
    position: relative;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    background: var(--border-strong);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border);
    margin-top: 0.1rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeline__dot svg { width: 0.65rem; height: 0.65rem; color: var(--surface); }
.timeline__dot--accent  { background: var(--accent);       box-shadow: 0 0 0 2px var(--accent-ring); }
.timeline__dot--success { background: var(--success-text); }
.timeline__dot--warning { background: var(--warning-text); }
.timeline__dot--danger  { background: var(--danger-text); }
.timeline__dot--info    { background: var(--info-text); }
.timeline__content,
.timeline__body { flex: 1; min-width: 0; }
.timeline__title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.15rem;
    line-height: 1.4;
}
.timeline__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.timeline__desc {
    margin-top: 0.35rem;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ================================================================
   Toast notifications
   ================================================================ */
#sigma-toast-stack,
.toast-stack {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    z-index: var(--z-toast);
    pointer-events: none;
    width: min(15rem, calc(100vw - 2rem));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem var(--sp-4);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    overflow: hidden;
    position: relative;
    animation: toast-in var(--t-spring) both;
}
.toast.is-leaving { animation: toast-out 0.25s ease forwards; }
.toast__icon  { flex-shrink: 0; width: 1rem; height: 1rem; margin-top: 3px; }
.toast__body  { flex: 1; min-width: 0; }
.toast__title { font-size: 0.8rem; font-weight: 700; color: var(--text); margin-bottom: 0.15rem; }
.toast__msg,
.toast__desc  { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }
.toast__close {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    width: 1.25rem; height: 1.25rem;
    margin-left: auto;
    border: none; background: transparent; cursor: pointer;
    color: var(--text-faint); border-radius: var(--radius-xs);
    padding: 0;
    transition: color var(--t-fast), background var(--t-fast);
}
.toast__close:hover { color: var(--text); background: var(--surface-sunken); }
.toast__close svg { width: 0.875rem; height: 0.875rem; }
.toast__progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    transform-origin: left;
    animation: toast-progress linear forwards;
}
.toast--success .toast__icon     { color: var(--success-text); }
.toast--success .toast__progress { background: var(--success-text); }
.toast--error   .toast__icon     { color: var(--danger-text); }
.toast--error   .toast__progress { background: var(--danger-text); }
.toast--warning .toast__icon     { color: var(--warning-text); }
.toast--warning .toast__progress { background: var(--warning-text); }
.toast--info    .toast__icon     { color: var(--info-text); }
.toast--info    .toast__progress { background: var(--info-text); }

/* Helpdesk toast - column layout, footer ujung ke ujung */
.notif-helpdesk-toast {
    flex-direction: column;
    align-items: stretch;   /* child fill full lebar toast */
    padding: 0;
    gap: 0;
}
.notif-toast__top {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem var(--sp-3);
}
.notif-toast__footer {
    border-top: 1px solid var(--border-subtle);
    padding: .4rem var(--sp-3);
}
/* CTA sebagai text link, bukan button */
.toast__link-action {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    color: var(--info-text);
    letter-spacing: .01em;
    line-height: 1.4;
    transition: opacity var(--t-fast);
}
.toast__link-action:hover { opacity: .7; text-decoration: underline; }
.toast__link-action .ti { font-size: .8rem; }

@media (max-width: 640px) {
    #sigma-toast-stack, .toast-stack {
        bottom: var(--sp-4);
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

/* ================================================================
   Breadcrumb
   ================================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
}
.breadcrumb__item,
.breadcrumb__list .breadcrumb__item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
}
.breadcrumb__item::before {
    content: "/";
    margin-right: 0.3rem;
    color: var(--text-faint);
    font-weight: 400;
}
.breadcrumb__item:first-child::before { display: none; }
.breadcrumb__link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t-fast);
}
.breadcrumb__link:hover { color: var(--accent); }
.breadcrumb__item:last-child .breadcrumb__link,
.breadcrumb__item--current {
    color: var(--text);
    font-weight: 600;
    pointer-events: none;
}

/* Standalone breadcrumb nav (not in list form) */
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t-fast);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep     { color: var(--text-faint); font-size: 0.7rem; margin: 0 0.1rem; opacity: 0.6; }
.breadcrumb__current { color: var(--text); font-weight: 500; }

/* ================================================================
   Tooltip
   ================================================================ */
[data-tooltip] { position: relative; }
[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: var(--z-tooltip);
    transform: translateY(4px);
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    white-space: nowrap;
    font-family: var(--font);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    text-align: center;
    padding: 0.38rem 0.65rem;
    background: var(--text);
    color: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
}
[data-tooltip]::after {
    content: "";
    border: 5px solid transparent;
    border-top-color: var(--text);
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus-within::before,
[data-tooltip]:focus-within::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* Tooltip mengambang — dirender di <body> oleh SIGMA.tooltip supaya tidak
   terpotong kontainer ber-overflow. Rupanya sengaja disamakan dengan tooltip
   CSS di atas. */
/* Pemicu bertanda data-tip-float dilayani modul JS. Pseudo-element bawaan
   WAJIB dimatikan, kalau tidak tooltip tampil dua kali (satu terpotong di
   dalam tabel, satu mengambang). */
[data-tooltip][data-tip-float]::before,
[data-tooltip][data-tip-float]::after {
    content: none;
    display: none;
}

.tooltip-float {
    position: fixed;
    z-index: var(--z-tooltip);
    max-width: 15rem;
    padding: 0.35rem 0.55rem;
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    background: var(--text);
    color: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
.tooltip-float--above { transform: translateY(4px); }
.tooltip-float.is-visible { opacity: 1; transform: translateY(0); }

/* Tooltip multi-baris — keterangan panjang yang kalau nowrap akan terpotong
   oleh kontainer ber-overflow (mis. .table-wrap). */
[data-tooltip][data-tip-wrap]::before {
    white-space: normal;
    width: max-content;
    max-width: 15rem;
    font-size: 0.68rem;
    line-height: 1.35;
    padding: 0.35rem 0.55rem;
}

/* Tooltip bottom */
[data-tooltip][data-tip-pos="bottom"]::before {
    top: calc(100% + 7px); bottom: auto;
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip][data-tip-pos="bottom"]::after {
    top: calc(100% + 2px); bottom: auto;
    border-top-color: transparent; border-bottom-color: var(--text);
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip][data-tip-pos="bottom"]:hover::before,
[data-tooltip][data-tip-pos="bottom"]:hover::after,
[data-tooltip][data-tip-pos="bottom"]:focus-within::before,
[data-tooltip][data-tip-pos="bottom"]:focus-within::after {
    transform: translateX(-50%) translateY(0);
}
/* Tooltip right */
[data-tooltip][data-tip-pos="right"]::before {
    left: calc(100% + 7px); right: auto; bottom: 50%;
    transform: translateY(50%) translateX(-4px);
}
[data-tooltip][data-tip-pos="right"]::after {
    left: calc(100% + 2px); right: auto; bottom: 50%;
    border-top-color: transparent; border-right-color: var(--text);
    transform: translateY(50%) translateX(-4px);
}
[data-tooltip][data-tip-pos="right"]:hover::before,
[data-tooltip][data-tip-pos="right"]:hover::after,
[data-tooltip][data-tip-pos="right"]:focus-within::before,
[data-tooltip][data-tip-pos="right"]:focus-within::after {
    transform: translateY(50%) translateX(0);
}

/* ================================================================
   Divider
   ================================================================ */
.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-faint);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: var(--sp-4) 0;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ================================================================
   Key-value row
   ================================================================ */
.s-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-4);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-base);
}
.s-kv:last-child { border-bottom: none; }
.s-kv__key   { color: var(--text-muted); flex-shrink: 0; }
.s-kv__value { color: var(--text); font-weight: 500; text-align: right; }

/* Inline list */
.s-list-inline {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ================================================================
   Lightbox / Image preview
   ================================================================ */
#sigma-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: calc(var(--z-modal) + 50);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    animation: s-fade-in 0.2s ease both;
    cursor: zoom-out;
}
#sigma-lightbox.is-closing { animation: s-fade-out 0.2s ease forwards; }
.lightbox__img {
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    cursor: default;
    animation: modal-in var(--t-spring) both;
}
.lightbox__caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 36rem;
    text-align: center;
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    padding: 0.4rem 1rem;
    background: rgba(0,0,0,0.4);
    border-radius: var(--radius-full);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lightbox__close {
    position: absolute;
    top: var(--sp-4); right: var(--sp-4);
    display: flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: background var(--t-base);
    padding: 0;
}
.lightbox__close:hover { background: rgba(255,255,255,0.2); }
.lightbox__close svg   { width: 1.1rem; height: 1.1rem; }
.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: background var(--t-base);
    padding: 0;
}
.lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.lightbox__nav svg   { width: 1.25rem; height: 1.25rem; }
.lightbox__prev { left: var(--sp-4); }
.lightbox__next { right: var(--sp-4); }
[data-lightbox] { cursor: zoom-in; }
[data-lightbox] img { pointer-events: none; }

/* ================================================================
   Export bell - navbar icon + dropdown feed
   Driven by sigma_export_bell.js. Hidden by default; revealed when
   user has active or recent (≤24h) ExportJob records.
   ================================================================ */
.export-bell[hidden] { display: none !important; }

.export-bell__trigger { position: relative; }
.export-bell__badge {
    background: var(--accent);
    color: var(--on-accent, #fff);
    font-weight: 700;
}

/* Running spinner overlay on the icon */
.export-bell__spinner {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--surface, #fff);
    animation: export-bell-pulse 1.4s ease-in-out infinite;
}
@keyframes export-bell-pulse {
    0%, 100% { transform: scale(1);   opacity: 1;   }
    50%      { transform: scale(1.5); opacity: 0.4; }
}

/* ── Feed dropdown ──────────────────────────────────────────────── */
.export-feed { padding: 0; }
.export-feed__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 1rem 0.55rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-raised);
    border-radius: calc(var(--radius-md) + 3px) calc(var(--radius-md) + 3px) 0 0;
}
.export-feed__header-left {
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.export-feed__header-icon {
    width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-size: 0.85rem; flex-shrink: 0;
}
.export-feed__title {
    font-family: var(--font-b);
    font-size: 0.82rem; font-weight: 700; color: var(--text);
    letter-spacing: -0.01em;
}
.export-feed__count {
    font-size: 0.68rem; color: var(--text-faint);
    font-family: var(--font); font-weight: 500;
}

.export-feed__list { max-height: 22rem; overflow-y: auto; }

.export-feed__empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 2rem 1rem;
    color: var(--text-faint); font-size: 0.82rem;
}
.export-feed__empty[hidden] { display: none !important; }
.export-feed__empty .ti { font-size: 1.8rem; opacity: 0.4; }

/* ── Feed item ──────────────────────────────────────────────────── */
.export-feed__item {
    position: relative;
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0 0.75rem;
    align-items: flex-start;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--t-fast);
}
.export-feed__item:last-child { border-bottom: none; border-radius: 0 0 calc(var(--radius-md) + 3px) calc(var(--radius-md) + 3px)!important; }
.export-feed__item:hover { background: var(--surface-sunken); }

/* gradient fade - reveals the action buttons cleanly */
.export-feed__item::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 9rem;
    background: linear-gradient(to right, transparent, var(--surface-sunken) 55%);
    opacity: 0;
    transition: opacity var(--t-fast);
    pointer-events: none;
}
.export-feed__item:last-child::after { border-radius: 0 0 calc(var(--radius-md) + 3px) 0;}
.export-feed__item:hover::after { opacity: 1; }

.export-feed__icon {
    width: 2rem; height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 0.1rem;
}
.export-feed__item--success .export-feed__icon { background: color-mix(in srgb, var(--teal) 12%, transparent); }
.export-feed__item--failed  .export-feed__icon { background: color-mix(in srgb, var(--danger-text, #ef4444) 10%, transparent); }
.export-feed__item--running .export-feed__icon { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.export-feed__item--pending .export-feed__icon { background: var(--surface-sunken); }

.export-feed__status-ic { font-size: 1.05rem; }
.export-feed__status-ic--success { color: var(--teal); }
.export-feed__status-ic--danger  { color: var(--danger-text, #ef4444); }
.export-feed__status-ic--running { color: var(--accent); }
.export-feed__status-ic--pending { color: var(--text-muted); }
.export-feed__status-ic--muted   { color: var(--text-faint); }

.export-feed__body {
    min-width: 0;
    display: flex; flex-direction: column; gap: 0.2rem;
}
.export-feed__item-title {
    font-size: 0.83rem; font-weight: 600; color: var(--text);
    line-height: 1.3; font-family: var(--font-b);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding-right: 0.5rem;
}
.export-feed__meta {
    font-size: 0.7rem; color: var(--text-muted);
    font-family: var(--font);
    line-height: 1.35;
}
.export-feed__meta .export-feed__sep { margin: 0 0.25rem; opacity: 0.4; }
.export-feed__error {
    font-size: 0.72rem; color: var(--danger-text, #ef4444);
    line-height: 1.4;
}

/* actions - hover-reveal, slide in from right */
.export-feed__actions {
    position: absolute;
    top: 50%; right: 0.75rem;
    transform: translateX(0.5rem) translateY(-50%);
    display: flex; align-items: center; gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
    z-index: 1;
}
.export-feed__item:hover .export-feed__actions {
    opacity: 1;
    transform: translateX(0) translateY(-50%);
    pointer-events: auto;
}

/* uniform button height + size for all variants */
.export-feed__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.28rem;
    height: 1.75rem;
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--text-muted);
    font-size: 0.73rem; font-weight: 500; font-family: var(--font-b);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.export-feed__btn:hover { background: var(--surface); color: var(--text); border-color: var(--border); }
.export-feed__btn--primary {
    background: var(--accent); border-color: transparent; color: #fff;
    font-weight: 600; padding: 0 0.75rem;
}
.export-feed__btn--primary:hover {
    background: color-mix(in srgb, var(--accent-hover) 85%, #000); color: #fff;
}
.export-feed__btn--dismiss {
    padding: 0 0.45rem;
    color: var(--text-faint); border-color: transparent; background: transparent;
}
.export-feed__btn--dismiss:hover { color: var(--text-muted); background: var(--surface-raised); border-color: var(--border); }
.export-feed__btn--danger { color: var(--danger-text, #ef4444); }
.export-feed__btn--danger:hover {
    background: color-mix(in srgb, var(--danger-text, #ef4444) 8%, transparent);
    color: var(--danger-text, #ef4444);
    border-color: color-mix(in srgb, var(--danger-text, #ef4444) 25%, transparent);
}
.export-feed__btn .ti { font-size: 0.82rem; line-height: 1; }

.export-feed__pending {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; color: var(--text-muted); font-style: italic;
}
.export-feed__spin {
    animation: export-feed-spin 1s linear infinite;
    display: inline-block;
}
@keyframes export-feed-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ================================================================
   LEAFLET - Theme-aware control overrides
   Applies to all Leaflet maps in SIGMA (detail modals, WMS maps, etc.)
   Relies on sigma-tokens.css CSS variables + [data-theme="light"].
   ================================================================ */
.leaflet-container .leaflet-bar {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.leaflet-container .leaflet-bar a {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
}
.leaflet-container .leaflet-bar a:hover {
    background-color: var(--surface-raised);
    color: var(--accent);
}
.leaflet-container .leaflet-bar a:last-child { border-bottom: none; }
.leaflet-container .leaflet-bar a.leaflet-disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}
.leaflet-container .leaflet-control-attribution {
    font-size: .6rem;
    background: rgba(3, 8, 4, .72);
    color: var(--text-faint);
    border-radius: var(--radius-sm) 0 0 0;
    padding: .15rem .45rem;
}
.leaflet-container .leaflet-control-attribution a { color: var(--text-muted); }
[data-theme="light"] .leaflet-container .leaflet-control-attribution {
    background: rgba(248, 251, 249, .88);
}

/* Legenda SigmaGeoPreview (geo_preview.js) — dipakai peta lokasi permohonan */
.leaflet-container .sgp-legend {
    display: flex; flex-direction: column; gap: .25rem;
    padding: .45rem .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-size: .7rem; line-height: 1.3; color: var(--text);
}
.leaflet-container .sgp-legend__row { display: flex; align-items: center; gap: .4rem; }
.leaflet-container .sgp-legend__sw {
    width: .8rem; height: .8rem; flex-shrink: 0;
    border: 1.5px solid; border-radius: 2px; opacity: .85;
}

/* ═══════════════════════════════════════════════════════════════════
   Pusat Bantuan - floating FAB + side panel
   ═══════════════════════════════════════════════════════════════════ */

/* ── FAB (floating action button) ──────────────────────────────── */
.help-fab {
    position: fixed; bottom: 88px; right: 0;
    z-index: 800;
    transform: translateX(calc(100% - 36px));
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}
.help-fab:hover,
.help-fab.is-open { transform: translateX(0); }

.help-fab__btn {
    display: flex; align-items: center; gap: 0;
    height: 44px; padding: 0;
    background: var(--accent); color: #fff;
    border: none; border-radius: 22px 0 0 22px;
    cursor: pointer; font-family: var(--font);
    font-size: 0.82rem; font-weight: 600;
    box-shadow: -3px 2px 14px color-mix(in srgb, var(--accent) 45%, transparent);
    white-space: nowrap; overflow: visible; position: relative;
    transition: background 0.15s, box-shadow 0.15s;
}
.help-fab__btn:hover {
    background: color-mix(in srgb, var(--accent) 82%, #fff 18%);
    box-shadow: -3px 2px 20px color-mix(in srgb, var(--accent) 55%, transparent);
}
.help-fab__icon {
    width: 44px; height: 44px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; position: relative;
}
.help-fab__pulse {
    position: absolute; inset: 0; border-radius: 50%;
    background: var(--accent); z-index: -1; pointer-events: none;
    animation: help-pulse 2.6s ease-out infinite;
}
@keyframes help-pulse {
    0%   { transform: scale(1); opacity: 0.45; }
    65%  { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}
.help-fab__label { padding: 0 16px 0 2px; }

/* Unread notification dot di FAB */
.help-fab__dot {
    position: absolute; top: 4px; left: 0px; width: 10px; height: 10px;
    border-radius: 50%; background: var(--red, #ef4444);
    box-shadow: 0 0 0 2px var(--surface, #fff);
    animation: help-fab-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes help-fab-dot-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}

/* ── Helpdesk panel (mitra & admin) ─────────────────────────────── */
.hp-root { display: flex; flex-direction: column; gap: .6rem; }
.hp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hp-toolbar__title { font-weight: 700; font-size: var(--text-sm); color: var(--text); }

.hp-list { display: flex; flex-direction: column; gap: .5rem; }
.hp-item {
    text-align: left; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: .65rem .75rem; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; gap: .25rem;
    transition: border-color .15s, background .15s;
}
.hp-item:hover { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 5%,var(--surface)); }
.hp-item__head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.hp-item__nomor { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); font-weight: 600; }
.hp-item__subj { font-weight: 600; font-size: var(--text-sm); color: var(--text); line-height: 1.3; }
.hp-item__snippet { font-size: .78rem; color: var(--text-muted); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hp-item__meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .15rem; }
.hp-time { font-size: .7rem; color: var(--text-faint); }

.hp-chip {
    display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .45rem; border-radius: 999px;
    background: color-mix(in srgb,var(--accent) 12%,transparent); color: var(--accent);
    font-size: .7rem; font-weight: 600;
}
.hp-chip i { font-size: .8rem; }

.hp-st { font-size: .65rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .03em; }
.hp-st--baru     { background: color-mix(in srgb,var(--blue,#3b82f6) 14%,transparent); color: var(--blue,#3b82f6); }
.hp-st--proses   { background: color-mix(in srgb,var(--amber,#d97706) 14%,transparent); color: var(--amber,#d97706); }
.hp-st--menunggu { background: color-mix(in srgb,var(--red,#ef4444) 14%,transparent); color: var(--red,#ef4444); }
.hp-st--selesai  { background: color-mix(in srgb,var(--success-text,#16a34a) 14%,transparent); color: var(--success-text,#16a34a); }
.hp-st--tutup    { background: var(--surface-sunken,var(--surface)); color: var(--text-faint); border: 1px solid var(--border); }

.hp-empty { text-align: center; padding: 1.2rem .8rem; color: var(--text-muted); font-size: var(--text-sm); }
.hp-empty i { display: block; font-size: 1.8rem; color: var(--text-faint); margin-bottom: .4rem; }

.hp-back { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.hp-back button { background: none; border: none; color: var(--accent); font: inherit;
    display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; padding: .25rem 0; font-size: var(--text-sm); }
.hp-back button:hover { text-decoration: underline; }

.hp-thread-head { padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-sunken,var(--surface)); }
.hp-thread__nomor { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); font-weight: 600; }
.hp-thread__subj { font-weight: 700; font-size: var(--text-sm); color: var(--text); margin-top: .15rem; line-height: 1.3; }
.hp-thread__meta { margin-top: .35rem; }

.hp-thread { display: flex; flex-direction: column; gap: .5rem; padding: .3rem 0; max-height: 40vh; overflow-y: auto; }
.hp-bubble { display: flex; }
.hp-bubble--me   { justify-content: flex-start; flex-direction: row-reverse; flex-wrap: wrap; }
.hp-bubble--them { justify-content: flex-start; flex-wrap: wrap; }
.hp-bubble__body {
    max-width: 85%; padding: .55rem .75rem; border-radius: 14px;
    font-size: var(--text-sm); line-height: 1.45; word-break: break-word;
}
.hp-bubble--me .hp-bubble__body {
    background: var(--accent); color: var(--on-accent, #fff); border-bottom-right-radius: 4px;
}
.hp-bubble--them .hp-bubble__body {
    background: var(--surface-sunken,var(--surface)); color: var(--text);
    border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.hp-bubble__time { font-size: .68rem; color: var(--text-faint); margin: .15rem .35rem 0; align-self: flex-end; }
.hp-bubble--them .hp-bubble__time { align-self: flex-end; }

.hp-input { display: flex; gap: .4rem; align-items: flex-end; border-top: 1px solid var(--border);
    padding-top: .55rem; margin-top: .3rem; }
.hp-input__ta {
    flex: 1; resize: none; padding: .5rem .65rem; border: 1px solid var(--border);
    border-radius: var(--radius-md); font: inherit; font-size: var(--text-sm); background: var(--surface); color: var(--text);
}
.hp-input__ta:focus { outline: none; border-color: var(--accent); }
.hp-closed { padding: .6rem; border-radius: var(--radius-md); background: var(--surface-sunken,var(--surface));
    border: 1px dashed var(--border); color: var(--text-muted); font-size: var(--text-sm); text-align: center; }

/* Mode thread: input ditambat di bawah (WhatsApp-style), hanya pesan yang scroll */
.help-panel__body:has(#hp-mitra[data-mode="thread"]) { display: flex; flex-direction: column; }
.help-panel__pane.is-active:has(#hp-mitra[data-mode="thread"]) {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    padding-bottom: 0; overflow: hidden;
}
#hp-mitra[data-mode="thread"] { flex: 1; min-height: 0; }
#hp-mitra[data-mode="thread"] .hp-thread {
    flex: 1; min-height: 0; max-height: none; padding-right: .2rem;
}
#hp-mitra[data-mode="thread"] .hp-back,
#hp-mitra[data-mode="thread"] .hp-thread-head { flex-shrink: 0; }
#hp-mitra[data-mode="thread"] .hp-input,
#hp-mitra[data-mode="thread"] .hp-closed {
    flex-shrink: 0; margin-top: 0;
    /* tambat ke dasar panel + latar solid agar pesan tak tembus di belakangnya */
    background: var(--surface);
    padding-bottom: 1rem;
    /* lebar penuh sampai tepi panel (kompensasi padding 1.2rem dari pane) */
    margin-left: -1.2rem; margin-right: -1.2rem;
    padding-left: 1.2rem; padding-right: 1.2rem;
}

.hp-form { display: flex; flex-direction: column; gap: .5rem; }
.hp-form .field__label { margin-bottom: .1rem; font-size: var(--text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.hp-form .field__input { padding: .5rem .65rem; font-size: var(--text-sm); }
.hp-form__permtag { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .55rem;
    border-radius: var(--radius-md); background: color-mix(in srgb,var(--accent) 8%,var(--surface));
    border: 1px solid color-mix(in srgb,var(--accent) 25%,var(--border));
    font-size: .78rem; color: var(--text); }
.hp-form__permtag i { color: var(--accent); }
.hp-form__hint { margin: -.15rem 0 .1rem; font-size: var(--text-xs); color: var(--text-faint); }
.hp-form__actions { display: flex; justify-content: flex-end; margin-top: .3rem; }
.hp-form__alert { margin: .3rem 0 0; font-size: var(--text-xs); color: var(--red,#ef4444); }

/* Admin pane: summary + tombol ke CMS */
.hp-admin { text-align: center; padding: .8rem .6rem; display: flex; flex-direction: column; gap: .55rem; align-items: center; }
.hp-admin__num { font-family: var(--font-d); font-size: 2.3rem; font-weight: 700; color: var(--accent); line-height: 1; }
.hp-admin__lbl { font-size: var(--text-sm); color: var(--text-muted); }
.hp-admin__brk { list-style: none; margin: .5rem 0 .2rem; padding: 0; width: 100%;
    display: grid; gap: .25rem; font-size: var(--text-sm); }
.hp-admin__brk li { display: flex; justify-content: space-between; padding: .25rem .5rem;
    border-radius: var(--radius-sm); background: var(--surface-sunken,var(--surface)); }
.hp-admin__brk strong { color: var(--text); }

/* ── Backdrop ───────────────────────────────────────────────────── */
.help-backdrop {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.28);
    opacity: 0; pointer-events: none;
    transition: opacity 0.28s;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.help-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ── Panel ──────────────────────────────────────────────────────── */
.help-panel {
    position: fixed; top: 0; right: 0;
    width: 400px; max-width: 100vw; height: 100vh;
    z-index: 1000;
    display: flex; flex-direction: column;
    background: var(--surface);
    box-shadow: -6px 0 28px rgba(0,0,0,0.22);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.help-panel.is-open { transform: translateX(0); }

.help-panel__header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.1rem; flex-shrink: 0;
    background: var(--accent);
}
.help-panel__hicon {
    width: 36px; height: 36px; flex-shrink: 0;
    background: rgba(255,255,255,0.18); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
}
.help-panel__title {
    font-family: var(--font); font-size: 1rem; font-weight: 700;
    color: #fff; line-height: 1; margin: 0;
}
.help-panel__subtitle { font-size: 0.75rem; opacity: 0.78; color: #fff; margin: 0.1rem 0 0; }
.help-panel__close {
    margin-left: auto; flex-shrink: 0;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.15); border: none;
    border-radius: 6px; cursor: pointer; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; transition: background 0.15s;
}
.help-panel__close:hover { background: rgba(255,255,255,0.28); }

.help-panel__tabs {
    display: flex; flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.help-panel__tab {
    flex: 1; padding: 0.6rem 0.5rem;
    border: none; background: none;
    font-size: 0.8rem; font-weight: 500; color: var(--text-muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.help-panel__tab:hover { color: var(--text); }
.help-panel__tab.is-active {
    color: var(--accent); border-bottom-color: var(--accent); font-weight: 600;
}

.help-panel__body { flex: 1; overflow-y: auto; }
.help-panel__pane { display: none; padding: 1.2rem; }
.help-panel__pane.is-active { display: block; }

/* ── Mulai tab ──────────────────────────────────────────────────── */
.help-intro {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem; margin-bottom: 1.1rem;
    display: flex; gap: 0.7rem; align-items: flex-start;
}
.help-intro__emoji { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.help-intro__title { font-weight: 700; font-size: 0.9rem; color: var(--text); margin: 0 0 .18rem; }
.help-intro__body { font-size: 0.78rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

.help-section-title {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-faint); margin: 0 0 0.6rem;
}
.help-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.help-step { display: flex; gap: 0.65rem; align-items: flex-start; }
.help-step__num {
    width: 20px; height: 20px; flex-shrink: 0;
    background: var(--accent); color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700; margin-top: 0.08rem;
}
.help-step__body { font-size: 0.81rem; color: var(--text); line-height: 1.5; }
.help-step__body strong { color: var(--text); }

.help-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; }
.help-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: var(--radius-full); font-size: 0.76rem; color: var(--text);
    text-decoration: none; cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.help-chip:hover {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--accent);
}
.help-chip .ti { font-size: 0.8rem; }

/* ── Modul tab ──────────────────────────────────────────────────── */
.help-module-list { list-style: none; margin: 0; padding: 0; }
.help-module-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.62rem 0; border-bottom: 1px solid var(--border-subtle);
    text-decoration: none; color: var(--text);
    transition: color 0.12s;
}
.help-module-item:last-child { border-bottom: none; }
.help-module-item:hover { color: var(--accent); }
.help-module-item:hover .help-module-ico {
    color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.help-module-ico {
    width: 30px; height: 30px; flex-shrink: 0;
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: 7px; display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; color: var(--text-muted);
    transition: color 0.12s, border-color 0.12s;
}
.help-module-name { font-weight: 600; font-size: 0.83rem; margin: 0; }
.help-module-desc { font-size: 0.73rem; color: var(--text-muted); margin: 0; }

/* ── Pintasan tab ───────────────────────────────────────────────── */
.help-sc-section { margin-bottom: 1.1rem; }
.help-sc-section:last-child { margin-bottom: 0; }
.help-sc-list { list-style: none; margin: 0; padding: 0; }
.help-sc-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.45rem 0; border-bottom: 1px solid var(--border-subtle); gap: 0.75rem;
}
.help-sc-item:last-child { border-bottom: none; }
.help-sc-label { font-size: 0.8rem; color: var(--text); flex: 1; }
.help-sc-keys { display: flex; gap: 0.22rem; flex-shrink: 0; }
.help-kbd {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.16rem 0.42rem;
    background: var(--surface-raised); border: 1px solid var(--border);
    border-bottom-width: 2px; border-radius: 4px;
    font-family: var(--font-m); font-size: 0.7rem; color: var(--text);
    min-width: 22px; white-space: nowrap; line-height: 1.4;
}
.help-sc-plus { font-size: 0.7rem; color: var(--text-faint); align-self: center; }

/* ── FAQ tab ────────────────────────────────────────────────────── */
.help-faq-list { list-style: none; margin: 0; padding: 0; }
.help-faq-item { border-bottom: 1px solid var(--border-subtle); }
.help-faq-item:last-child { border-bottom: none; }
.help-faq-q {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.72rem 0; background: none; border: none;
    font-size: 0.82rem; font-weight: 600; color: var(--text);
    cursor: pointer; text-align: left; width: 100%;
    transition: color 0.12s;
}
.help-faq-q:hover { color: var(--accent); }
.help-faq-q .ti { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; }
.help-faq-item.is-open .help-faq-q .ti { transform: rotate(180deg); }
.help-faq-a {
    font-size: 0.79rem; color: var(--text-muted); line-height: 1.65;
    padding: 0 0 0.75rem; display: none;
}
.help-faq-item.is-open .help-faq-a { display: block; }
.help-faq-skeleton { display: flex; flex-direction: column; gap: .65rem; padding: .5rem 0; }
.help-faq-empty {
    text-align: center; padding: 2.5rem 0;
    color: var(--text-muted); font-size: 0.83rem;
}
.help-faq-empty .ti { font-size: 2rem; display: block; opacity: .35; margin-bottom: .5rem; }

/* ─────────────────────────────────────────────────────────────────────────
   Type-selector dialog  (pilih jenis permohonan - list.html + hub_tracking.html)
   ───────────────────────────────────────────────────────────────────────── */
.type-dialog-backdrop[hidden] { display: none; }
.type-dialog-backdrop {
    position: fixed; inset: 0; background: rgba(8, 10, 9, 0.35); z-index: 900;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    animation: type-backdrop-in .15s ease;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@keyframes type-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.type-dialog {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 42rem; overflow: hidden;
    animation: type-dialog-in .18s cubic-bezier(.34,1.56,.64,1);
}
@keyframes type-dialog-in {
    from { opacity: 0; transform: scale(.94) translateY(-.5rem); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.type-dialog__header {
    padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.type-dialog__title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.type-dialog__subtitle { font-size: 0.8rem; color: var(--text-muted); margin: 0.2rem 0 0; }
.type-dialog__close {
    flex-shrink: 0; width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: transparent; cursor: pointer;
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    transition: background var(--t-fast);
}
.type-dialog__close:hover { background: var(--surface-sunken); }
.type-dialog__body { padding: 1.25rem 1.5rem 1.5rem; }
.type-dialog__footer { padding: 0 1.5rem 1rem 1.5rem; }
.type-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
@media (max-width: 520px) { .type-card-grid { grid-template-columns: 1fr; } }
.type-card {
    display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); cursor: pointer; text-decoration: none; color: inherit;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.type-card:hover {
    border-color: var(--accent); background: var(--accent-light);
    box-shadow: 0 2px 12px rgba(0,0,0,.08); text-decoration: none; color: inherit;
}
.type-card__icon {
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm);
    background: var(--accent-light); display: flex; align-items: center; justify-content: center;
    color: var(--accent); flex-shrink: 0; font-size: 1.1rem;
}
.type-card__label { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.type-card__desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* ── Checkbox group (multi-select list, mis. Komitmen Kerja Sama) ── */
.checkbox-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.checkbox-group__item {
    display: flex; align-items: flex-start; gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.checkbox-group__item:hover { border-color: var(--primary); background: var(--surface-2); }
.checkbox-group__item input { margin-top: 0.2rem; flex-shrink: 0; }
.checkbox-group__item span { font-size: var(--text-sm); line-height: 1.4; color: var(--text); }
