/* ============================================================
   Portal Informasi Terpadu — Guest UI
   Mobile-first, modern-clean (referensi: linktree-style layout)
   ============================================================ */

:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #101828;
    --muted: #667085;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;

    --primary: #16324f;
    --primary-soft: #eef3f8;
    --accent: #2563eb;
    --accent-soft: #eff4ff;

    --success: #067647;
    --success-soft: #ecfdf3;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --danger: #b42318;
    --danger-soft: #fef3f2;

    --amber: #dc6803;
    --amber-soft: #fffaeb;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, .08), 0 12px 24px -12px rgba(16, 24, 40, .12);

    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: Georgia, "Times New Roman", "Noto Serif", Cambria, serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name, .detail-title, .doc-title, .empty-state h3 {
    font-family: var(--font-heading);
}

img, svg { display: block; }
a { color: inherit; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* ---------- Shell ---------- */
.shell {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.header-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    min-height: 62px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d3d5f, #0f2438);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-xs);
}

.brand-mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-unit {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 4px 4px 12px;
    margin-left: auto;
    max-width: 320px;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.header-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

.search-icon { flex: none; width: 15px; height: 15px; color: var(--muted); }
.search-icon svg { width: 15px; height: 15px; }

.header-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    padding: 5px 0;
}

.header-search input::placeholder { color: var(--muted); }

.header-search button {
    flex: none;
    border: 0;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease;
}

.header-search button svg { width: 15px; height: 15px; }

.header-search button:hover { background: #0f2438; }

@media (max-width: 560px) {
    .brand-text { display: none; }
    .header-search { max-width: none; }
}

/* ---------- Main ---------- */
.main-shell {
    padding: 20px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p { margin: 0; font-size: 14px; }

.section { display: flex; flex-direction: column; gap: 12px; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Icon button (copy) ---------- */
.btn-icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}

.btn-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.btn-icon:active { transform: scale(.94); }

.btn-icon svg { width: 15px; height: 15px; }
.btn-icon .icon-check { display: none; }

.btn-icon.copied { color: var(--success); border-color: #abefc6; background: var(--success-soft); }
.btn-icon.copied .icon-copy { display: none; }
.btn-icon.copied .icon-check { display: block; }

.section-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.section-title .count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11.5px;
    letter-spacing: 0;
}

.link-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background .15s ease;
}

.link-reset:hover { background: var(--accent-soft); }
.link-reset svg { width: 14px; height: 14px; }

/* ---------- Category chips ---------- */
.chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    margin: -2px;
    scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.chip:hover { border-color: var(--border-strong); transform: translateY(-1px); }

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

.chip-count {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--primary-soft);
    color: var(--primary);
}

.chip-active .chip-count { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---------- Filter panel ---------- */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.filter-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    transition: color .15s ease, background .15s ease;
}

.filter-summary::-webkit-details-marker { display: none; }
.filter-summary:hover { color: var(--text); background: var(--surface-soft); }
.filter-summary svg { width: 16px; height: 16px; }

.filter-panel[open] .filter-summary {
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.filter-form { padding: 14px; display: flex; flex-direction: column; gap: 14px; }

.filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field > span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field select { appearance: none; }

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn svg { width: 16px; height: 16px; }

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover { background: #0f2438; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover { background: var(--surface-soft); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.btn-ghost:hover { color: var(--text); background: var(--surface-soft); }

.btn-block { width: 100%; }

/* ---------- Document cards ---------- */
.doc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.doc-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.doc-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    opacity: .45;
    transition: opacity .15s ease;
}

.doc-card:hover .doc-copy { opacity: 1; }

.doc-copy .btn-icon { width: 28px; height: 28px; }
.doc-copy .btn-icon svg { width: 13px; height: 13px; }

/* Main card element keeps clear of the corner copy button */
.doc-card-main { text-decoration: none; display: flex; flex-direction: column; gap: 8px; padding-right: 34px; }

.doc-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 3px 9px;
    border-radius: 999px;
}

.type-badge svg { width: 12px; height: 12px; }

.type-file { background: var(--primary-soft); color: var(--primary); }
.type-link { background: var(--accent-soft); color: var(--accent); }

.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--amber-soft);
    color: var(--amber);
}

.pin-badge svg { width: 12px; height: 12px; }

.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--danger-soft);
    color: var(--danger);
}

.lock-badge svg { width: 12px; height: 12px; }

