/* ============================================================
   PORTAL REVIEW DRAWING SPV - penyesuaian di atas orulabs.css
   - Layout selebar layar, tanpa sidebar; navbar menempel di atas.
   - Aksen gelap (bawaan --ol-primary diatur di app-theme.js).
   - Tanpa logo template & tanpa loading screen.
   ============================================================ */

:root { --app-pad: 1.5rem; }
@media (max-width: 767.98px) { :root { --app-pad: .85rem; } }

/* --- Layout selebar layar --- */
.ol-no-sidebar .ol-main {
    margin: 0 !important;
    max-width: none;
    padding: 0;
}
.ol-no-sidebar .ol-topbar {
    padding-top: 0;
    margin-bottom: 1.25rem;
    background: transparent;
}
.ol-no-sidebar .ol-navbar {
    border-radius: 0;
    border-width: 0 0 1px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 0 var(--app-pad);
    gap: .75rem;
}
.ol-no-sidebar .ol-content { padding: 0 var(--app-pad); min-width: 0; }
.ol-no-sidebar .ol-footer {
    border-radius: 0;
    border-width: 1px 0 0;
    box-shadow: none;
    background: transparent;
    padding: .9rem var(--app-pad);
    margin-top: 2rem;
}

/* --- Brand (ikon aplikasi, bukan logo template) --- */
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: var(--ol-text);
    flex-shrink: 0;
}
.app-brand:hover { color: var(--ol-text); }
.app-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--app-ink, #111827);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
[data-bs-theme="dark"] .app-logo { background: #f8fafc; color: #111827; }
.app-logo-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.9rem; }
.app-brand-name { font-weight: 800; font-size: .98rem; letter-spacing: -.01em; line-height: 1.15; }
.app-brand-sub { font-size: .7rem; color: var(--ol-muted); line-height: 1.15; }

/* --- Menu utama di navbar --- */
.app-menu {
    display: flex;
    align-items: center;
    gap: .15rem;
    list-style: none;
    margin: 0 0 0 .5rem;
    padding: 0;
    min-width: 0;
    align-self: stretch;
}
.app-menu > li { display: flex; align-self: stretch; }
.app-menu .ol-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0 .85rem;
    color: var(--ol-muted);
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.app-menu .ol-nav-link,
.app-menu .ol-nav-link:hover,
.app-menu .ol-nav-link.active { background: transparent !important; box-shadow: none !important; border-radius: 0; margin: 0; }
.app-menu .ol-nav-link i { font-size: 1.02rem; width: auto; }
.app-menu .ol-nav-text { flex: 0 0 auto; }
.app-menu .ol-nav-link:hover { color: var(--ol-text); }
.app-menu .ol-nav-link.active { color: var(--ol-text); border-bottom-color: var(--ol-primary); }
.app-menu .app-menu-badge {
    font-size: .65rem;
    padding: .15rem .4rem;
    border-radius: 50rem;
    background: #ef4444;
    color: #fff;
    line-height: 1;
}
html[data-app-menu-labels="hide"] .app-menu .ol-nav-text { display: none; }

