/*
 * Papastro Framework — Main Application Styles & DISPMI Design System
 * created by kangpcode (Dhafa Nazula Permadi)
 * Free to use & extend. This watermark must remain in source code.
 */

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand & Palette (White, Blue, Red) */
    --color-white:         #FFFFFF;
    --color-bg:            #F6F8FC;
    --color-surface:       #FFFFFF;
    --color-surface-muted: #F1F5F9;

    --color-blue-950:      #072A66;
    --color-blue-900:      #0B3D91;
    --color-blue-800:      #0F4BB3;
    --color-blue-600:      #1F6FEB;
    --color-blue-100:      #D2E3FC;
    --color-blue-50:       #E8F0FE;

    --color-red-700:       #B01E2D;
    --color-red-600:       #D62839;
    --color-red-100:       #FAD2D7;
    --color-red-50:        #FDECEE;

    /* Neutrals & Borders */
    --color-text:          #0F172A;
    --color-text-muted:    #475569;
    --color-text-subtle:   #64748B;
    --color-border:        #E2E8F0;
    --color-border-strong: #CBD5E1;

    /* Semantic Status Tokens (paired with icons + labels) */
    --color-success:       #15803D;
    --color-success-bg:    #DCFCE7;
    --color-success-border:#86EFAC;
    --color-warning:       #B45309;
    --color-warning-bg:    #FEF3C7;
    --color-warning-border:#FCD34D;
    --color-danger:        #D62839;
    --color-danger-bg:     #FDECEE;
    --color-danger-border: #F5B7BE;
    --color-info:          #0B3D91;
    --color-info-bg:       #E8F0FE;
    --color-info-border:   #BFDBFE;

    /* Legacy / Alias Tokens */
    --color-primary:       var(--color-blue-900);
    --color-primary-h:     var(--color-blue-600);
    --color-accent:        var(--color-red-600);
    --color-accent-h:      var(--color-red-700);
    --color-muted:         var(--color-text-muted);

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-sans:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Spacing Scale */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Layout Dimensions */
    --container-width:    1200px;
    --navbar-height:      68px;
    --sidebar-width:      264px;
    --sidebar-collapsed:  76px;
    --topbar-height:      64px;
    --bottom-nav-height:  64px;
    --touch-target-min:   44px;

    /* Radius */
    --radius-sm:   6px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 9999px;

    /* Layered Subtle Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(11, 61, 145, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px rgba(11, 61, 145, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-base: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

code, pre, .font-mono, .doc-code {
    font-family: var(--font-mono);
}

a {
    color: var(--color-blue-600);
}

/* Accessible Keyboard Focus Ring */
:focus-visible {
    outline: 2px solid var(--color-blue-600);
    outline-offset: 2px;
}

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

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    z-index: 2000;
    background: var(--color-blue-900);
    color: var(--color-white);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    top: var(--space-3);
}

/* ── Signature Motif: Diagonal Blue-Red Ribbon ──────────────────── */
.dispmi-ribbon {
    height: 4px;
    width: 100%;
    background: repeating-linear-gradient(
        135deg,
        var(--color-blue-900) 0px,
        var(--color-blue-900) 18px,
        var(--color-blue-600) 18px,
        var(--color-blue-600) 24px,
        var(--color-white) 24px,
        var(--color-white) 27px,
        var(--color-red-600) 27px,
        var(--color-red-600) 39px,
        var(--color-white) 39px,
        var(--color-white) 42px
    );
    flex-shrink: 0;
}

.dispmi-ribbon--lg {
    height: 6px;
}

/* ── Brand Wordmark & PPEPP Ring ────────────────────────────────── */
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
}

.brand-mark--light {
    color: var(--color-white);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

.brand-mark--light .brand-sub {
    color: rgba(255, 255, 255, 0.78);
}

.ppepp-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ppepp-ring-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.ppepp-ring-legend {
    list-style: none;
    display: grid;
    gap: var(--space-2);
}

.ppepp-ring-legend li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    color: var(--color-text-muted);
}

.ppepp-ring-legend li.is-active {
    color: var(--color-text);
    font-weight: 700;
}

.ppepp-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-blue-900);
    flex-shrink: 0;
}

.ppepp-ring-legend li.is-active .ppepp-dot {
    background: var(--color-red-600);
    box-shadow: 0 0 0 3px var(--color-red-50);
}

