:root {
    --spri-red:    #cb241c;
    --spri-red2:   #e0332b;
    --spri-green:  #037716;
    --spri-yellow: #fdfd00;
    --spri-black:  #111111;
    --spri-white:  #ffffff;
    --spri-border: #e0e0e0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; color: var(--spri-black); }

#loadingScreen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, #0a0a15 0%, #111111 50%, #1a0505 100%); z-index: 99999; display: flex; align-items: center; justify-content: center; transition: opacity .5s ease, visibility .5s ease; }
#loadingScreen.hide { opacity: 0; visibility: hidden; }
.loading-content { text-align: center; animation: loadingPulse 2s ease-in-out infinite; }
@keyframes loadingPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.02)} }
.loading-logo { width: 100px; height: 100px; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; position: relative; }
.loading-logo::before { content: ''; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; border-radius: 24px; background: linear-gradient(135deg, #cb241c, #fdfd00, #037716, #cb241c); background-size: 300% 300%; animation: borderRotate 2s linear infinite; z-index: -1; }
@keyframes borderRotate { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
.loading-org { font-size:11px; color:rgba(255,255,255,.5); text-transform:uppercase; letter-spacing:2px; margin-bottom:4px; }
.loading-spri { font-size:36px; font-weight:900; letter-spacing:4px; margin-bottom:12px; background:linear-gradient(135deg,#cb241c,#fdfd00); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.loading-flag { display:flex; justify-content:center; gap:3px; margin-bottom:24px; }
.flag-red,.flag-white,.flag-green { width:32px; height:4px; border-radius:2px; }
.flag-red { background:#cb241c; animation:flagAnim 1.5s ease-in-out infinite; }
.flag-white { background:#fff; animation:flagAnim 1.5s ease-in-out .2s infinite; }
.flag-green { background:#037716; animation:flagAnim 1.5s ease-in-out .4s infinite; }
@keyframes flagAnim { 0%,100%{transform:scaleX(1);opacity:1} 50%{transform:scaleX(1.3);opacity:.7} }
.loading-bar-wrap { width:200px; height:4px; background:rgba(255,255,255,.1); border-radius:2px; margin:0 auto 12px; overflow:hidden; }
.loading-bar { height:100%; width:0%; background:linear-gradient(to right,#cb241c,#fdfd00,#037716); border-radius:2px; transition:width .3s ease; }
.loading-text { font-size:12px; color:rgba(255,255,255,.4); font-weight:600; letter-spacing:1px; transition:opacity .2s; }
.page-fade { animation: pageFadeIn .5s ease forwards; }
@keyframes pageFadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.topbar { background: var(--spri-black); padding: 7px 0; font-size: 12px; color: rgba(255,255,255,.7); border-bottom: 2px solid var(--spri-red); }
.topbar a { color: rgba(255,255,255,.7); text-decoration: none; transition:.15s }
.topbar a:hover { color: var(--spri-yellow); }
.topbar-social { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center; transition: .15s; cursor: pointer; }
.topbar-social:hover { background: var(--spri-red); }
.ticker-wrap { background: var(--spri-red); padding: 6px 0; display: flex; align-items: center; overflow: hidden; }
.ticker-label { background: var(--spri-black); color: var(--spri-yellow); font-size: 11px; font-weight: 800; padding: 4px 14px; white-space: nowrap; letter-spacing: 1px; flex-shrink: 0; }
.ticker-content { flex: 1; overflow: hidden; }
.ticker-text { animation: ticker 35s linear infinite; white-space: nowrap; font-size: 12px; color: #fff; font-weight: 600; display: inline-block; padding-left: 100%; }
@keyframes ticker { 0%{transform:translateX(0)} 100%{transform:translateX(-100%)} }
.site-header { background: var(--spri-white); border-bottom: 4px solid var(--spri-red); box-shadow: 0 2px 12px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 100; }
.site-name { font-size: 26px; font-weight: 900; color: var(--spri-red); letter-spacing: -0.5px; line-height: 1; }
.site-org { font-size: 11px; color: var(--spri-black); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.site-tagline { font-size: 12px; color: #666; margin-top: 2px; }
.header-badge { background: var(--spri-green); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.header-motto { font-size: 13px; color: #666; font-style: italic; margin-bottom: 6px; }
.header-search input { border-radius: 20px; padding-right: 40px; font-size: 13px; border: 1px solid #e0e0e0; transition: .2s; }
.header-search input:focus { border-color: var(--spri-red); box-shadow: 0 0 0 .2rem rgba(203,36,28,.15); }
.main-nav { background: var(--spri-red); border-bottom: 3px solid var(--spri-black); }
.main-nav .navbar-toggler { border-color: rgba(255,255,255,.4); }
.main-nav .navbar-toggler-icon { filter: invert(1); }
.main-nav .nav-link { color: rgba(255,255,255,.9) !important; font-size: 13px; font-weight: 600; padding: 12px 14px !important; border-bottom: 3px solid transparent; transition: .15s; display: flex; align-items: center; gap: 5px; }
.main-nav .nav-link:hover { color: var(--spri-yellow) !important; background: rgba(0,0,0,.15); border-bottom-color: var(--spri-yellow); }
.main-nav .nav-link.active { color: var(--spri-yellow) !important; background: rgba(0,0,0,.2); border-bottom-color: var(--spri-yellow); font-weight: 700; }
.nav-admin-btn { background: var(--spri-green) !important; border-radius: 8px !important; color: #fff !important; padding: 8px 16px !important; margin-left: 8px; border-bottom: none !important; }
.nav-admin-btn:hover { background: #025c10 !important; color: #fff !important; }
.page-content { min-height: calc(100vh - 300px); }
.card { border: 1px solid var(--spri-border); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); transition: .2s; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.card-header { background: #fff; font-weight: 700; border-bottom: 1px solid var(--spri-border); border-radius: 12px 12px 0 0 !important; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--spri-black); margin-bottom: 16px; }
.section-title::before { content: ''; width: 4px; height: 22px; background: linear-gradient(to bottom, var(--spri-red), var(--spri-green)); border-radius: 2px; display: inline-block; }
.badge-aktif { background: #eafaf1; color: #037716; }
.badge-pending { background: #fff8e1; color: #8a6000; }
.badge-nonaktif { background: #fef0f0; color: #cb241c; }
.badge-utama { background: #e8f4fd; color: #1a5f8a; }
.badge-madya { background: #f5f0ff; color: #6c3483; }
.badge-muda { background: #eafaf1; color: #037716; }
.btn-spri-red { background: var(--spri-red); color: #fff; border: none; font-weight: 700; transition: .15s; }
.btn-spri-red:hover { background: var(--spri-red2); color: #fff; transform: translateY(-1px); }
.btn-spri-green { background: var(--spri-green); color: #fff; border: none; font-weight: 700; }
.btn-spri-green:hover { background: #025c10; color: #fff; }
.agenda-date { width: 52px; height: 52px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.agenda-day { font-size: 20px; font-weight: 800; color: #fff; line-height: 1; }
.agenda-mon { font-size: 10px; color: rgba(255,255,255,.85); font-weight: 700; }
.stat-box { background: #fff; border-radius: 12px; border: 1px solid var(--spri-border); border-left: 4px solid var(--spri-red); padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.05); transition: .2s; }
.stat-box:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.form-control:focus, .form-select:focus { border-color: var(--spri-red); box-shadow: 0 0 0 .2rem rgba(203,36,28,.15); }
.form-label { font-size: 12px; font-weight: 700; color: #555; margin-bottom: 4px; }
.table thead th { background: #f9f9f9; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #666; border-bottom: 2px solid var(--spri-border); white-space: nowrap; }
.table tbody tr:hover td { background: #fafafa; }
.pagination .page-link { color: var(--spri-red); }
.pagination .page-item.active .page-link { background: var(--spri-red); border-color: var(--spri-red); }
.hero-section { background: linear-gradient(135deg, var(--spri-black) 0%, #2d0a09 60%, #1a0505 100%); position: relative; overflow: hidden; min-height: 400px; display: flex; align-items: center; }
.hero-stripe-red { position: absolute; top: 0; right: 0; width: 45%; height: 100%; background: var(--spri-red); clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%); opacity: .15; }
.hero-stripe-green { position: absolute; bottom: 0; left: 0; width: 100%; height: 5px; background: linear-gradient(to right, var(--spri-red) 33%, var(--spri-white) 33%, var(--spri-white) 66%, var(--spri-green) 66%); }
.hero-content { position: relative; z-index: 2; width: 100%; }
.site-footer { background: var(--spri-black); color: rgba(255,255,255,.75); font-size: 13px; border-top: 4px solid var(--spri-red); }
.site-footer h5 { color: #fff; font-weight: 800; margin-bottom: 16px; }
.site-footer a { color: rgba(255,255,255,.6); text-decoration: none; transition: .15s; }
.site-footer a:hover { color: var(--spri-yellow); }
.footer-divider { border: none; height: 1px; background: linear-gradient(to right, var(--spri-red), transparent, var(--spri-green)); margin: 8px 0 24px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: rgba(255,255,255,.4); background: rgba(0,0,0,.3); }
.alert-success { border-left: 4px solid var(--spri-green); }
.alert-danger { border-left: 4px solid var(--spri-red); }

/* ── BACK TO TOP ── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top-progress {
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
}
#progressCircle {
    transition: stroke-dashoffset .1s linear;
}
.back-to-top button {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #cb241c, #e74c3c);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(203,36,28,.4);
    transition: all .3s ease;
    z-index: 2;
}
.back-to-top button:hover {
    transform: translate(-50%, -55%);
    box-shadow: 0 8px 20px rgba(203,36,28,.5);
}
.back-to-top button:active {
    transform: translate(-50%, -48%) scale(.95);
}
.back-to-top-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 900;
    color: #cb241c;
    letter-spacing: 2px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s ease;
}
.back-to-top:hover .back-to-top-label {
    opacity: 1;
}

/* Bendera Indonesia mini dengan pulse */
.back-to-top::before {
    content: '';
    position: absolute;
    top: -4px; right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #cb241c 50%, #fff 50%);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
    z-index: 3;
    animation: pulseFlag 2s infinite;
}
@keyframes pulseFlag {
    0%,100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: .8; }
}

@media (max-width: 575px) {
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    .back-to-top-progress {
        width: 48px;
        height: 48px;
    }
    .back-to-top button {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}