.doc-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.doc-card:hover .doc-title { color: var(--accent); }

.doc-desc {
    margin: 0;
    font-size: 13.5px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

.meta-chip {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.status-draft { background: var(--warning-soft); color: var(--warning); }
.status-final { background: var(--success-soft); color: var(--success); }
.status-terbaru { background: var(--accent-soft); color: var(--accent); }
.status-tidak-berlaku { background: var(--danger-soft); color: var(--danger); }

.meta-spacer { flex: 1; }

.meta-updated { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Empty state ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
}

.empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--muted);
}

.empty-icon svg { width: 24px; height: 24px; }

.empty-state h3 { margin: 6px 0 0; font-size: 16px; }
.empty-state p { margin: 0 0 8px; font-size: 13.5px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; padding-top: 4px; }

.pagination nav[aria-label="Pagination"] { display: flex; gap: 4px; }

.pagination .bg-white {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, background .15s ease;
}

.pagination a.bg-white:hover { background: var(--surface-soft); border-color: var(--border-strong); }

.pagination span.bg-white[aria-current="page"],
.pagination span.bg-white[aria-current="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination span.bg-white:not([aria-current]),
.pagination span.bg-white[aria-disabled="true"] {
    color: var(--muted);
    background: var(--surface-soft);
}

/* ---------- Metadata collapsible ---------- */
.meta-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.meta-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    transition: color .15s ease, background .15s ease;
}

.meta-summary::-webkit-details-marker { display: none; }
.meta-summary:hover { color: var(--text); background: var(--surface-soft); }
.meta-summary > svg:first-child { width: 15px; height: 15px; }

.meta-summary .chevron {
    margin-left: auto;
    width: 15px;
    height: 15px;
    transition: transform .2s ease;
}

.meta-panel[open] .meta-summary {
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.meta-panel[open] .meta-summary .chevron { transform: rotate(180deg); }

.meta-panel .meta-grid { border: 0; border-radius: 0; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: -8px;
    flex-wrap: wrap;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px 6px 10px;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.btn-back:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
    transform: translateX(-1px);
}

.btn-back svg { width: 14px; height: 14px; }

.breadcrumb-path {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    min-width: 0;
}

.breadcrumb-path a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 6px;
}

.breadcrumb-path a:hover { color: var(--accent); background: var(--accent-soft); }

.breadcrumb-sep { color: var(--border-strong); }

.detail-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
}

.type-blended { background: #e6f6f2; color: #0e9384; }

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.detail-desc { margin: 0; font-size: 14.5px; color: var(--muted); }

.detail-desc.rich-text { color: var(--text); font-size: 14.5px; }

.rich-text > *:first-child { margin-top: 0; }
.rich-text > *:last-child { margin-bottom: 0; }
.rich-text p { margin: 0 0 10px; }
.rich-text ul, .rich-text ol { margin: 0 0 10px; padding-left: 22px; }
.rich-text table { border-collapse: collapse; margin: 0 0 10px; width: 100%; }
.rich-text table th, .rich-text table td { border: 1px solid var(--border); padding: 6px 10px; font-size: 13.5px; }
.rich-text img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rich-text h1, .rich-text h2, .rich-text h3 { margin: 14px 0 8px; font-size: 17px; }
.rich-text a { color: var(--accent); }
.rich-text blockquote { margin: 0 0 10px; padding: 8px 14px; border-left: 3px solid var(--border-strong); color: var(--muted); }

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list { display: flex; flex-direction: column; gap: 6px; }

.file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}

.file-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row-actions { display: inline-flex; gap: 6px; flex: none; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }

.link-list { display: flex; flex-direction: column; gap: 6px; }

/* ---------- File boxes (persegi) ---------- */
.file-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.file-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.file-box:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.file-box-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    overflow: hidden;
    text-decoration: none;
    transition: background .15s ease;
}

.file-box-thumb:hover { background: var(--primary-soft); }

.file-box-thumb.is-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-type-chip {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .05em;
    padding: 6px 12px;
    border-radius: 8px;
}