/* ── Container & Grid Utilities ─────────────────────────────────── */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-6);
    }
}

.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

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

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

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--touch-target-min);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
}

@media (max-width: 767px) {
    .btn-sm {
        min-height: var(--touch-target-min);
    }
}

.btn-lg {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* Primary: Structural Blue */
.btn-primary {
    background-color: var(--color-blue-900);
    color: var(--color-white);
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
    background-color: var(--color-blue-800);
    box-shadow: var(--shadow-sm);
}

/* Accent / Critical CTA: Red */
.btn-accent,
.btn-danger {
    background-color: var(--color-red-600);
    color: var(--color-white);
    box-shadow: var(--shadow-xs);
}

.btn-accent:hover,
.btn-danger:hover {
    background-color: var(--color-red-700);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background-color: var(--color-surface);
    color: var(--color-blue-900);
    border-color: var(--color-border-strong);
}

.btn-outline:hover {
    background-color: var(--color-blue-50);
    border-color: var(--color-blue-600);
}

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

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

.btn-icon {
    width: var(--touch-target-min);
    min-width: var(--touch-target-min);
    padding: 0;
}

/* ── Form Inputs & Fields ───────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-4);
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.field-required {
    color: var(--color-red-600);
    font-weight: 700;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: var(--touch-target-min);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.textarea {
    min-height: 96px;
    resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--color-text-subtle);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--color-blue-600);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--color-blue-600);
    box-shadow: 0 0 0 3px var(--color-blue-50);
}

.input.is-mono {
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
    border-color: var(--color-red-600);
    background-color: #FFFDFD;
}

.field.has-error .input:focus,
.field.has-error .select:focus,
.field.has-error .textarea:focus {
    box-shadow: 0 0 0 3px var(--color-red-50);
}

.field-help {
    font-size: 12px;
    color: var(--color-text-muted);
}

.field-error {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-red-700);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-3) var(--space-5);
    background-color: var(--color-surface-muted);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ── Status Badges (Never color-only: icon + label) ─────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge--neutral {
    background-color: var(--color-surface-muted);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.badge--info {
    background-color: var(--color-info-bg);
    color: var(--color-info);
    border-color: var(--color-info-border);
}

.badge--success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.badge--warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border-color: var(--color-warning-border);
}

.badge--danger {
    background-color: var(--color-danger-bg);
    color: var(--color-red-700);
    border-color: var(--color-danger-border);
}

.badge--solid-blue {
    background-color: var(--color-blue-900);
    color: var(--color-white);
}

.badge--solid-red {
    background-color: var(--color-red-600);
    color: var(--color-white);
}

/* ── Alerts / Error Banner ──────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    font-size: 14px;
}

.alert--info    { background: var(--color-info-bg); border-color: var(--color-info-border); color: var(--color-blue-950); }
.alert--success { background: var(--color-success-bg); border-color: var(--color-success-border); color: #14532D; }
.alert--warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: #78350F; }
.alert--danger  { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: #7F1D1D; }

.alert-title {
    font-weight: 700;
    margin-bottom: 2px;
}

/* ── Responsive Data Table (Desktop Table -> Mobile Cards) ──────── */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dispmi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.dispmi-table thead th {
    background-color: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.dispmi-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

.dispmi-table tbody tr:last-child td {
    border-bottom: none;
}

.dispmi-table tbody tr:hover {
    background-color: #F8FAFF;
}

@media (max-width: 767px) {
    .table-wrap--responsive {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    .table-wrap--responsive .dispmi-table thead {
        display: none;
    }

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

    .table-wrap--responsive .dispmi-table tbody tr {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        padding: var(--space-3) var(--space-4);
        margin-bottom: var(--space-3);
    }

    .table-wrap--responsive .dispmi-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        padding: 8px 0;
        border-bottom: 1px dashed var(--color-border);
        text-align: right;
    }

    .table-wrap--responsive .dispmi-table tbody td:last-child {
        border-bottom: none;
        padding-bottom: 2px;
    }

    .table-wrap--responsive .dispmi-table tbody td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        color: var(--color-text-muted);
        text-align: left;
        flex-shrink: 0;
    }
}

/* ── Modal, Drawer & Bottom Sheet ───────────────────────────────── */
.ui-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(2px);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.ui-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.dispmi-modal {
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px) scale(0.98);
    transition: transform var(--transition-base);
}

