/* ==========================================================
   PARADHA — gaya tampilan (dimuat setelah Bootstrap)
   ========================================================== */
:root {
    --teal: #009788; --teal-dark: #00796b; --teal-deep: #005f54; --teal-soft: #e6f4f2; --gold: #f5c518;
    --ink: #17323a; --muted: #6b7f86; --line: #e3ecea; --bg: #f2f7f6; --radius: .9rem;
    --head-font: 'Montserrat', 'Plus Jakarta Sans', system-ui, sans-serif;
    --side-bg: linear-gradient(185deg, #00a898 0%, #008576 55%, #006b60 100%);

    --bs-primary: #009788; --bs-primary-rgb: 0,151,136;
    --bs-link-color: #00796b; --bs-link-color-rgb: 0,121,107;
    --bs-link-hover-color: #005f54; --bs-link-hover-color-rgb: 0,95,84;
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: #17323a; --bs-body-color-rgb: 23,50,58; --bs-body-bg: #f2f7f6;
    --bs-secondary-color: #6b7f86; --bs-border-color: #e3ecea;
    --bs-border-radius: .65rem; --bs-border-radius-lg: .9rem;
}

/* ---- dasar & tipografi (ukuran huruf menyesuaikan lebar layar) ---- */
html { font-size: clamp(14px, .3vw + 13px, 16px); -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); line-height: 1.55; }
h1, h2, h3, h4, h5, h6, .fw-bold { font-family: var(--head-font); font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: var(--muted) !important; }
a { text-underline-offset: 2px; }

/* ---- tombol ---- */
.btn { font-weight: 600; border-radius: .65rem; padding: .5rem 1rem; min-height: 2.4rem; transition: all .15s; }
.btn-sm { min-height: 2rem; padding: .3rem .65rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; border-radius: .8rem; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark);
    --bs-btn-active-bg: var(--teal-deep); --bs-btn-active-border-color: var(--teal-deep); --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal);
    box-shadow: 0 2px 8px rgba(0,151,136,.25); }
.btn-outline-primary { --bs-btn-color: var(--teal-dark); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal); --bs-btn-hover-border-color: var(--teal);
    --bs-btn-active-bg: var(--teal-dark); --bs-btn-active-border-color: var(--teal-dark); }

/* ---- kartu ---- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
    box-shadow: 0 1px 2px rgba(23,50,58,.04), 0 6px 18px rgba(23,50,58,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-family: var(--head-font); font-weight: 700;
    font-size: .9rem; color: var(--teal-dark); padding: .85rem 1.1rem; }
.card > .table-responsive { border-radius: var(--radius); }

/* ---- tabel ---- */
.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
.table-light { --bs-table-bg: var(--teal-soft); --bs-table-color: var(--teal-deep); }
.table thead th { background: var(--teal-soft); color: var(--teal-deep); font-family: var(--head-font); font-size: .7rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; border-bottom: 0; white-space: nowrap; padding: .8rem 1rem; }
.table td, .table tfoot th { padding: .7rem 1rem; border-color: var(--line); vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f5fbfa; }

