/* ============================================================================
 * E-SWAKELOLA — Tema Visual Birokrasi Pengadaan Modern (LKPP Swakelola Tipe I)
 * Palet Warna:
 * - Deep Slate Navy : #0f172a / #1e293b (Sidebar & Header Berwibawa)
 * - Civic Blue      : #2563eb (PPK & Tim Persiapan)
 * - Emerald Teal    : #059669 (Selesai / Disetujui)
 * - Warm Amber      : #d97706 (Pelaksana BLU/BLUD/PTN)
 * - Cool Off-White  : #f8fafc (Latar Belakang Bersih)
 * ============================================================================ */

:root {
    --navy-950: #0f172a;
    --navy-900: #1e293b;
    --navy-800: #334155;
    --civic-blue: #2563eb;
    --civic-blue-dark: #1d4ed8;
    --civic-blue-soft: #eff6ff;
    --emerald-teal: #059669;
    --emerald-soft: #ecfdf5;
    --warm-amber: #d97706;
    --amber-soft: #fffbeb;
    --bg-surface: #f8fafc;
    --card-bg: #ffffff;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --sidebar-width: 272px;
    --topbar-height: 66px;
    --card-radius: 12px;
    --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14.5px;
    line-height: 1.55;
    min-height: 100vh;
}

/* Tipografi Monospace Tabular untuk Kode Paket, Nomor Surat, NPWP, Nominal, & Progres */
.font-mono,
.mono-num {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
 * LAYOUT UTAMA (SIDEBAR + MAIN WORKSPACE)
 * ============================================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--navy-950) 0%, #131f35 100%);
    color: #cbd5e1;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--civic-blue) 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.sidebar-brand-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: #ffffff;
}

.sidebar-brand-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 10px;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #64748b;
    padding: 12px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.89rem;
    transition: all 0.18s ease;
    position: relative;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.18s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.sidebar-link:hover i {
    color: #ffffff;
}

.sidebar-link.active {
    background: rgba(37, 99, 235, 0.2);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--civic-blue);
}

.sidebar-link.active i {
    color: #60a5fa;
}

.sidebar-link.active-pelaksana {
    background: rgba(217, 119, 6, 0.2);
    box-shadow: inset 3px 0 0 var(--warm-amber);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
}

.sidebar-user-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--navy-800);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-content {
    flex: 1;
    padding: 26px 28px 36px;
}

.app-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-subtle);
    padding: 14px 28px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Backdrop untuk sidebar mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

/* ============================================================================
 * KOMPONEN KARTU, BADGE, TOMBOL, & TABEL
 * ============================================================================ */
.card-clean {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}

.card-clean .card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-clean .card-body {
    padding: 20px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon-navy    { background: #f1f5f9; color: var(--navy-950); }
.stat-icon-blue    { background: var(--civic-blue-soft); color: var(--civic-blue); }
.stat-icon-emerald { background: var(--emerald-soft); color: var(--emerald-teal); }
.stat-icon-amber   { background: var(--amber-soft); color: var(--warm-amber); }

/* Role & Stage Badges */
.badge {
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 6px;
    font-size: 0.76rem;
}

.badge-role-admin {
    background: #e2e8f0;
    color: var(--navy-950);
}

.badge-role-ppk {
    background: var(--civic-blue-soft);
    color: var(--civic-blue);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-role-pelaksana {
    background: var(--amber-soft);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-stage-draft {
    background: #f1f5f9;
    color: #475569;
}
.badge-stage-ppk {
    background: var(--civic-blue-soft);
    color: var(--civic-blue);
}
.badge-stage-pelaksana {
    background: var(--amber-soft);
    color: #b45309;
}
.badge-stage-done {
    background: var(--emerald-soft);
    color: var(--emerald-teal);
}

/* Tombol kustom sesuai palet */
.btn-primary {
    background-color: var(--civic-blue);
    border-color: var(--civic-blue);
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--civic-blue-dark);
    border-color: var(--civic-blue-dark);
}

.btn-emerald {
    background-color: var(--emerald-teal);
    border-color: var(--emerald-teal);
    color: #ffffff;
    font-weight: 600;
}
.btn-emerald:hover {
    background-color: #047857;
    border-color: #047857;
    color: #ffffff;
}

.btn-amber {
    background-color: var(--warm-amber);
    border-color: var(--warm-amber);
    color: #ffffff;
    font-weight: 600;
}
.btn-amber:hover {
    background-color: #b45309;
    border-color: #b45309;
    color: #ffffff;
}

.btn-navy {
    background-color: var(--navy-950);
    border-color: var(--navy-950);
    color: #ffffff;
    font-weight: 600;
}
.btn-navy:hover {
    background-color: var(--navy-900);
    border-color: var(--navy-900);
    color: #ffffff;
}

/* Tabel profesional */
.table-clean {
    margin-bottom: 0;
}
.table-clean thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 14px;
    white-space: nowrap;
}
.table-clean tbody td {
    padding: 13px 14px;
    vertical-align: middle;
    border-color: #f1f5f9;
}

/* Progress bar 11 dokumen */
.progress-doc {
    height: 8px;
    border-radius: 999px;
    background-color: #e2e8f0;
    overflow: hidden;
}
.progress-doc .progress-bar-emerald {
    background-color: var(--emerald-teal);
}
.progress-doc .progress-bar-civic {
    background-color: var(--civic-blue);
}
.progress-doc .progress-bar-amber {
    background-color: var(--warm-amber);
}

/* ============================================================================
 * HALAMAN LOGIN (SPLIT AUTHORITATIVE PORTAL)
 * ============================================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 980px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.35);
    display: grid;
    grid-template-columns: 1.08fr 1fr;
}

.login-brand-panel {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 65%, #172554 100%);
    color: #e2e8f0;
    padding: 42px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.login-brand-panel > * {
    position: relative;
    z-index: 1;
}

.login-form-panel {
    padding: 42px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.login-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.login-feature-dot {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.form-control, .form-select {
    border-color: #cbd5e1;
    border-radius: 8px;
    padding: 0.58rem 0.85rem;
    font-size: 0.92rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--civic-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* ============================================================================
 * RESPONSIF (TABLET & MOBILE)
 * ============================================================================ */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .app-main {
        margin-left: 0;
    }
    .app-topbar {
        padding: 0 16px;
    }
    .app-content {
        padding: 18px 16px 28px;
    }
    .app-footer {
        padding: 14px 16px;
    }
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
    .login-brand-panel {
        padding: 28px 24px;
    }
    .login-form-panel {
        padding: 28px 24px;
    }
}
