/* ===========================================================
   SICAPKIN — Sistem Informasi Capaian Kinerja
   Kantor Kementerian Agama Kabupaten Sumenep
   =========================================================== */

:root {
    --sicap-green-dark: #073B2C;
    --sicap-green: #0B6E4F;
    --sicap-green-light: #E7F3EC;
    --sicap-gold: #C99A2E;
    --sicap-bg: #F5F7F3;
    --sicap-text: #1E2B25;
    --sicap-muted: #6B7A72;
    --sicap-white: #FFFFFF;
    --sicap-danger: #B3261E;
    --sicap-radius: 14px;
    --font-display: 'Poppins', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    background: var(--sicap-bg);
    color: var(--sicap-text);
    font-family: var(--font-body);
    margin: 0;
}

h1, h2, h3, h4, h5, .brand-font {
    font-family: var(--font-display);
    color: var(--sicap-green-dark);
}

a { color: var(--sicap-green); text-decoration: none; }
a:hover { color: var(--sicap-green-dark); }

/* ---------- Topbar (public) ---------- */
.public-nav {
    background: var(--sicap-green-dark);
    color: var(--sicap-white);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.public-nav .brand { display: flex; align-items: center; gap: 12px; }
.public-nav .brand img { height: 38px; }
.public-nav .brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.public-nav .btn-masuk {
    background: var(--sicap-gold);
    color: var(--sicap-green-dark);
    padding: 8px 22px;
    border-radius: 30px;
    font-weight: 600;
    font-size: .9rem;
}
.public-nav .btn-masuk:hover { background: #DDB146; color: var(--sicap-green-dark); }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(160deg, var(--sicap-green-dark) 0%, var(--sicap-green) 100%);
    color: var(--sicap-white);
    padding: 72px 32px 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -120px; top: -120px;
    width: 360px; height: 360px;
    border-radius: 50%;
    background: rgba(201,154,46,0.12);
}
.hero img.logo { height: 78px; margin-bottom: 18px; }
.hero .eyebrow {
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .78rem;
    color: var(--sicap-gold);
    font-weight: 600;
}
.hero h1 {
    color: var(--sicap-white);
    font-size: 2.4rem;
    font-weight: 700;
    margin: 10px 0 6px;
}
.hero p.tagline { font-size: 1.05rem; color: #DDEAE2; max-width: 560px; margin: 0 auto 28px; }
.hero .btn-hero {
    display: inline-block;
    background: var(--sicap-gold);
    color: var(--sicap-green-dark);
    padding: 13px 38px;
    border-radius: 30px;
    font-weight: 700;
    letter-spacing: .03em;
    font-size: .95rem;
    box-shadow: 0 12px 24px -8px rgba(0,0,0,.35);
}
.hero .btn-hero:hover { background: #DDB146; transform: translateY(-1px); }

/* ---------- Progress section ---------- */
.progress-section {
    max-width: 980px;
    margin: -50px auto 60px;
    background: var(--sicap-white);
    border-radius: var(--sicap-radius);
    box-shadow: 0 20px 40px -20px rgba(7,59,44,.25);
    padding: 32px;
    position: relative;
    z-index: 2;
}
.progress-section .section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.progress-section .section-sub { color: var(--sicap-muted); font-size: .88rem; margin-bottom: 20px; }

table.capaian-table { width: 100%; border-collapse: collapse; }
table.capaian-table th {
    text-align: left;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sicap-muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--sicap-green-light);
}
table.capaian-table td { padding: 12px; border-bottom: 1px solid #EEF2EF; font-size: .92rem; }
table.capaian-table tr:last-child td { border-bottom: none; }

.bar-track { background: var(--sicap-green-light); border-radius: 20px; height: 10px; width: 140px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar-fill { background: var(--sicap-green); height: 100%; border-radius: 20px; }
.persen-tag { font-weight: 700; margin-left: 8px; color: var(--sicap-green-dark); }

footer.public-footer {
    text-align: center;
    padding: 24px;
    color: var(--sicap-muted);
    font-size: .82rem;
}

/* ---------- Auth (login) ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--sicap-green-dark) 0%, var(--sicap-green) 100%);
    padding: 24px;
}
.auth-card {
    background: var(--sicap-white);
    border-radius: var(--sicap-radius);
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.4);
    text-align: center;
}
.auth-card img.logo { height: 56px; margin-bottom: 12px; }
.auth-card h1 { font-size: 1.25rem; margin: 0 0 4px; }
.auth-card p.sub { color: var(--sicap-muted); font-size: .85rem; margin-bottom: 24px; }
.auth-card .form-control { text-align: left; }
.auth-card label { text-align: left; display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--sicap-text); }
.auth-card .mb-3 { margin-bottom: 16px; }
.btn-login {
    background: var(--sicap-green);
    color: var(--sicap-white);
    border: none;
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.btn-login:hover { background: var(--sicap-green-dark); }
.demo-creds { margin-top: 22px; font-size: .76rem; color: var(--sicap-muted); text-align: left; background: var(--sicap-green-light); padding: 12px 14px; border-radius: 8px; }

/* ---------- App shell (logged in) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: var(--sicap-green-dark);
    color: #DDEAE2;
    padding: 20px 0;
    flex-shrink: 0;
}
.sidebar .brand { padding: 0 22px 22px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.sidebar .brand img { height: 32px; }
.sidebar .brand span { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: .95rem; }
.sidebar .role-tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sicap-gold); padding: 0 22px 14px; display: block; }
.sidebar a.nav-link {
    display: flex; align-items: center; gap: 10px;
    color: #DDEAE2; padding: 11px 22px; font-size: .9rem;
    border-left: 3px solid transparent;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.nav-link.active { background: rgba(255,255,255,.1); border-left-color: var(--sicap-gold); color: #fff; font-weight: 600; }
.sidebar .nav-section-label { padding: 16px 22px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); }

.main-content { flex: 1; min-width: 0; }
.topbar {
    background: var(--sicap-white);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #E6EAE6;
}
.topbar .page-title { font-weight: 700; font-size: 1.05rem; color: var(--sicap-green-dark); }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.topbar .user-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--sicap-green-light); color: var(--sicap-green-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.content-area { padding: 26px 28px; }

.card-stat {
    background: var(--sicap-white);
    border-radius: var(--sicap-radius);
    padding: 20px 22px;
    box-shadow: 0 8px 20px -12px rgba(7,59,44,.15);
}
.card-stat .label { font-size: .78rem; color: var(--sicap-muted); text-transform: uppercase; letter-spacing: .04em; }
.card-stat .value { font-size: 1.8rem; font-weight: 700; color: var(--sicap-green-dark); margin-top: 4px; }

.panel {
    background: var(--sicap-white);
    border-radius: var(--sicap-radius);
    box-shadow: 0 8px 20px -12px rgba(7,59,44,.12);
    padding: 22px;
    margin-bottom: 22px;
}
.panel .panel-title { font-weight: 700; color: var(--sicap-green-dark); margin-bottom: 16px; font-size: 1rem; }

table.table-sicap { width: 100%; border-collapse: collapse; }
table.table-sicap th {
    background: var(--sicap-green-light);
    color: var(--sicap-green-dark);
    text-align: left; font-size: .78rem; padding: 10px 12px;
    text-transform: uppercase; letter-spacing: .03em;
}
table.table-sicap td { padding: 11px 12px; border-bottom: 1px solid #EEF2EF; font-size: .88rem; vertical-align: top; }
table.table-sicap tr:hover td { background: #FAFCFA; }

.badge-pct { padding: 3px 10px; border-radius: 20px; font-weight: 700; font-size: .78rem; }
.badge-pct.good { background: #E1F3E5; color: #1B7A3D; }
.badge-pct.warn { background: #FCF0DA; color: #9A6700; }
.badge-pct.bad { background: #FBE3E1; color: var(--sicap-danger); }

.badge-status { padding: 3px 10px; border-radius: 20px; font-size: .76rem; font-weight: 600; }
.badge-status.sudah { background: #E1F3E5; color: #1B7A3D; }
.badge-status.belum { background: #FBE3E1; color: var(--sicap-danger); }

.btn-sicap {
    display: inline-block;
    background: var(--sicap-green);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-sicap:hover { background: var(--sicap-green-dark); }
.btn-sicap.outline { background: transparent; color: var(--sicap-green) !important; border: 1px solid var(--sicap-green); }
.btn-sicap.outline:hover { background: var(--sicap-green-light); }
.btn-sicap.danger { background: var(--sicap-danger); }
.btn-sicap.gold { background: var(--sicap-gold); color: var(--sicap-green-dark) !important; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.form-control, select.form-control, textarea.form-control {
    width: 100%; padding: 9px 12px; border-radius: 8px;
    border: 1px solid #D8DED9; font-size: .9rem; font-family: var(--font-body);
}
.form-control:focus { outline: 2px solid var(--sicap-green); border-color: var(--sicap-green); }

.alert-sicap { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: .88rem; }
.alert-sicap.success { background: #E1F3E5; color: #1B7A3D; }
.alert-sicap.error { background: #FBE3E1; color: var(--sicap-danger); }

.print-only { display: none; }

@media print {
    .no-print { display: none !important; }
    .print-only { display: block; }
}

@media (max-width: 860px) {
    .sidebar { display: none; }
    .content-area { padding: 18px; }
}

/* ---------- Landing (beranda + login digabung) ---------- */
.landing-body { margin: 0; }
.landing-shell {
    min-height: 100vh;
    background:
        linear-gradient(
            160deg,
            rgba(7,59,44,0.82) 0%,
            rgba(11,110,79,0.72) 50%,
            rgba(7,59,44,0.85) 100%
        ),
        url('../img/bg-kantor.jpg') center center / cover no-repeat fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 20px 32px;
}

.landing-title-wrap { text-align: center; margin-bottom: 30px; }
.landing-script {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    font-weight: 700;
    color: var(--sicap-gold);
    text-shadow: 0 4px 18px rgba(0,0,0,.35);
    line-height: 1;
}
.landing-tagline {
    margin-top: 8px;
    color: #CFE7DC;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .8rem;
    font-weight: 600;
}

.landing-panels {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 1000px;
    background: rgba(7,59,44,0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,.65);
    overflow: hidden;
}

.login-panel {
    background: var(--sicap-white);
    flex: 0 0 340px;
    padding: 38px 32px;
    text-align: center;
}
.login-panel img.logo { height: 56px; margin-bottom: 10px; }
.login-panel h2 { font-size: 1.1rem; margin: 4px 0 2px; letter-spacing: .02em; }
.login-panel p.sub { color: var(--sicap-muted); font-size: .82rem; margin-bottom: 22px; }
.login-panel label { text-align: left; display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.login-panel .mb-3 { margin-bottom: 14px; }
.login-panel .demo-creds { margin-top: 18px; font-size: .74rem; }

.progress-panel {
    flex: 1;
    padding: 34px 36px;
    color: #EAF3EE;
}
.progress-panel-head { margin-bottom: 18px; }
.progress-panel-title { font-size: 1.05rem; font-weight: 700; color: #fff; font-family: var(--font-display); }
.progress-panel-sub { font-size: .8rem; color: #BFE0CF; margin-top: 2px; }

.progress-panel-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.progress-chart-wrap { width: 100%; }
.progress-legend { display: none; }

/* ---- Histogram vertikal custom ---- */
.histogram-wrap {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 220px;
    padding-bottom: 0;
    border-bottom: 2px solid rgba(255,255,255,.12);
    margin-bottom: 0;
    overflow-x: auto;
}
.hist-col {
    flex: 1;
    min-width: 36px;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.hist-pct-top {
    font-size: .62rem;
    font-weight: 700;
    color: #EAF3EE;
    margin-bottom: 3px;
    text-align: center;
    white-space: nowrap;
}
.hist-bar-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: flex-end;
}
.hist-bar {
    width: 100%;
    height: 0;
    background: var(--bar-color, #2ECC71);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    position: relative;
    transition: height .7s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 -4px 16px -4px rgba(0,0,0,.25);
    overflow: hidden;
}
.hist-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 35%;
    background: linear-gradient(to bottom, rgba(255,255,255,.25), transparent);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}
.hist-bar--animate {
    height: var(--bar-h, 0%);
}
.hist-bar-inner-pct {
    font-size: .65rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.35);
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity .3s ease .5s;
    white-space: nowrap;
}
.hist-bar--animate .hist-bar-inner-pct {
    opacity: 1;
}
/* Baris nama seksi — terpisah dari area bar agar tidak mendesak tinggi */
.histogram-labels {
    display: flex;
    gap: 5px;
    margin-top: 0;
    border-top: 2px solid rgba(255,255,255,.12);
    padding-top: 6px;
}
.hist-label {
    flex: 1;
    min-width: 36px;
    max-width: 80px;
    font-size: .6rem;
    color: #BFE0CF;
    text-align: center;
    line-height: 1.35;
    padding: 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Sembunyikan elemen .hist-name lama (sudah dipindah ke .histogram-labels) */
.hist-name { display: none; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

table.progress-table { flex: 1; min-width: 260px; border-collapse: collapse; width: 100%; }
table.progress-table th {
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #BFE0CF;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,.18);
}
table.progress-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: .82rem;
    color: #EAF3EE;
}
table.progress-table tr:last-child td { border-bottom: none; }
table.progress-table td.capaian-cell { color: var(--sicap-gold); font-weight: 700; }

.landing-footer { margin-top: 26px; color: rgba(255,255,255,.55); font-size: .78rem; text-align: center; }

@media (max-width: 760px) {
    .landing-panels { flex-direction: column; }
    .login-panel { flex: none; }
    .landing-script { font-size: 2.8rem; }
}

/* ---------- reCAPTCHA ---------- */
.recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin: 10px 0 14px;
}
.recaptcha-wrap .g-recaptcha {
    transform-origin: center;
}
/* Skala responsif jika card terlalu sempit */
@media (max-width: 380px) {
    .recaptcha-wrap {
        transform: scale(0.87);
        transform-origin: left center;
    }
}