/* ---- formulir ---- */
.form-label { font-weight: 600; font-size: .82rem; color: var(--teal-deep); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: .65rem; border-color: #d5e3e0; padding: .55rem .8rem; min-height: 2.6rem; background-color: #fff; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--teal); box-shadow: 0 0 0 .25rem rgba(0,151,136,.18); }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.input-group > .btn { min-height: 2.6rem; }

/* ---- lencana, peringatan, paginasi ---- */
.badge { font-weight: 600; border-radius: 999px; padding: .4em .75em; font-size: .72rem; }
.alert { border: 0; border-radius: .8rem; }
.pagination { gap: .25rem; flex-wrap: wrap; }
.page-link { border-radius: .5rem !important; border: 1px solid var(--line); color: var(--teal-dark); }
.active > .page-link, .page-link.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.list-group-item { border-color: var(--line); }

/* ---- kerangka aplikasi ---- */
.app { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; }
.page { width: 100%; max-width: 1500px; margin: 0 auto; padding: clamp(1rem, 2.2vw, 2rem); }

.sidebar { width: 264px; flex: 0 0 264px; height: 100vh; position: sticky; top: 0; overflow-y: auto;
    background: var(--side-bg); padding: 1.1rem; display: flex; flex-direction: column; }
.offcanvas-side { --bs-offcanvas-width: 284px; background: var(--side-bg); border: 0; }
.offcanvas-side .offcanvas-body { display: flex; flex-direction: column; padding-top: 0; }

.side-nav { flex: 1; display: flex; flex-direction: column; }
.side-nav .brand { text-align: center; padding: .4rem 0 1.1rem; border-bottom: 1px solid rgba(255,255,255,.22); margin-bottom: .6rem; text-decoration: none; display: block; }
.side-nav .brand img { height: 74px; width: auto; }
.side-nav .brand .t { color: #fff; font-family: var(--head-font); font-weight: 800; letter-spacing: .09em; font-size: 1.15rem; line-height: 1.1; margin-top: .45rem; }
.side-nav .brand .s { color: rgba(255,255,255,.85); font-family: var(--head-font); font-weight: 600; letter-spacing: .2em; font-size: .62rem; }
.side-nav .nav-link { color: rgba(255,255,255,.9); border-radius: .75rem; padding: .62rem .85rem; font-weight: 600; font-size: .88rem;
    display: flex; align-items: center; gap: .7rem; }
.side-nav .nav-link .bi { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.side-nav .nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.side-nav .nav-link.active { background: #fff; color: var(--teal-dark); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.side-nav .label { font-family: var(--head-font); font-size: .64rem; letter-spacing: .14em; color: rgba(255,255,255,.7);
    text-transform: uppercase; margin: 1.1rem .85rem .3rem; font-weight: 700; }
.side-nav .logout { margin-top: auto; padding-top: 1.25rem; }

.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: .75rem;
    padding: .7rem clamp(1rem, 2vw, 2rem); background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-family: var(--head-font); font-weight: 700; font-size: 1.05rem; color: var(--teal-deep); margin: 0; }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.user-chip .who { line-height: 1.15; text-align: right; }
.user-chip .who b { display: block; font-size: .85rem; }
.user-chip .who small { color: var(--muted); font-size: .72rem; }
.avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center;
    font-family: var(--head-font); font-weight: 700; font-size: .85rem; flex: none; }

/* ---- dashboard ---- */
.hero { position: relative; overflow: hidden; border-radius: 1.25rem; color: #fff; padding: clamp(1.25rem, 3vw, 2rem);
    background: linear-gradient(135deg, #00a898 0%, #007f72 100%); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    box-shadow: 0 10px 28px rgba(0,151,136,.25); }
.hero::after { content: ""; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: clamp(150px, 24vw, 280px); aspect-ratio: 1;
    background: url('../images/logo-putih.png') center / contain no-repeat; opacity: .13; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-date { font-size: .8rem; font-weight: 600; opacity: .85; }
.hero-title { font-size: clamp(1.25rem, 2.6vw, 1.85rem); font-weight: 800; margin: .15rem 0 .2rem; color: #fff; }
.hero-sub { opacity: .9; font-size: .9rem; }
.hero-btn { color: var(--teal-deep); font-weight: 700; background: #fff; border: 0; box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.hero-btn:hover { background: #f1fbf9; color: var(--teal-deep); transform: translateY(-1px); }

.section-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin: 0 0 .85rem; }
.section-head h2 { font-size: 1.05rem; margin: 0; }
.section-head span { color: var(--muted); font-size: .82rem; }

.stat-card { display: flex; gap: .9rem; align-items: center; height: 100%; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: 0 1px 2px rgba(23,50,58,.04), 0 6px 18px rgba(23,50,58,.04); }
.stat-card .ico { width: 3rem; height: 3rem; border-radius: .85rem; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.stat-card .lbl { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat-card .val { font-family: var(--head-font); font-weight: 800; font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.15; word-break: break-word; }
.stat-card .sub { font-size: .75rem; color: var(--muted); }
.stat { border-left: 4px solid var(--teal); }

.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.list-clean li:first-child { border-top: 0; }
.rank { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; font-size: .75rem; display: grid; place-items: center; flex: none; }
.empty { padding: 1.3rem; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---- halaman masuk ---- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.login-brand { background: var(--side-bg); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2.2rem 1.5rem; position: relative; overflow: hidden; }
.login-brand img { height: clamp(90px, 22vw, 180px); width: auto; }
.login-brand .t { font-family: var(--head-font); font-weight: 800; letter-spacing: .09em; font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 1; margin-top: 1rem; }
.login-brand .s { font-family: var(--head-font); font-weight: 600; letter-spacing: .22em; font-size: .8rem; margin-top: .35rem; }
.login-brand .tag { display: none; max-width: 22rem; opacity: .85; margin-top: 1.5rem; font-size: .95rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #fff; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 1.5rem; font-weight: 800; }
@media (min-width: 992px) {
    .login-wrap { grid-template-columns: 1.1fr 1fr; }
    .login-brand .tag { display: block; }
}

/* ---- tabel menjadi kartu di layar kecil (label diisi otomatis oleh skrip) ---- */
@media (max-width: 767.98px) {
    .stack-on thead { display: none; }
    .stack-on tbody tr { display: block; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
    .stack-on tbody td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .28rem 0; border: 0; text-align: right; }
    .stack-on tbody td::before { content: attr(data-label); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
        color: var(--muted); text-align: left; flex: none; }
    .stack-on tbody td[colspan] { display: block; text-align: center; }
    .stack-on tbody td[colspan]::before { content: none; }
    .stack-on tbody td:empty { display: none; }
    .stack-on tfoot, .stack-on tfoot tr, .stack-on tfoot th { display: block; text-align: right; }
    .stack-on tfoot tr { padding: .5rem 1rem; }
}
@media (max-width: 575.98px) {
    .card-body { padding: 1rem; }
    .hero .btn { width: 100%; }
    .btn-lg { width: 100%; }
    .topbar-title { font-size: .98rem; }
}