/* Menu ringkas (ponsel/tablet) */
.app-menu-mobile .dropdown-item i { width: 1.25rem; display: inline-block; }
.app-menu-mobile .dropdown-item.active { background: var(--ol-primary); color: #fff; }

/* --- Dropdown profil --- */
.app-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    border: 1px solid var(--ol-border);
    background: var(--ol-surface);
    border-radius: 50rem;
    padding: .25rem .7rem .25rem .25rem;
    color: var(--ol-text);
}
.app-profile-btn:hover, .app-profile-btn[aria-expanded="true"] { background: var(--ol-surface-2); }
.app-profile-btn:focus { outline: none; }
.app-profile-btn:focus-visible { box-shadow: 0 0 0 3px rgba(var(--ol-primary-rgb), .2); }
.app-profile-btn[aria-expanded="true"] { border-color: var(--ol-border); }
.app-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ol-primary);
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.app-avatar.is-lg { width: 44px; height: 44px; font-size: .95rem; }
.app-avatar .app-dot {
    position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
    background: #94a3b8; border: 2px solid var(--ol-surface);
}
.app-avatar .app-dot.is-on { background: #16a34a; }
.app-profile {
    width: 320px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--ol-radius);
}
.app-profile-head { display: flex; gap: .75rem; align-items: center; padding: 1rem 1rem .85rem; border-bottom: 1px solid var(--ol-border); }
.app-profile-section { padding: .8rem 1rem; border-bottom: 1px solid var(--ol-border); }
.app-profile-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ol-muted);
    margin-bottom: .45rem; display: flex; align-items: center; gap: .35rem;
}
.app-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .3rem; padding: .25rem; border-radius: 12px; background: var(--ol-surface-2); }
.app-seg .btn {
    --bs-btn-padding-y: .38rem;
    --bs-btn-font-size: .8rem;
    font-weight: 600;
    border: 0;
    border-radius: 9px;
    color: var(--ol-muted);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
.app-seg .btn:hover { color: var(--ol-text); }
.app-seg .btn.active, .app-seg .btn.is-active {
    background: var(--ol-surface);
    color: var(--ol-text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.app-profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .8rem 1rem; border-bottom: 1px solid var(--ol-border); }
.app-profile-actions .btn {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    font-size: .78rem; font-weight: 600; padding: .6rem .3rem;
    border: 1px solid var(--ol-border); border-radius: 11px; color: var(--ol-text); background: var(--ol-surface);
}
.app-profile-actions .btn i { font-size: 1.1rem; }
.app-profile-actions .btn:hover { background: var(--ol-surface-2); }
.app-profile-foot { padding: .75rem 1rem; }

/* --- Sembunyikan bagian sesuai pengaturan --- */
html[data-app-nav-notif="hide"] [data-app-nav="notif"],
html[data-app-charts="hide"] [data-app-chart-row] { display: none !important; }

/* --- Ukuran huruf --- */
html[data-app-font="small"] { font-size: 14px; }
html[data-app-font="large"] { font-size: 17px; }

/* --- Kepadatan --- */
html[data-app-density="compact"] .table > :not(caption) > * > * { padding: .32rem .55rem; }
html[data-app-density="compact"] .card-body { padding: .85rem 1rem; }
html[data-app-density="compact"] .ol-page-header { padding: .75rem 1rem; margin-bottom: .9rem; }
html[data-app-density="compact"] .ol-stat { padding: .8rem 1rem; }
html[data-app-density="compact"] .ol-stat-value { font-size: 1.45rem; }
html[data-app-density="compact"] .mb-3 { margin-bottom: .7rem !important; }

/* --- Komponen kecil --- */
.app-sev { display: inline-flex; gap: .25rem; }
.app-sev .badge { min-width: 1.7rem; }
.app-pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font: .82rem/1.55 ui-monospace, Consolas, monospace;
    background: var(--ol-surface-2);
    border: 1px solid var(--ol-border);
    border-radius: var(--ol-radius-sm, 10px);
    padding: .85rem 1rem;
    max-height: 520px;
    overflow: auto;
    margin: 0;
}
.app-pre.is-full { max-height: none; }
.app-meta dt { font-size: .75rem; color: var(--ol-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.app-meta dd { margin-bottom: .7rem; word-break: break-word; }
.app-chart { position: relative; height: 260px; }
.table td a { text-decoration: none; font-weight: 600; color: var(--ol-text); }
.table td a:hover { text-decoration: underline; }
.nav-pills .nav-link.active { background: var(--ol-primary); }

/* --- Halaman Pengaturan --- */
.app-settings-nav { position: sticky; top: calc(var(--ol-topbar-h) + 1.25rem); }
.app-settings-nav .list-group-item { border: 0; border-radius: var(--ol-radius-sm, 10px) !important; font-weight: 600; color: var(--ol-muted); display: flex; align-items: center; gap: .6rem; }
.app-settings-nav .list-group-item:hover { background: var(--ol-surface-2); color: var(--ol-text); }
.app-settings-nav .list-group-item.active { background: var(--ol-primary); color: #fff; }
.app-settings-section { scroll-margin-top: calc(var(--ol-topbar-h) + 1.25rem); }
.app-setting { padding: .95rem 0; border-top: 1px solid var(--ol-border); }
.app-setting:first-of-type { border-top: 0; padding-top: .2rem; }
.app-setting-label { font-weight: 700; font-size: .92rem; }
.app-setting-help { color: var(--ol-muted); font-size: .8rem; margin-bottom: .55rem; }
.app-setting .ol-option-group { margin-top: .35rem; max-width: 720px; }
.app-setting .ol-swatches { max-width: 440px; }
.app-section-icon {
    width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ol-surface-2); color: var(--ol-text); font-size: 1.1rem; flex-shrink: 0;
}
.ol-option-group.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ol-option-group.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 575.98px) { .ol-option-group.cols-4 { grid-template-columns: repeat(2, 1fr); } }

/* --- Ponsel --- */
@media (max-width: 575.98px) {
    .ol-no-sidebar .ol-navbar { gap: .25rem; }
    .ol-navbar [data-ol-palette] { display: none !important; }
    .app-profile { width: calc(100vw - 1.5rem); }
}

/* --- Lembar review (di halaman detail email) --- */
.rv { overflow: hidden; }
.rv-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border-bottom: 1px solid var(--ol-border); }
.rv-main { padding: 1.1rem 1.25rem; min-width: 0; }
.rv-kicker { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ol-muted); }
.rv-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; margin: .25rem 0 .7rem; }
.rv-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem 1rem; }
.rv-meta dt, .rv-cell dt { font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ol-muted); margin: 0; }
.rv-meta dd, .rv-cell dd { margin: 0; font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.rv-side { border-left: 1px solid var(--ol-border); display: grid; grid-template-rows: auto 1fr; }
.rv-verdict { padding: .9rem 1.1rem; display: flex; gap: .75rem; align-items: center; }
.rv-verdict i { font-size: 1.6rem; }
.rv-verdict .v { font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.rv-verdict.ok { background: rgba(var(--bs-success-rgb), .1); color: var(--bs-success); }
.rv-verdict.warn { background: rgba(var(--bs-warning-rgb), .14); color: #a15c00; }
.rv-verdict.bad { background: rgba(var(--bs-danger-rgb), .1); color: var(--bs-danger); }
[data-bs-theme="dark"] .rv-verdict.warn { color: var(--bs-warning); }
.rv-cells { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ol-border); }
.rv-cell { padding: .5rem .8rem; border-right: 1px solid var(--ol-border); border-bottom: 1px solid var(--ol-border); }
.rv-cell:nth-child(2n) { border-right: 0; }
.rv-cell:nth-last-child(-n+2) { border-bottom: 0; }
.rv-cell dd { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.rv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); border-bottom: 1px solid var(--ol-border); }
.rv-kpi { padding: .7rem 1.1rem; border-right: 1px solid var(--ol-border); display: flex; align-items: center; gap: .7rem; }
.rv-kpi:last-child { border-right: 0; display: block; }
.rv-kpi .n { font-size: 1.55rem; font-weight: 800; line-height: 1; }
.rv-kpi .l { font-size: .72rem; font-weight: 700; color: var(--ol-muted); text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; }
.rv-kpi.mayor .n { color: var(--bs-danger); } .rv-kpi.verif .n { color: #c77700; } .rv-kpi.minor .n { color: var(--ol-muted); }
.rv-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--ol-surface-2); margin: .45rem 0 .35rem; }
.rv-bar span { display: block; height: 100%; }
.rv-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .74rem; color: var(--ol-muted); }
.rv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .3rem; vertical-align: .05em; }
.bg-ok { background: var(--bs-success); } .bg-warn { background: #e39b16; } .bg-info2 { background: #6c8ebf; } .bg-bad { background: var(--bs-danger); }
.rv-summary { padding: .85rem 1.25rem; font-size: .9rem; display: grid; gap: .35rem; }
.rv-summary p { margin: 0; max-width: 110ch; }
.rv-summary .note { color: var(--ol-muted); font-size: .82rem; }
.rv-sec { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center;
    background: var(--ol-primary); color: #fff; font-size: .72rem; font-weight: 800; margin-right: .5rem; }
.rv-find { display: grid; grid-template-columns: 46px 1fr; gap: .1rem .7rem; padding: .6rem 1rem; border-top: 1px solid var(--ol-border); border-left: 3px solid #6c8ebf; }
.rv-find:first-child { border-top: 0; }
.rv-find.bad { border-left-color: var(--bs-danger); } .rv-find.warn { border-left-color: #e39b16; }
.rv-find .id { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; color: var(--ol-muted); padding-top: .12rem; }
.rv-find .t { font-weight: 700; font-size: .9rem; }
.rv-find .r { font-family: ui-monospace, Consolas, monospace; font-size: .7rem; color: var(--ol-muted); overflow-wrap: anywhere; }
.rv-find .d { font-size: .83rem; margin-top: .15rem; }
.rv-find .d b { color: var(--ol-text); }
.rv-table { font-size: .8rem; margin: 0; }
.rv-table th { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ol-muted); white-space: nowrap; }
.rv-table td { padding-top: .35rem; padding-bottom: .35rem; vertical-align: top; }
.rv-table .spec { color: var(--ol-muted); max-width: 420px; }
.rv-table .spec small { display: block; font-family: ui-monospace, Consolas, monospace; font-size: .68rem; }
.rv-st { font-size: .7rem; font-weight: 700; white-space: nowrap; }
.rv-st.sesuai { color: var(--bs-success); } .rv-st.verifikasi { color: #c77700; } .rv-st.visual { color: #6c8ebf; }
.rv-group { padding: .45rem 1rem; background: var(--ol-surface-2); font-size: .75rem; font-weight: 700; color: var(--ol-muted); cursor: pointer; list-style: none; display: flex; gap: .6rem; align-items: center; }
.rv-group::-webkit-details-marker { display: none; }
.rv-group .chev { transition: transform .15s; }
details[open] > .rv-group .chev { transform: rotate(90deg); }
.rv-actions { margin: 0; padding: .3rem 1rem .6rem 2.1rem; font-size: .84rem; }
.rv-actions li { padding: .3rem 0; }
.rv-who { font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ol-primary); }
.rv-draft { white-space: pre-wrap; font-family: inherit; font-size: .8rem; background: var(--ol-surface-2); border: 1px dashed var(--ol-border);
    border-radius: var(--ol-radius-sm, 10px); padding: .7rem .85rem; margin: 0; max-height: 360px; overflow: auto; }
.rv-doc { display: flex; gap: .6rem; padding: .55rem 1rem; border-top: 1px solid var(--ol-border); align-items: flex-start; }
.rv-doc:first-child { border-top: 0; }
.rv-doc .nm { font-weight: 600; font-size: .83rem; overflow-wrap: anywhere; }
.rv-doc .is { font-size: .75rem; color: var(--ol-muted); }
@media (max-width: 991.98px) {
    .rv-head { grid-template-columns: 1fr; }
    .rv-side { border-left: 0; border-top: 1px solid var(--ol-border); }
    .rv-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rv-kpis { grid-template-columns: repeat(3, 1fr); }
    .rv-kpi:last-child { grid-column: 1 / -1; border-top: 1px solid var(--ol-border); }
}
@media print {
    .ol-navbar, .ol-page-actions, .app-noprint, .breadcrumb { display: none !important; }
    .card { break-inside: avoid; box-shadow: none !important; }
    .col-xl-8, .col-xl-4 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
    details { display: block; } details > * { display: block !important; }
}

/* --- Arsip review Claude di dalam lembar (.cr) --- */
.rv-src { color: var(--ol-primary); font-weight: 800; }
.rv-tabs { padding: .55rem 1.25rem; border-top: 1px solid var(--ol-border); background: var(--ol-surface-2); }
.rv-tabs .nav-link { font-size: .82rem; font-weight: 700; padding: .35rem .85rem; color: var(--ol-muted); }
.rv-tabs .nav-link.active { background: var(--ol-primary); color: #fff; }
.cr .tbl-wrap { overflow-x: auto; }
.cr table { width: 100%; border-collapse: collapse; font-size: .8rem; margin: 0; }
.cr th { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ol-muted); font-weight: 700;
    background: var(--ol-surface-2); padding: .45rem .75rem; text-align: left; white-space: nowrap; }
.cr td { padding: .4rem .75rem; border-top: 1px solid var(--ol-border); vertical-align: top; }
.cr td.num, .cr .mono { font-family: ui-monospace, Consolas, monospace; font-size: .76rem; white-space: nowrap; }
.cr .sub { display: block; color: var(--ol-muted); font-size: .72rem; }
.cr .muted { color: var(--ol-muted); }
.cr .panel { padding: .75rem 1rem; }
.cr-body > p, .cr-body > div:not(.tbl-wrap) { padding: .6rem 1rem; margin: 0; }
.cr .pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 700; padding: .15rem .5rem;
    border-radius: 99px; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.cr .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cr .p-ok { color: var(--bs-success); background: rgba(var(--bs-success-rgb), .12); }
.cr .p-warn { color: #a15c00; background: rgba(var(--bs-warning-rgb), .18); }
.cr .p-bad { color: var(--bs-danger); background: rgba(var(--bs-danger-rgb), .1); }
.cr .p-info { color: #3d5a80; background: rgba(108, 142, 191, .15); }
.cr .who { font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ol-primary); }
.cr-stats .stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.cr-stats .stat { border: 1px solid var(--ol-border); border-radius: 10px; padding: .4rem .75rem; min-width: 120px; }
.cr-stats .stat .n { font-weight: 800; font-size: 1.1rem; display: block; }
.cr-stats .stat .d { font-size: .72rem; color: var(--ol-muted); }
@media print { .tab-content > .tab-pane { display: block !important; opacity: 1 !important; } }