.file-type-PDF { background: var(--danger-soft); color: var(--danger); }
.file-type-DOC { background: var(--accent-soft); color: var(--accent); }
.file-type-XLS { background: var(--success-soft); color: var(--success); }
.file-type-PPT { background: var(--warning-soft); color: var(--warning); }
.file-type-ZIP { background: #f4e8ff; color: #6941c6; }
.file-type-TXT { background: var(--surface-soft); color: var(--muted); border: 1px solid var(--border); }
.file-type-FILE { background: var(--primary-soft); color: var(--primary); }

.file-box-name {
    margin: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-box-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.file-box-actions .btn-icon { width: 28px; height: 28px; }
.file-box-actions .btn-icon svg { width: 13px; height: 13px; }

@media (min-width: 640px) {
    .file-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px 6px 8px;
    min-width: 0;
}

.link-url {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.actions-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Detail layout (main + aside) ---------- */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.detail-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.detail-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 16px;
}

.detail-aside .meta-grid { border: 0; border-radius: 0; }

.aside-title {
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.meta-grid-aside .meta-item { border-right: 0; }
.meta-grid-aside .meta-item:nth-child(odd) { background: var(--surface); }
.meta-grid-aside .meta-item { background: var(--surface); }

@media (min-width: 900px) {
    /* Detail page: main card selebar sisa body, metadata lebih lebar */
    .main-shell-wide { max-width: 1180px; }

    .detail-layout {
        grid-template-columns: minmax(0, 2.6fr) minmax(300px, 1fr);
        align-items: stretch;
    }

    .detail-main { grid-column: 1; }

    .detail-aside { grid-column: 2; }

    .detail-aside .meta-item dt { font-size: 10px; }

    .detail-aside .meta-item dd { font-size: 12.5px; }
}

.alert {
    margin: 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
}

.alert-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid #fedf89; }

.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.meta-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.meta-item:nth-child(odd) { background: var(--surface-soft); }
.meta-item-wide { grid-column: 1 / -1; }
.meta-item:last-child { border-bottom: 0; }

.meta-item dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    margin-bottom: 2px;
}

.meta-item dd { margin: 0; font-size: 14px; font-weight: 500; }

.meta-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

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

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-chip {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 3px 10px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.tag-chip:hover { background: var(--primary); color: #fff; }

/* ---------- Unlock page ---------- */
.unlock-wrap {
    display: flex;
    justify-content: center;
    padding-top: 6vh;
}

.unlock-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 22px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.unlock-icon {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: var(--warning-soft);
    color: var(--amber);
    display: grid;
    place-items: center;
    margin-bottom: 6px;
}

.unlock-icon svg { width: 26px; height: 26px; }

.unlock-card h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }

.unlock-card > p { margin: 0; font-size: 13.5px; }

.unlock-form { width: 100%; margin-top: 14px; display: flex; flex-direction: column; gap: 14px; text-align: left; }

.password-wrap { position: relative; display: flex; }

.password-wrap input {
    width: 100%;
    font: inherit;
    font-size: 14px;
    padding: 10px 44px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.password-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.toggle-password {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 6px;
    border-radius: 7px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.toggle-password:hover { color: var(--text); background: var(--surface-soft); }
.toggle-password svg { width: 17px; height: 17px; }
.toggle-password .icon-eye-off { display: none; }
.toggle-password.is-on .icon-eye { display: none; }
.toggle-password.is-on .icon-eye-off { display: block; }

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

/* ---------- Flash ---------- */
.flash {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #abefc6;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.flash svg { width: 16px; height: 16px; flex: none; }

/* ---------- Footer ---------- */
.app-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 28px 0 28px;
    margin-top: 8px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.footer-title { margin: 0 0 6px; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }

.footer-desc { margin: 0; font-size: 12.5px; line-height: 1.65; max-width: 320px; }

.footer-heading {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-list a {
    display: inline-block;
    max-width: 100%;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .15s ease;
}

.footer-list a:hover { color: var(--accent); }

.footer-copy { margin: 16px 0 0; font-size: 12px; }

/* ---------- Tablet & up ---------- */
@media (min-width: 640px) {
    .header-inner { min-height: 48px; }
    .hero h1 { font-size: 24px; }
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-grid .field:first-child { grid-column: 1 / -1; }
    .meta-grid { grid-template-columns: repeat(2, 1fr); }
    .meta-item:nth-child(odd) { background: var(--surface); }
    .meta-item { border-right: 1px solid var(--border); }
    .meta-item:nth-child(2n) { border-right: 0; }
    .footer-grid { grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 28px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
    .shell { max-width: 960px; padding: 0 24px; }
    .doc-title { font-size: 16.5px; }
    .detail-title { font-size: 26px; }
}