.ui-backdrop.is-open .dispmi-modal {
    transform: translateY(0) scale(1);
}

.ui-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.ui-panel-body {
    padding: var(--space-5);
    overflow-y: auto;
}

.ui-panel-footer {
    padding: var(--space-3) var(--space-5);
    background: var(--color-surface-muted);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* Drawer: Side panel on desktop, full screen with back button on mobile */
.ui-backdrop--drawer {
    justify-content: flex-end;
    padding: 0;
}

.dispmi-drawer {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-base);
}

.ui-backdrop.is-open .dispmi-drawer {
    transform: translateX(0);
}

.drawer-mobile-back {
    display: none;
}

@media (max-width: 767px) {
    .dispmi-drawer {
        max-width: 100%;
    }
    .drawer-mobile-back {
        display: inline-flex;
    }
}

/* Bottom Sheet */
.ui-backdrop--sheet {
    align-items: flex-end;
    padding: 0;
}

@media (min-width: 768px) {
    .ui-backdrop--sheet {
        align-items: center;
        padding: var(--space-4);
    }
}

.dispmi-sheet {
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform var(--transition-base);
}

@media (min-width: 768px) {
    .dispmi-sheet {
        border-radius: var(--radius-lg);
        transform: translateY(16px);
    }
}

.ui-backdrop.is-open .dispmi-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-border-strong);
    margin: 10px auto 4px;
}

/* ── Toast Stack ────────────────────────────────────────────────── */
.dispmi-toast-stack {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 380px;
    width: calc(100% - 32px);
    pointer-events: none;
}

@media (max-width: 767px) {
    .dispmi-toast-stack {
        bottom: calc(var(--bottom-nav-height) + var(--space-3));
        right: var(--space-4);
        left: var(--space-4);
        width: auto;
        max-width: none;
    }
}

.dispmi-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-blue-900);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: toastIn 0.2s ease both;
}

.dispmi-toast--success { border-left-color: var(--color-success); }
.dispmi-toast--warning { border-left-color: var(--color-warning); }
.dispmi-toast--danger  { border-left-color: var(--color-red-600); }

.dispmi-toast-title {
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px;
}

.dispmi-toast-msg {
    color: var(--color-text-muted);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty State & Skeleton Loader ──────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    background: var(--color-surface);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.empty-state-title {
    font-size: 17px;
    font-weight: 700;
}

.empty-state-desc {
    max-width: 420px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: skeletonShimmer 1.4s ease-in-out infinite;
}

.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line--title { height: 22px; width: 55%; margin-bottom: 14px; }
.skeleton-line--short { width: 35%; }
.skeleton-box { height: 96px; border-radius: var(--radius-lg); }

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Public Navbar & Layout ─────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.navbar {
    height: var(--navbar-height);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-4);
}

.navbar-links {
    display: none;
    align-items: center;
    gap: var(--space-2);
}

@media (min-width: 1024px) {
    .navbar-links {
        display: flex;
    }
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-target-min);
    padding: 8px 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--color-blue-900);
    background-color: var(--color-blue-50);
}

.navbar-mobile-trigger {
    display: inline-flex;
}

@media (min-width: 1024px) {
    .navbar-mobile-trigger {
        display: none;
    }
}

.main-content {
    min-height: calc(100vh - var(--navbar-height) - 120px);
}

.site-footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: var(--space-8) 0;
    color: var(--color-text-muted);
    font-size: 13px;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ── Authenticated App Shell (Desktop Sidebar + Mobile Bottom Nav) ─ */
.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--color-bg);
}

.app-sidebar {
    display: none;
}

.app-main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.app-topbar-inner {
    height: var(--topbar-height);
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.app-search {
    display: none;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0 var(--space-3);
    min-height: 40px;
    width: 100%;
    max-width: 380px;
}

.app-search input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    color: var(--color-text);
    outline: none;
}

.app-content {
    padding: var(--space-4);
    flex: 1;
}

