:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #e6f4f1;
    --brand-ring: rgba(15, 118, 110, .25);
    --ink: #0f172a;
    --muted: #5b6474;
    --line: #e5e9e8;
    --surface: #ffffff;
    --bg: #f3f6f5;
    --ok: #15803d;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --radius: 16px;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --viz-series: #0d9488;
    --viz-grid: #eef1f0;
    --viz-ink: #5b6474;
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body { background: var(--bg); color: var(--ink); font-family: var(--bs-body-font-family); }
.bg-brand { background: var(--brand) !important; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.text-brand { color: var(--brand) !important; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-radius: 12px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; }
.stat-card .progress { height: 8px; }
.stat-card .value { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.ind-row + .ind-row { border-top: 1px solid #eef0ef; }
.recap-table th, .recap-table td { white-space: nowrap; vertical-align: middle; font-size: .875rem; }
.recap-table thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.recap-table .sticky-col { position: sticky; left: 0; background: #fff; z-index: 2; }
.cell-pct { min-width: 64px; text-align: center; }
.small-muted { font-size: .8rem; color: #6c757d; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem var(--brand-ring); }

/* ============ Form Isi Mutaba'ah ============ */
.form-shell { max-width: 720px; margin: 0 auto; padding-bottom: 96px; }
.form-head { margin-bottom: 1.25rem; }

.form-card, .amal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .2s ease, box-shadow .25s ease, background-color .25s ease;
}
.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 700; margin-bottom: .9rem; }
.section-title-out { margin: 1.75rem 0 .9rem; }
.step {
    width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-size: .85rem; font-weight: 700;
}

/* Chip periode */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip {
    min-height: 40px; padding: .45rem .95rem; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    font-size: .9rem; font-weight: 500; cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip:active { transform: scale(.96); }
.chip:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-accent { border-color: #a7d7cf; color: var(--brand); background: var(--brand-soft); }
.chip-sm { min-height: 36px; padding: .3rem .75rem; font-size: .82rem; }

.date-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: end; }
.date-arrow { color: var(--muted); padding-bottom: .7rem; }
.date-grid .form-control-lg { font-size: 1rem; border-radius: 12px; min-height: 48px; }
.range-info { margin-top: .75rem; min-height: 1.6rem; font-size: .9rem; }
.day-pill {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .82rem;
}

/* Kehadiran */
.empty-note { color: var(--muted); font-size: .9rem; }
.att-row { padding: .9rem 0; border-top: 1px dashed var(--line); animation: fadeUp .3s var(--ease-out); }
.att-row:first-of-type, .empty-note + .att-row { border-top: 0; padding-top: 0; }
.att-info { margin-bottom: .6rem; }
.segmented { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.seg {
    min-height: 44px; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .5rem 1rem; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
    font-weight: 600; cursor: pointer; user-select: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .12s ease;
}
.seg:active { transform: scale(.97); }
.seg-yes { color: var(--ok); }
.seg-no { color: var(--danger); }
.btn-check:checked + .seg-yes { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-check:checked + .seg-no { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-check:focus-visible + .seg { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

/* Panel buka-tutup halus (tanpa animasi height) */
.expand { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .28s var(--ease-out), opacity .2s ease; }
.expand > div { overflow: hidden; min-height: 0; }
.expand.open { grid-template-rows: 1fr; opacity: 1; }

/* Kartu amalan */
.amal-head { display: flex; align-items: flex-start; gap: .8rem; }
.amal-title { flex: 1; min-width: 0; }
.amal-icon {
    flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-size: 1.2rem;
    transition: background-color .25s ease, color .25s ease;
}
.done-badge {
    flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ok); color: #fff; font-size: .95rem;
    opacity: 0; transform: scale(.4); transition: opacity .2s ease, transform .3s var(--ease-spring);
}
.amal.is-done { border-color: #9fd5c9; background: linear-gradient(180deg, #f5fbfa 0%, #fff 60%); }
.amal.is-done .amal-icon { background: var(--brand); color: #fff; }
.amal.is-done .done-badge { opacity: 1; transform: scale(1); }

.amal-control { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem .75rem; margin-top: .9rem; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.stepper:focus-within { border-color: var(--brand); box-shadow: 0 0 0 .25rem var(--brand-ring); }
.step-btn {
    width: 48px; height: 48px; border: 0; background: transparent; color: var(--brand); font-size: 1.15rem;
    display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease, transform .1s ease;
}
.step-btn:hover { background: var(--brand-soft); }
.step-btn:active { transform: scale(.88); }
.step-btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: -3px; }
.step-input {
    width: 72px; height: 48px; border: 0; text-align: center; font-size: 1.15rem; font-weight: 700;
    color: var(--ink); background: transparent; -moz-appearance: textfield; font-variant-numeric: tabular-nums;
}
.step-input::-webkit-outer-spin-button, .step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-input:focus { outline: none; }
.unit { color: var(--muted); font-size: .9rem; }

.meter { height: 6px; border-radius: 999px; background: #edf1f0; overflow: hidden; margin-top: .85rem; }
.meter > span {
    display: block; height: 100%; width: 0; border-radius: inherit; background: #f59e0b;
    transform-origin: left; transition: width .45s var(--ease-out), background-color .3s ease;
}
.meter[data-level="low"] > span { background: #f59e0b; }
.meter[data-level="mid"] > span { background: #14b8a6; }
.meter[data-level="done"] > span { background: var(--ok); }
.meter-text { margin-top: .35rem; font-variant-numeric: tabular-nums; }

.check-tile {
    display: flex; align-items: center; gap: .75rem; margin-top: .9rem; padding: .8rem 1rem; min-height: 52px;
    border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 500;
    transition: border-color .2s ease, background-color .2s ease;
}
.check-tile input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    width: 26px; height: 26px; border-radius: 8px; border: 2px solid #b8c2c0; display: grid; place-items: center;
    color: #fff; font-size: .95rem; transition: background-color .2s ease, border-color .2s ease;
}
.check-box i { transform: scale(0); transition: transform .25s var(--ease-spring); }
.check-tile:has(input:checked) { border-color: var(--ok); background: #f0fdf4; }
.check-tile input:checked + .check-box { background: var(--ok); border-color: var(--ok); }
.check-tile input:checked + .check-box i { transform: scale(1); }
.check-tile:has(input:focus-visible) { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

.note-toggle {
    margin-top: .75rem; border: 0; background: none; padding: .35rem 0; color: var(--brand);
    font-size: .88rem; font-weight: 600; cursor: pointer; min-height: 36px;
}
.note-toggle:hover { text-decoration: underline; }

/* Error */
.is-invalid { border-color: #fca5a5 !important; background: var(--danger-soft); }
.att-row.is-invalid { background: transparent; }
.field-error { color: var(--danger); font-size: .85rem; font-weight: 500; margin-top: .6rem; animation: fadeUp .25s var(--ease-out); }
.error-summary {
    border: 1px solid #fecaca; background: var(--danger-soft); color: #7f1d1d;
    border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.error-summary:focus { outline: 3px solid #fca5a5; outline-offset: 2px; }
.error-summary a { color: #991b1b; font-weight: 600; }

/* Bar simpan menempel di bawah */
.save-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020;
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
    animation: slideUp .45s var(--ease-out) .15s both;
}
.save-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; }
.save-progress { flex: 1; min-width: 0; }
.save-progress .meter { margin-top: .35rem; }
.meter-thin { height: 4px; }
.meter-thin > span { background: var(--brand); }
.btn-save { min-height: 48px; padding: 0 1.4rem; border-radius: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: .5rem; transition: transform .12s ease, background-color .2s ease; }
.btn-save:active { transform: scale(.97); }
.btn-save .spinner-border { display: none; }
.btn-save.loading .spinner-border { display: inline-block; }
.btn-save.loading .label i { display: none; }

/* Motion */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .4s var(--ease-out), transform .45s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
.bump { animation: bump .28s var(--ease-spring); }
.shake { animation: shake .35s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 575.98px) {
    .form-card, .amal { padding: 1rem; border-radius: 14px; }
    .date-grid { grid-template-columns: 1fr 1fr; }
    .date-arrow { display: none; }
    .seg { flex: 1; min-width: 0; }
    .segmented { display: flex; }
}

/* ============ Dashboard ============ */
.dash { padding-bottom: 2rem; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.period-nav { display: flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .3rem; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink);
    display: grid; place-items: center; text-decoration: none; transition: background-color .15s ease, transform .1s ease;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.active { background: var(--brand); color: #fff; }
.icon-btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 1px; }
.month-input { border: 0; font-weight: 600; min-height: 40px; width: 200px; background: transparent; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.btn-cta { min-height: 48px; padding: 0 1.2rem; border-radius: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; box-shadow: 0 6px 16px rgba(15, 118, 110, .25); transition: transform .12s ease, box-shadow .2s ease; }
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(15, 118, 110, .3); }
.btn-cta:active { transform: scale(.97); }
@media (max-width: 575.98px) { .head-actions { width: 100%; } .btn-cta { width: 100%; justify-content: center; } }
.range-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }

.kpi-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.kpi {
    position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.1rem 1.2rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.kpi-title { color: var(--muted); font-size: .85rem; font-weight: 500; }
.kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.15; margin: .15rem 0 .5rem; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.kpi-icon {
    position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.kpi-hero {
    display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 1.1rem;
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%); color: #fff; border: 0;
}
.kpi-hero .kpi-title { color: rgba(255, 255, 255, .85); }
.kpi-hero .text-muted { color: rgba(255, 255, 255, .8) !important; }
.kpi-hero .ring { grid-row: 1; grid-column: 1; width: 116px; height: 116px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: rgba(255, 255, 255, .18); }
.ring-bar { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease-out); }
.ring-label { grid-row: 1; grid-column: 1; display: grid; place-items: center; }
.ring-label .kpi-value { margin: 0; font-size: 1.9rem; }
.ring-label .kpi-value small { color: rgba(255, 255, 255, .85); }
.kpi-body { grid-column: 2; grid-row: 1; }
.status-chip {
    display: inline-flex; align-items: center; gap: .35rem; margin-top: .45rem; padding: .25rem .65rem;
    border-radius: 999px; font-size: .8rem; font-weight: 600; background: #fff; color: var(--ink);
}
.status-chip.tone-good i { color: #0ca30c; }
.status-chip.tone-ok i { color: var(--viz-series); }
.status-chip.tone-warn i { color: #d97706; }
.status-chip.tone-bad i { color: #d03b3b; }
.status-chip.tone-muted i { color: var(--muted); }
.kpi .meter > span { width: 0; transition: width .9s var(--ease-out); }

.notice {
    display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; margin-bottom: 1rem;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); color: #78350f;
}
.notice a { color: #92400e; font-weight: 600; }
.notice-icon { width: 36px; height: 36px; border-radius: 10px; background: #fef3c7; color: #b45309; display: grid; place-items: center; flex: none; }

.viz-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.viz-grid-even { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.viz-side { display: grid; gap: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.panel-title { font-size: 1rem; font-weight: 700; margin: 0; }
.chart-box { position: relative; }
.table-view { margin-top: .75rem; }
.table-view summary {
    cursor: pointer; font-size: .85rem; color: var(--brand); font-weight: 600; list-style: none;
    min-height: 44px; display: inline-flex; align-items: center; gap: .35rem;
}
.table-view summary::-webkit-details-marker { display: none; }

/* Urutkan + daftar batang (HP) */
.sort-toggle { display: inline-flex; gap: 4px; padding: 4px; background: #f1f5f4; border-radius: 12px; margin-bottom: .9rem; }
.sort-btn {
    min-height: 36px; padding: 0 .8rem; border: 0; border-radius: 9px; background: transparent;
    color: var(--muted); font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.sort-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.sort-btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 1px; }
.bar-list { list-style: none; padding: 0; margin: 0; display: none; }
.bar-row { padding: .6rem 0; min-height: 44px; }
.bar-row + .bar-row { border-top: 1px solid #f1f4f3; }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.bar-name { font-size: .9rem; font-weight: 500; min-width: 0; }
.bar-val { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.bar-track { height: 8px; border-radius: 999px; background: #edf1f0; margin-top: .35rem; overflow: hidden; }
.bar-track > span { display: block; height: 100%; width: 0; background: var(--viz-series); border-radius: 0 4px 4px 0; transition: width .8s var(--ease-out); }
.bar-detail { font-size: .78rem; color: var(--muted); margin-top: .25rem; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
    .bar-list { display: block; }
    .chart-desktop { display: none; }
    .sort-toggle { display: flex; }
    .sort-btn { flex: 1; justify-content: center; min-height: 40px; }
}

/* Kalender pengisian */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.cal-day {
    position: relative; height: 42px; border-radius: 10px; display: grid; place-items: center;
    font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: default;
    transition: transform .15s ease;
}
.cal-day { border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.cal-day:hover { transform: translateY(-2px); }
.cal-day:active { transform: scale(.94); }
.cal-day:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; }
.cal-day.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.cal-info {
    margin-top: .75rem; padding: .55rem .75rem; min-height: 44px; display: flex; align-items: center; gap: .4rem;
    border-radius: 10px; background: #f6f8f7; color: var(--muted); font-size: .85rem;
}
.cal-info.has-info { color: var(--ink); background: var(--brand-soft); animation: fadeUp .25s var(--ease-out); }
.cal-day.filled { background: var(--brand); color: #fff; }
.cal-day.empty { background: #fff; color: var(--ink); border: 1.5px dashed #cbd5d3; }
.cal-day.future { background: #f6f8f7; color: #8a9492; }
.cal-day.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #f59e0b; }
.cal-mark {
    position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
    display: grid; place-items: center; font-size: .7rem; color: #fff; box-shadow: 0 0 0 2px var(--surface);
}
.cal-mark.static { position: static; box-shadow: none; flex: none; }
.cal-mark.m-hadir { background: #0ca30c; }
.cal-mark.m-tidak { background: #d03b3b; }
.cal-mark.m-belum { background: #d97706; }
.cal-mark.m-soon { background: #94a3b8; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .9rem; font-size: .78rem; color: var(--muted); }
.cal-legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw-filled { background: var(--brand); }
.sw-empty { border: 1.5px dashed #cbd5d3; }

/* Kartu amalan dashboard */
.amal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.amal-grid .amal { margin: 0; transition: opacity .4s var(--ease-out), transform .3s var(--ease-out), box-shadow .2s ease, border-color .2s ease; }
.amal-grid .amal.in:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .07); }
.pct-pill { flex: none; font-size: .8rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: #f1f5f4; color: var(--ink); font-variant-numeric: tabular-nums; }
.amal.is-done .pct-pill { background: #dcfce7; color: #166534; }
.amal-figure { margin-top: .8rem; }
.amal-figure .big { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.amal-grid .meter > span { width: 0; transition: width .9s var(--ease-out); }
.notes { margin-top: .6rem; }
.notes summary { cursor: pointer; color: var(--brand); font-size: .85rem; font-weight: 600; }
.absent-item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; }
.absent-item + .absent-item { border-top: 1px dashed var(--line); }
a.chip { text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }

@media (max-width: 991.98px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-hero { grid-column: 1 / -1; }
    .viz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .kpi-grid { gap: .75rem; }
    .kpi { padding: 1rem; }
    .kpi-value { font-size: 1.6rem; }
    .kpi-icon { display: none; }
    .kpi-hero { grid-template-columns: 96px 1fr; }
    .kpi-hero .ring { width: 96px; height: 96px; }
    .ring-label .kpi-value { font-size: 1.5rem; }
    .period-nav { width: 100%; justify-content: space-between; }
    .month-input { flex: 1; width: auto; }
    .cal { gap: 4px; }
}

/* ============ Global: navigasi, toast, dialog, transisi halaman ============ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .18s ease both; }
::view-transition-new(root) { animation: vtIn .28s var(--ease-out) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }

.app-nav .nav-link { border-radius: 10px; padding: .45rem .8rem !important; transition: background-color .2s ease, color .2s ease; }
.app-nav .nav-link:hover { background: rgba(255, 255, 255, .1); }
.app-nav .nav-link.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }
.app-nav .nav-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.toast-stack { position: fixed; top: 72px; right: 16px; z-index: 1090; display: grid; gap: .6rem; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.app-toast {
    pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .7rem;
    padding: .85rem .9rem; border-radius: 14px; background: #fff; color: var(--ink);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .05);
    transform: translateX(110%); opacity: 0; transition: transform .45s var(--ease-spring), opacity .3s ease;
}
.app-toast.in { transform: none; opacity: 1; }
.app-toast.out { transform: translateX(110%); opacity: 0; transition-duration: .22s; }
.app-toast > .bi { font-size: 1.2rem; margin-top: 1px; }
.app-toast .msg { flex: 1; font-size: .9rem; font-weight: 500; }
.t-success > .bi { color: #16a34a; } .t-danger > .bi { color: var(--danger); } .t-warning > .bi { color: #d97706; } .t-info > .bi { color: var(--brand); }
.toast-x { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; margin: -4px -4px 0 0; }
.toast-x:hover { background: #f1f5f4; }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: .25; transform-origin: left; }
.t-success .toast-timer { color: #16a34a; } .t-danger .toast-timer { color: var(--danger); } .t-warning .toast-timer { color: #d97706; }
.app-toast.in .toast-timer { animation: toastTimer 5s linear forwards; }
.app-toast.paused .toast-timer { animation-play-state: paused; }
@keyframes toastTimer { to { transform: scaleX(0); } }
@media (max-width: 575.98px) { .toast-stack { top: auto; bottom: 16px; right: 16px; } .app-toast { transform: translateY(120%); } .app-toast.out { transform: translateY(120%); } }

.modal.fade .modal-dialog { transform: scale(.94) translateY(12px); transition: transform .3s var(--ease-spring); }
.modal.show .modal-dialog { transform: none; }
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.confirm-card { padding: 1.4rem; text-align: center; }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto .8rem; display: grid; place-items: center; font-size: 1.4rem; background: var(--danger-soft); color: var(--danger); }
.confirm-icon.tone-warning { background: #fffbeb; color: #d97706; }
.confirm-icon.tone-success { background: #f0fdf4; color: #16a34a; }
.modal.show .confirm-icon { animation: bump .45s var(--ease-spring) .1s; }

/* ============ Komponen admin ============ */
.back-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.back-link:hover { color: var(--brand); }
.back-link:hover i { transform: translateX(-3px); }
.back-link i { transition: transform .2s ease; }
.form-narrow { max-width: 760px; margin-left: auto; margin-right: auto; }

.kpi-grid-4 { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.kpi-alert { border-color: #fecaca; background: linear-gradient(180deg, #fff7f7, #fff); }
.kpi-alert .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.ring-bar { transition: stroke-dashoffset 1.1s var(--ease-out); }

.view-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #e9efed; border-radius: 14px; margin: .25rem 0 1rem; }
.view-tab { border: 0; background: transparent; min-height: 40px; padding: 0 1rem; border-radius: 10px; font-weight: 600; font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.view-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.view-tab:focus-visible { outline: 3px solid var(--brand-ring); }
.tab-pane-x.swap { animation: fadeUp .3s var(--ease-out); }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.search-box { position: relative; flex: 1 1 220px; max-width: 360px; }
.search-box .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .form-control { padding-left: 2.3rem; min-height: 44px; border-radius: 12px; }

.avatar {
    flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #115e59; font-weight: 700; font-size: .9rem;
}
.avatar-dark { background: linear-gradient(135deg, #334155, #0f172a); color: #fff; }

.rank-list, .user-list, .ind-list, .att-list, .timeline, .detail-list { list-style: none; padding: 0; margin: 0; }
.rank-list li + li { border-top: 1px solid #f1f4f3; }
.rank-row { display: flex; align-items: center; gap: .85rem; padding: .8rem .5rem; margin: 0 -.5rem; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.rank-row:hover { background: #f6faf9; }
.rank-row:hover .rank-go { transform: translateX(3px); color: var(--brand); }
.rank-row:focus-visible { outline: 3px solid var(--brand-ring); }
.rank-main { flex: 1; min-width: 0; display: block; }
.rank-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.rank-name { font-weight: 600; }
.rank-pct { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .35rem; font-size: .78rem; color: var(--muted); }
.rank-go { color: #b6c0be; transition: transform .2s ease, color .2s ease; }
.rank-main .bar-track { display: block; }
.tone-good { color: #15803d; } .tone-ok { color: #0f766e; } .tone-warn { color: #b45309; } .tone-bad { color: #dc2626; } .tone-muted { color: var(--muted); }
.bar-track > .tone-bg-good { background: #16a34a; } .bar-track > .tone-bg-ok { background: var(--viz-series); }
.bar-track > .tone-bg-warn { background: #f59e0b; } .bar-track > .tone-bg-bad { background: #ef4444; }
.bar-track > span[data-w] { width: 0; }

.matrix-wrap { max-height: 70vh; border-radius: 12px; }
.recap-table th, .recap-table td { border-color: #f1f4f3; }
.recap-table thead th { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; padding: .5rem .35rem; }
.recap-table .sticky-col { box-shadow: 1px 0 0 #eef1f0; text-align: left; }
.recap-table tbody tr:hover td, .recap-table tbody tr:hover th { background: #f8fbfa; }
.heat { display: inline-block; min-width: 46px; padding: .2rem .45rem; border-radius: 8px; font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.h-good { background: #dcfce7; color: #166534; } .h-ok { background: #ccfbf1; color: #115e59; }
.h-warn { background: #fef3c7; color: #92400e; } .h-bad { background: #fee2e2; color: #991b1b; } .h-muted { background: #f1f5f4; color: var(--muted); }
.legend-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: .9rem; font-size: .8rem; }

.empty-state { text-align: center; color: var(--muted); padding: 1.5rem 1rem; }
.empty-state > .bi { display: block; font-size: 1.6rem; margin-bottom: .35rem; }
.empty-state.big { padding: 2.5rem 1rem; }
.empty-state.big > .bi { font-size: 2.4rem; color: var(--brand); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.mini-stat { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.mini-stat strong { display: block; font-size: 1.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mini-stat span:not(.mini-icon) { font-size: .8rem; color: var(--muted); }
.mini-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.mini-icon.warn { background: #fef3c7; color: #b45309; } .mini-icon.bad { background: var(--danger-soft); color: var(--danger); }

.user-row { display: flex; align-items: center; gap: .85rem; padding: .8rem 0; transition: opacity .2s ease; }
.user-row + .user-row { border-top: 1px solid #f1f4f3; }
.user-row.is-off { opacity: .6; }
.user-main { flex: 1; min-width: 0; }
.user-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.user-meta { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 999px; background: #f1f5f4; color: var(--muted); font-size: .72rem; font-weight: 600; white-space: nowrap; }
.tag-dark { background: #0f172a; color: #fff; } .tag-warn { background: #fef3c7; color: #92400e; }
.tag-brand { background: var(--brand-soft); color: var(--brand); } .tag-ok { background: #dcfce7; color: #166534; }

.row-actions { display: flex; align-items: center; gap: .35rem; flex: none; }
.row-actions form { margin: 0; }
.act-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
    display: inline-grid; place-items: center; text-decoration: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.act-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: #b7e0d8; }
.act-btn:active { transform: scale(.92); }
.act-btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 1px; }
.act-btn:disabled { opacity: .35; pointer-events: none; }
.act-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.act-ok:hover { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.act-sm { width: 32px; height: 28px; border-radius: 8px; border: 0; background: transparent; }

.sheet .modal-body { padding-top: .5rem; }

/* Form Mutaba'ah (indikator) */
.ind-list { display: grid; gap: .6rem; }
.ind-card { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; transition: box-shadow .2s ease, border-color .2s ease, opacity .2s ease; }
.ind-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.ind-card:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); animation: bump .5s var(--ease-spring); }
.ind-card.is-off { opacity: .55; }
.ind-card.is-off .amal-icon { background: #f1f5f4; color: var(--muted); }
.order-btns { display: flex; flex-direction: column; align-items: center; margin: 0; }
.order-no { font-size: .75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ind-main { flex: 1; min-width: 0; }
.ind-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.ind-name:hover { color: var(--brand); text-decoration: underline; }
.ind-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.form-switch-lg { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .25rem; cursor: pointer; }
.form-switch-lg .form-check-input, .switch-row .form-check-input { width: 2.6em; height: 1.4em; margin: 0; cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .25rem var(--brand-ring); border-color: var(--brand); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.type-card {
    display: grid; justify-items: start; gap: .1rem; padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff;
    transition: border-color .2s ease, background-color .2s ease, transform .12s ease;
}
.type-card i { font-size: 1.2rem; color: var(--brand); }
.type-card span { font-size: .75rem; color: var(--muted); }
.type-card:active { transform: scale(.97); }
.btn-check:checked + .type-card { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.btn-check:focus-visible + .type-card { outline: 3px solid var(--brand-ring); outline-offset: 2px; }
.target-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.target-row > .form-control { width: 150px; min-height: 44px; }
.btn-check:checked + .sort-btn { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.btn-check:focus-visible + .sort-btn { outline: 3px solid var(--brand-ring); }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; min-height: 56px; }
.switch-row small { display: block; color: var(--muted); font-size: .78rem; }
.preview-col { position: sticky; top: 84px; }
.preview-label { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .5rem; }
.preview-card { box-shadow: 0 16px 40px rgba(15, 23, 42, .08); transition: opacity .25s ease, filter .25s ease; }
.preview-card.is-off { opacity: .5; filter: grayscale(1); }

/* Jadwal */
.repeat-preview { margin-top: .6rem; font-size: .85rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.date-badge {
    flex: none; width: 58px; border-radius: 14px; overflow: hidden; text-align: center; background: #fff; border: 1px solid var(--line);
    display: grid; line-height: 1.1; box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
}
.date-badge span { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: .2rem 0; }
.date-badge span:first-child { background: var(--brand); color: #fff; }
.date-badge strong { font-size: 1.35rem; }
.date-badge.big { width: 70px; }
.date-badge.big strong { font-size: 1.7rem; }
.timeline { display: grid; gap: .75rem; }
.tl-item { display: flex; gap: .8rem; align-items: stretch; }
.tl-item.is-future .date-badge span:first-child { background: #94a3b8; }
.tl-item.is-today .tl-card { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.tl-card {
    flex: 1; min-width: 0; display: block; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    color: inherit; text-decoration: none; transition: box-shadow .2s ease, transform .2s var(--ease-out), border-color .2s ease;
}
.tl-card:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, .07); transform: translateY(-2px); border-color: #b7e0d8; }
.tl-card:focus-visible { outline: 3px solid var(--brand-ring); }
.tl-top { display: flex; justify-content: space-between; gap: .5rem; }
.tl-actions { display: flex; flex-direction: column; gap: .35rem; }
.tl-actions form { margin: 0; }
.stack-bar { display: flex; height: 10px; border-radius: 999px; background: #fde68a; overflow: hidden; }
.stack-bar > span { display: block; height: 100%; width: 0; transition: width .9s var(--ease-out); }
.sb-hadir { background: #16a34a; }
.sb-tidak { background: #ef4444; }
.att-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); }
.att-summary .att-legend { margin-top: .7rem; font-size: .9rem; }
.att-summary strong { color: var(--ink); }
.att-item { padding: .8rem 0; }
.att-item + .att-item { border-top: 1px solid #f1f4f3; }
.att-item { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; }
.att-item .expand { grid-column: 1 / -1; }
.att-who { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.seg3 { display: inline-flex; gap: 4px; padding: 4px; background: #f1f5f4; border-radius: 12px; }
.seg3-btn { min-height: 40px; min-width: 76px; padding: 0 .7rem; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .1s ease; }
.seg3-btn:active { transform: scale(.95); }
.btn-check:checked + .s-hadir { background: #16a34a; color: #fff; }
.btn-check:checked + .s-tidak { background: #ef4444; color: #fff; }
.btn-check:checked + .s-belum { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.btn-check:focus-visible + .seg3-btn { outline: 3px solid var(--brand-ring); }
.save-bar-static { position: sticky; bottom: 0; margin: 1rem -1.2rem -1.1rem; border-radius: 0 0 var(--radius) var(--radius); animation: none; }

.detail-list li { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; }
.detail-list li + li { border-top: 1px solid #f1f4f3; }

@media (max-width: 991.98px) {
    .kpi-grid-4 { grid-template-columns: 1fr 1fr; }
    .editor-grid { grid-template-columns: 1fr; }
    .preview-col { position: static; order: -1; }
}
@media (max-width: 575.98px) {
    .mini-stats { grid-template-columns: 1fr; gap: .5rem; }
    .mini-stat { padding: .7rem .9rem; }
    .view-tabs { display: flex; }
    .view-tab { flex: 1; justify-content: center; }
    .search-box { max-width: none; }
    .user-row { flex-wrap: wrap; }
    .user-row .row-actions { width: 100%; justify-content: flex-end; padding-left: 54px; }
    .ind-card { flex-wrap: wrap; }
    .ind-card .row-actions { width: 100%; justify-content: flex-end; }
    .type-cards { grid-template-columns: 1fr; }
    .type-card { grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; }
    .type-card i { grid-row: span 2; }
    .att-item { grid-template-columns: 1fr; }
    .seg3 { display: flex; }
    .seg3-btn { flex: 1; min-width: 0; }
    .tl-actions { flex-direction: row; position: absolute; }
    .tl-item { position: relative; }
    .tl-actions { right: .6rem; bottom: .6rem; }
    .tl-card { padding-bottom: 3.4rem; }
    .save-bar-static { margin: 1rem -1rem -1rem; }
}
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .app-toast, .modal.fade .modal-dialog { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* Perbaikan audit admin */
.recap-table .sticky-col a { color: var(--ink); font-weight: 600; text-decoration: none; }
.recap-table .sticky-col a:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 575.98px) {
    .act-btn { width: 44px; height: 44px; }
    .act-sm { width: 40px; height: 40px; }
    .ind-card .order-btns { flex-direction: row; gap: .2rem; }
}
.tl-item > .date-badge { align-self: flex-start; }

/* ============ Form: motion lanjutan & popup ============ */
.confetti { position: fixed; z-index: 2000; pointer-events: none; will-change: transform, opacity; }

.amal { position: relative; }
.amal:focus-within { border-color: var(--brand); box-shadow: 0 10px 28px rgba(15, 118, 110, .12), 0 0 0 3px var(--brand-ring); }
.amal.is-filled:not(.is-done) .amal-icon { animation: wiggle .5s var(--ease-out); }
.amal.glow { animation: glow 1s var(--ease-out); }
.amal.glow .amal-icon { animation: iconPop .6s var(--ease-spring); }
.amal.is-done .meter > span { background-image: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .55) 50%, transparent 100%); background-size: 200% 100%; animation: shimmer 1.6s ease-out 1; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 60% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 1px 2px rgba(15, 23, 42, .04); } }
@keyframes iconPop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.25) rotate(-10deg); } 70% { transform: scale(.95) rotate(6deg); } 100% { transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg); } 60% { transform: rotate(7deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -100% 0; } }

.step-btn, .fill-target { position: relative; overflow: hidden; }
.ripple { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: currentColor; opacity: .25; pointer-events: none; animation: ripple .5s ease-out forwards; }
@keyframes ripple { to { transform: scale(12); opacity: 0; } }
.step-input.roll-up { animation: rollUp .26s var(--ease-out); }
.step-input.roll-down { animation: rollDown .26s var(--ease-out); }
@keyframes rollUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rollDown { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.stepper.nudge { animation: shake .3s ease; border-color: #f59e0b; }

.check-tile { position: relative; overflow: hidden; }
.check-tile:has(input:checked) .check-box { animation: iconPop .5s var(--ease-spring); }

/* Bar simpan: cincin progres */
.save-ring { width: 46px; height: 46px; flex: none; }
.save-ring circle { fill: none; stroke-width: 4; transform: rotate(-90deg); transform-origin: 22px 22px; }
.sr-track { stroke: #e3eae8; }
.sr-bar { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease-out), stroke .3s ease; }
.save-ring text { font-size: 13px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.save-bar.is-full .sr-bar { stroke: #16a34a; }
.save-bar.is-full .btn-save { animation: readyPulse 1.6s ease-in-out infinite; }
@keyframes readyPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, .45); } 50% { box-shadow: 0 0 0 10px rgba(15, 118, 110, 0); } }

/* Popup konfirmasi simpan */
.save-sheet { overflow: hidden; }
.save-hero { text-align: center; padding: 1.5rem 1.25rem 1.1rem; color: #fff; background: linear-gradient(135deg, #0f766e 0%, #115e59 100%); }
.save-hero-icon { width: 54px; height: 54px; border-radius: 16px; display: inline-grid; place-items: center; font-size: 1.5rem; background: rgba(255, 255, 255, .16); margin-bottom: .6rem; }
.modal.show .save-hero-icon { animation: iconPop .6s var(--ease-spring) .1s; }
.save-body { padding: 1.1rem 1.25rem .5rem; }
.sv-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .5rem; text-align: center; }
.sv-stats > div { background: #f6f8f7; border-radius: 12px; padding: .65rem .4rem; }
.sv-stats strong { display: block; font-size: 1.25rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.sv-stats span { font-size: .75rem; color: var(--muted); }
.modal.show .sv-stats > div { animation: fadeUp .4s var(--ease-out) both; }
.modal.show .sv-stats > div:nth-child(2) { animation-delay: .08s; }
.modal.show .sv-stats > div:nth-child(3) { animation-delay: .16s; }
.sv-empty { margin-top: .9rem; padding: .7rem .8rem; border-radius: 12px; background: #fffbeb; color: #78350f; }
.sv-tags { display: flex; flex-wrap: wrap; gap: .3rem; max-height: 110px; overflow-y: auto; }
.sv-tags .tag { background: #fff; color: #78350f; border: 1px solid #fde68a; }
.sv-full { margin-top: .9rem; padding: .7rem .8rem; border-radius: 12px; background: #f0fdf4; color: #166534; font-weight: 600; text-align: center; }
.save-actions { display: flex; gap: .6rem; padding: 1rem 1.25rem 1.25rem; }
.save-actions .btn { min-height: 48px; border-radius: 12px; font-weight: 600; }

/* Popup perayaan setelah tersimpan */
.done-sheet { padding: 1.6rem 1.4rem 1.4rem; text-align: center; }
.done-check { width: 76px; height: 76px; margin: 0 auto .9rem; }
.done-check svg { width: 100%; height: 100%; }
.done-check circle { fill: #dcfce7; stroke: #16a34a; stroke-width: 3; transform-origin: center; transform: scale(.6); opacity: 0; }
.done-check path { fill: none; stroke: #16a34a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.done-check.play circle { animation: checkCircle .45s var(--ease-spring) forwards; }
.done-check.play path { animation: checkDraw .4s ease-out .3s forwards; }
@keyframes checkCircle { to { transform: scale(1); opacity: 1; } }
@keyframes checkDraw { to { stroke-dashoffset: 0; } }
.done-sheet .btn { min-height: 46px; border-radius: 12px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .done-check circle { transform: none; opacity: 1; }
    .done-check path { stroke-dashoffset: 0; }
}

/* ============ Mobile-first: navigasi bawah, sheet, ukuran sentuh ============ */
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.account-btn { display: inline-flex; align-items: center; gap: .5rem; color: #fff; min-height: 44px; padding: 0 .25rem !important; }
.account-btn::after { opacity: .7; }
.app-nav { padding-top: max(.5rem, env(safe-area-inset-top)); }
.dropdown-menu { border: 0; border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); padding: .4rem; }
.dropdown-item { border-radius: 10px; min-height: 44px; display: flex; align-items: center; gap: .5rem; }

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; align-items: stretch;
    padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
}
.bn-item {
    flex: 1; max-width: 120px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; border-radius: 14px;
    transition: color .2s ease, transform .12s ease; -webkit-tap-highlight-color: transparent;
}
.bn-item:active { transform: scale(.92); }
.bn-icon { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; font-size: 1.2rem; transition: background-color .25s ease, color .25s ease, transform .3s var(--ease-spring); }
.bn-item.active { color: var(--brand); }
.bn-item.active .bn-icon { background: var(--brand-soft); transform: translateY(-1px); }
.bn-item:focus-visible { outline: 3px solid var(--brand-ring); }
.bn-primary .bn-icon { width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; background: var(--brand); color: #fff; font-size: 1.3rem; box-shadow: 0 8px 18px rgba(15, 118, 110, .35); }
.bn-primary.active .bn-icon { background: var(--brand-dark); }
.bn-primary { color: var(--brand); }

@media (max-width: 991.98px) {
    .has-bottom-nav main { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
    .has-bottom-nav .save-bar-static { bottom: calc(64px + env(safe-area-inset-bottom)); }
    .has-bottom-nav .toast-stack { bottom: calc(76px + env(safe-area-inset-bottom)); top: auto; }
}
@media (max-width: 575.98px) {
    /* 16px mencegah iPhone melakukan zoom otomatis saat kolom isian disentuh */
    .form-control, .form-select, .step-input, input[type="date"], input[type="month"], textarea { font-size: 16px; }
    .form-control, .form-select { min-height: 46px; border-radius: 12px; }
    main.container { padding-left: 14px; padding-right: 14px; padding-top: 1rem !important; }
    .dash-head h1, .form-head h1 { font-size: 1.45rem; }
    /* Popup muncul dari bawah seperti lembar aplikasi */
    .modal-dialog { margin: 0; max-width: none; min-height: 100%; display: flex; align-items: flex-end; }
    .modal-dialog.modal-dialog-centered { align-items: flex-end; min-height: 100%; }
    .modal-content { border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .modal.fade .modal-dialog { transform: translateY(100%); transition: transform .35s var(--ease-out); }
    .modal.show .modal-dialog { transform: none; }
    .modal-content::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 999px; background: #d5dcda; margin: .6rem auto 0; }
    .save-sheet::before { position: absolute; left: 50%; margin-left: -20px; background: rgba(255, 255, 255, .5); z-index: 1; }
    .chip { min-height: 44px; }
    .chip-row { flex-wrap: nowrap; overflow-x: auto; margin-left: -1rem; margin-right: -1rem; padding: 2px 1rem 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
    .chip-row::-webkit-scrollbar { display: none; }
    .chip-row .chip { flex: none; scroll-snap-align: start; white-space: nowrap; }
    .sv-tags, .repeat-preview { flex-wrap: wrap; }
    .cal-day { height: 44px; }
    .tl-item { position: relative; }
    .pagination .page-link { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
    .save-inner { gap: .6rem; }
    .btn-save { padding: 0 1.1rem; }
}
@media (hover: none) {
    /* Di layar sentuh, efek hover yang "menempel" setelah disentuh dimatikan */
    .tl-card:hover, .amal-grid .amal.in:hover, .cal-day:hover, .btn-cta:hover { transform: none; box-shadow: none; }
    .btn-cta:hover { box-shadow: 0 6px 16px rgba(15, 118, 110, .25); }
}
@media (max-width: 575.98px) {
    .note-toggle { min-height: 44px; }
    .table-view summary, .notes summary { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ============ Login, intip password, profil ============ */
.login-wrap { min-height: calc(100vh - 3rem); display: grid; place-items: center; padding: 1rem 0; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.75rem 1.5rem; box-shadow: 0 20px 50px rgba(15, 23, 42, .08); }
.login-logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto .8rem; display: grid; place-items: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, #0f766e, #115e59); box-shadow: 0 10px 24px rgba(15, 118, 110, .3); }
.peek-group .form-control { border-right: 0; min-height: 48px; font-size: 16px; }
.form-control-lg { min-height: 48px; font-size: 16px; border-radius: 12px; }
.peek-btn { border: 1px solid var(--bs-border-color); border-left: 0; background: #fff; color: var(--muted); min-width: 48px; border-radius: 0 12px 12px 0; }
.peek-btn:hover { color: var(--brand); background: #fff; }
.peek-btn[aria-pressed="true"] { color: var(--brand); }
.peek-btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: -3px; }
.peek-group:focus-within .form-control, .peek-group:focus-within .peek-btn { border-color: var(--brand); }
.peek-group .form-control:focus { box-shadow: none; }
.peek-group:focus-within { box-shadow: 0 0 0 .25rem var(--brand-ring); border-radius: 12px; }
.peek-group .form-control { border-radius: 12px 0 0 12px; }
.remember-row { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; min-height: 48px; }
.remember-row .form-check-input { width: 1.3em; height: 1.3em; margin-top: .1rem; flex: none; }
.remember-row small { display: block; color: var(--muted); font-size: .78rem; }
.remember-row strong { font-size: .92rem; }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.menu-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; min-height: 56px; color: var(--ink); text-decoration: none; }
.menu-row + .menu-row { border-top: 1px solid #f1f4f3; }
.menu-row > span:nth-child(2) { flex: 1; }
.menu-row small { display: block; color: var(--muted); font-size: .78rem; }
.menu-row:active { background: #f6faf9; }
.rank-full { font-weight: 400; color: var(--muted); font-size: .82rem; }


/* ============ Panduan (tutorial popup) ============ */
.help-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; margin-left: auto; margin-right: .35rem; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; flex: none; transition: background-color .2s ease, transform .12s ease; }
.help-btn:hover { background: rgba(255, 255, 255, .26); }
.help-btn:active { transform: scale(.92); }
.help-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.app-nav .navbar-nav.me-auto + .help-btn { margin-left: 0; }
.tour-overlay { position: fixed; inset: 0; z-index: 1990; }
.tour-spot {
    position: fixed; z-index: 1991; border-radius: 14px; pointer-events: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px rgba(15, 23, 42, .6);
    transition: left .32s var(--ease-out), top .32s var(--ease-out), width .32s var(--ease-out), height .32s var(--ease-out), opacity .2s ease;
}
.tour-card {
    position: fixed; z-index: 1992; background: #fff; color: var(--ink); border-radius: 18px; padding: 1rem 1.1rem .9rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35); outline: none;
}
.tour-card.centered { left: 50%; top: 50%; width: min(360px, calc(100vw - 32px)); transform: translate(-50%, -50%); text-align: center; }
.tour-card.centered ~ .x, .tour-on .tour-card.centered { box-shadow: 0 24px 60px rgba(15, 23, 42, .35), 0 0 0 9999px rgba(15, 23, 42, .6); }
.tour-card.swap:not(.centered) { animation: fadeUp .28s var(--ease-out); }
.tour-step { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.tour-title { font-size: 1.05rem; font-weight: 700; margin: .15rem 0 .3rem; }
.tour-text { font-size: .92rem; color: #334155; line-height: 1.5; }
.tour-dots { display: flex; gap: 5px; justify-content: center; margin: .8rem 0 .2rem; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: #d5dcda; transition: width .25s var(--ease-out), background-color .25s ease; }
.tour-dots i.on { width: 18px; border-radius: 999px; background: var(--brand); }
.tour-actions { display: flex; align-items: center; gap: .4rem; margin-top: .5rem; }
.tour-actions .btn { min-height: 44px; border-radius: 12px; font-weight: 600; padding: 0 1rem; }
.tour-skip { color: var(--muted); text-decoration: none; padding-left: 0 !important; }
.confirm-icon.tone-brand { background: var(--brand-soft); color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
