﻿/* ===== Shell admin: tidak bergantung pada utility Tailwind ===== */
.nc-admin-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.nc-admin-aside {
    height: 100vh;
    height: 100dvh;
}

@media (min-width: 768px) {
    .nc-admin-shell {
        display: flex;
    }

    .nc-admin-aside {
        position: sticky;
        top: 0;
        align-self: flex-start; /* jangan ikut tinggi konten */
        flex: 0 0 18rem;
        width: 18rem;
        transform: none !important;
        box-shadow: none;
    }
}

/* Tabel desktop / daftar mobile */
.nc-admin-desktop {
    display: none;
}

@media (min-width: 768px) {
    .nc-admin-desktop {
        display: block;
    }
}

/* Ukuran label kecil */
.nc-section-label {
    font-size: .6875rem;
    letter-spacing: .14em;
}

.nc-admin-chip {
    font-size: .625rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
    padding: .25rem .5rem;
}

/* ============================================================
   Admin: tabel, role, aksi, modal, toast
   ============================================================ */
:root {
    --ok: #047857;
    --warn: #B45309;
    --bad: #BE123C;
}

    :root[data-theme="dark"] {
        --ok: #6EE7B7;
        --warn: #FCD34D;
        --bad: #FDA4AF;
    }

/* Tabel */
.nc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
}

    .nc-table thead th {
        padding: .7rem 1rem;
        text-align: left;
        white-space: nowrap;
        font-size: .68rem;
        font-weight: 800;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--app-muted);
        background: var(--app-surface-2);
        border-block: 1px solid var(--app-border);
    }

        .nc-table thead th.text-right {
            text-align: right;
        }

    .nc-table tbody td {
        padding: .8rem 1rem;
        vertical-align: middle;
        border-bottom: 1px solid var(--app-border);
        color: var(--app-text);
    }

    .nc-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .nc-table tbody tr:hover td {
        background: color-mix(in srgb, var(--app-accent-soft) 60%, transparent);
    }

/* Aksi ikon */
.nc-act-danger:hover {
    background: color-mix(in srgb, #F43F5E 14%, transparent);
    color: var(--bad);
}

/* Role badge */
.nc-role {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    white-space: nowrap;
}

.nc-role-admin {
    background: var(--app-accent-soft);
    color: var(--app-accent);
    border: 1px solid color-mix(in srgb, var(--app-accent) 25%, transparent);
}

.nc-role-user {
    background: var(--app-surface-2);
    color: var(--app-muted);
    border: 1px solid var(--app-border);
}

/* Modal admin */
.nc-admin-modal {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nc-modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
}

.nc-modal-foot {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

@media (max-width: 639.98px) {
    .nc-confirm-overlay {
        align-items: flex-end;
        padding: 0;
    }

        .nc-confirm-overlay > .nc-admin-modal {
            max-width: none;
            max-height: 92dvh;
            border-end-start-radius: 0;
            border-end-end-radius: 0;
            animation: nc-sheet-up .28s cubic-bezier(.22, 1, .36, 1) backwards;
        }
}

@keyframes nc-sheet-up {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
}

/* Spinner */
.nc-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: nc-spin .7s linear infinite;
}

@keyframes nc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast */
.nc-toast-wrap {
    position: fixed;
    z-index: 2147483647;
    pointer-events: none;
    inset: auto 1rem calc(1rem + env(safe-area-inset-bottom)) 1rem;
    display: flex;
    justify-content: flex-end;
}

.nc-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    max-width: 24rem;
    padding: .75rem .875rem;
    border-radius: 1rem;
    background: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border);
    border-left-width: 4px;
    box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .5);
    animation: nc-toast-in .3s cubic-bezier(.22, 1, .36, 1) backwards;
}

    .nc-toast.is-ok {
        border-left-color: var(--ok);
    }

        .nc-toast.is-ok > i {
            color: var(--ok);
        }

    .nc-toast.is-bad {
        border-left-color: var(--bad);
    }

        .nc-toast.is-bad > i {
            color: var(--bad);
        }

@keyframes nc-toast-in {
    from {
        transform: translateY(16px);
        opacity: 0;
    }
}

.nc-input:disabled {
    background: var(--app-surface-2);
}

/* Marker <details> (form materi) */
details > summary {
    list-style: none;
}

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

    details > summary::after {
        content: "\F282";
        font-family: "bootstrap-icons";
        float: right;
        transition: transform .2s;
        color: var(--app-muted);
    }

details[open] > summary::after {
    transform: rotate(180deg);
}

/* ===== Editor JSON ===== */
.nc-json {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: var(--app-surface-2);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

    .nc-json:focus-within {
        border-color: var(--app-accent);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-accent) 16%, transparent);
    }

    .nc-json.is-invalid {
        border-color: var(--bad);
    }

        .nc-json.is-invalid:focus-within {
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 16%, transparent);
        }

.nc-json-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .5rem .75rem;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
}

.nc-json-title {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .75rem;
    font-weight: 700;
    color: var(--app-muted);
}

.nc-json-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    font-weight: 800;
}

    .nc-json-status.is-ok {
        color: var(--ok);
    }

    .nc-json-status.is-bad {
        color: var(--bad);
    }

.nc-json-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .6rem;
    border-radius: .5rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--app-muted);
    transition: background .15s, color .15s;
}

    .nc-json-btn:hover:not(:disabled) {
        background: var(--app-accent-soft);
        color: var(--app-accent);
    }

    .nc-json-btn:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.nc-json-area {
    display: block;
    width: 100%;
    resize: vertical;
    min-height: 5rem;
    max-height: 24rem;
    padding: .75rem 1rem;
    background: transparent;
    color: var(--app-text);
    border: 0;
    outline: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans JP", monospace;
    font-size: .8125rem;
    line-height: 1.6;
    tab-size: 2;
    white-space: pre;
    overflow: auto;
}

.nc-json-error {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    margin: 0;
    padding: .5rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--bad);
    background: color-mix(in srgb, var(--bad) 8%, var(--app-surface));
    border-top: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
}