@media (min-width: 1024px) {
    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-width);
        background: var(--color-blue-900);
        color: var(--color-white);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        transition: width var(--transition-base);
        border-right: 1px solid var(--color-blue-950);
    }

    body.sidebar-collapsed .app-sidebar {
        width: var(--sidebar-collapsed);
    }

    body.sidebar-collapsed .sidebar-label,
    body.sidebar-collapsed .sidebar-section-title,
    body.sidebar-collapsed .brand-text {
        display: none;
    }

    .app-main-wrap {
        padding-bottom: 0;
    }

    .app-topbar-inner {
        padding: 0 var(--space-6);
    }

    .app-search {
        display: flex;
    }

    .app-content {
        padding: var(--space-6);
    }
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.58);
    padding: var(--space-3) var(--space-3) var(--space-1);
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--touch-target-min);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-white);
}

.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.16);
    color: var(--color-white);
    font-weight: 600;
}

.sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--color-red-600);
}

.sidebar-footer {
    padding: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Mobile Bottom Navigation (< 768px / < 1024px compact) */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-height);
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 950;
}

@media (min-width: 1024px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--touch-target-min);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.bottom-nav-item.is-active {
    color: var(--color-red-600);
}

.mobile-fab {
    position: fixed;
    right: var(--space-4);
    bottom: calc(var(--bottom-nav-height) + var(--space-4));
    z-index: 940;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    background: var(--color-red-600);
    color: var(--color-white);
    border: none;
    box-shadow: var(--shadow-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

@media (min-width: 1024px) {
    .mobile-fab {
        display: none;
    }
}

/* ── Auth Split Layout ──────────────────────────────────────────── */
.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--color-bg);
}

@media (min-width: 1024px) {
    .auth-split {
        grid-template-columns: 5fr 6fr;
    }
}

.auth-brand-panel {
    display: none;
    background: linear-gradient(155deg, var(--color-blue-950) 0%, var(--color-blue-900) 65%, #164DA8 100%);
    color: var(--color-white);
    padding: var(--space-12);
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .auth-brand-panel {
        display: flex;
    }
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-6);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ── Error & Offline Pages ──────────────────────────────────────── */
.status-page {
    min-height: calc(100vh - var(--navbar-height) - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
}

.status-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.status-code {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 700;
    color: var(--color-blue-900);
    line-height: 1;
}

/* ── Papastro Island & Legacy View Support ──────────────────────── */
.papastro-island {
    display: inline-block;
    min-height: 44px;
}

.papastro-island-loading {
    width: 120px;
    height: 40px;
    background: var(--color-surface-muted);
    border-radius: var(--radius-md);
    margin: 12px auto;
}

.blog-header {
    padding: var(--space-10) 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-8);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-10);
}

.post-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-blue-600);
}

/* ── Landing, KPI Strip, FAQ & Auth Mobile Header ───────────────── */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

@media (max-width: 767px) {
    .kpi-strip {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--space-3);
        padding-bottom: var(--space-2);
        -webkit-overflow-scrolling: touch;
    }
    .kpi-strip > .kpi-card {
        min-width: 230px;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

.kpi-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 6px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--color-blue-900);
    line-height: 1.1;
}

.kpi-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.faq-list {
    display: grid;
    gap: var(--space-3);
}

.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-xs);
}

.faq-item summary {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: var(--touch-target-min);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item[open] summary {
    color: var(--color-blue-900);
    margin-bottom: var(--space-2);
}

.faq-item p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.auth-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    width: 100%;
    max-width: 440px;
}

@media (min-width: 1024px) {
    .auth-mobile-brand {
        display: none;
    }
}

.ppepp-step-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-blue-900);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: var(--space-2);
}

.ppepp-step-card.is-highlight {
    border-top-color: var(--color-red-600);
}

/* ── Checklist Evaluasi: Desktop Split / Mobile Single-Item ─────── */
.eval-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    align-items: start;
}

.eval-items-panel {
    display: none;
}

.eval-mobile-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
}

@media (min-width: 1024px) {
    .eval-workspace {
        grid-template-columns: 340px 1fr;
        gap: var(--space-5);
    }
    .eval-items-panel {
        display: grid;
        gap: var(--space-2);
        max-height: 75vh;
        overflow-y: auto;
    }
    .eval-mobile-stepper {
        display: none;
    }
}

.eval-item-link {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-decoration: none;
    color: var(--color-text);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.eval-item-link:hover {
    border-color: var(--color-blue-600);
}

.eval-item-link.is-active {
    border-color: var(--color-blue-900);
    border-left: 4px solid var(--color-red-600);
    background: var(--color-blue-50);
}

/* ── Reduced Motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
