/* ==========================================================================
   Selaras — stylesheet utama (tanpa build step)
   ========================================================================== */

:root {
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --bg: #f7f6f2;
    --bg-soft: #fbfaf7;
    --card: #ffffff;
    --card-alt: #f2f1ec;
    --text: #1f2430;
    --text-soft: #555d6e;
    --muted: #7b8294;
    --border: #e4e2da;
    --border-strong: #d3d0c5;
    --primary: #2f5eea;
    --primary-dark: #2348c0;
    --primary-soft: #e8eeff;
    --danger: #d33c3c;
    --danger-soft: #fdeaea;
    --success: #1f8a5b;
    --success-soft: #e6f5ee;
    --warning: #b7791f;
    --warning-soft: #fdf3df;
    --info: #2563eb;
    --info-soft: #e8f0ff;
    --shadow: 0 1px 2px rgba(24, 28, 40, .06), 0 8px 24px rgba(24, 28, 40, .05);
    --radius: 12px;
    --radius-sm: 8px;
}

.theme-admin {
    --bg: #0f1026;
    --bg-soft: #13152e;
    --card: #181a34;
    --card-alt: #1e2140;
    --text: #f1f2f9;
    --text-soft: #c3c6d8;
    --muted: #8f93ad;
    --border: rgba(255, 255, 255, .1);
    --border-strong: rgba(255, 255, 255, .18);
    --primary: #6d8cff;
    --primary-dark: #5574ec;
    --primary-soft: rgba(109, 140, 255, .16);
    --danger: #ff7a7a;
    --danger-soft: rgba(255, 122, 122, .14);
    --success: #5bd6a0;
    --success-soft: rgba(91, 214, 160, .14);
    --warning: #f0c36b;
    --warning-soft: rgba(240, 195, 107, .14);
    --info: #82a7ff;
    --info-soft: rgba(130, 167, 255, .14);
    --shadow: 0 14px 40px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

/* Atribut hidden harus selalu menang atas display milik komponen. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0; }

img, svg, audio { max-width: 100%; }

code, .mono { font-family: var(--mono); font-size: .86em; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.nowrap { white-space: nowrap; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Tombol
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 38px;
    padding: .45rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s ease, opacity .15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--card-alt); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--card-alt); color: var(--text); }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { min-height: 30px; padding: .25rem .6rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; min-height: 34px; padding: 0; }

.inline-form { display: inline; margin: 0; }
.inline-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Badge, kartu, grid
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .01em;
    background: var(--card-alt);
    color: var(--text-soft);
    white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--card-alt); color: var(--muted); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: .95rem; }
.card-body { padding: 1rem; }
.card-foot { padding: .75rem 1rem; border-top: 1px solid var(--border); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.label {
    font-size: .8rem;
    font-weight: 650;
    color: var(--text-soft);
}
.input, .select, .textarea {
    width: 100%;
    min-height: 40px;
    padding: .5rem .7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.hint { font-size: .78rem; color: var(--muted); }
.error-text { color: var(--danger); font-size: .83rem; }

.checkbox-row { display: flex; align-items: flex-start; gap: .55rem; }
.checkbox-row input[type="checkbox"] { margin-top: .2rem; width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .9rem; }

.alert {
    border-radius: var(--radius-sm);
    padding: .7rem .9rem;
    font-size: .88rem;
    border: 1px solid transparent;
}
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }

/* --------------------------------------------------------------------------
   Flash
   -------------------------------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: .88rem;
}
.flash-text { flex: 1; }
.flash-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: .65;
}
.flash-close:hover { opacity: 1; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* --------------------------------------------------------------------------
   Halaman & tabel
   -------------------------------------------------------------------------- */
.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.page-heading p { color: var(--muted); font-size: .88rem; margin-top: .25rem; max-width: 70ch; }
.page-heading-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted);
}
.empty-icon { font-size: 2rem; line-height: 1; }
.empty-title { font-weight: 650; color: var(--text-soft); }
.empty-text { font-size: .85rem; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--card-alt) 55%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }

.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .input { max-width: 320px; }
.pagination { display: flex; gap: .35rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 32px;
    padding: .3rem .55rem;
    text-align: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: .82rem;
}
.pagination .is-current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(47, 94, 234, .12), transparent 34rem),
        radial-gradient(circle at 90% 90%, rgba(31, 138, 91, .1), transparent 30rem),
        var(--bg);
}
.auth-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.25rem; }
.auth-brand strong { display: block; font-size: 1.1rem; }
.auth-brand small { display: block; color: var(--muted); font-size: .78rem; }
.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.auth-title { font-size: 1.3rem; }
.auth-sub { color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; background: var(--card-alt); padding: .3rem; border-radius: 10px; margin: 1.2rem 0 1rem; }
.auth-tab {
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: .88rem;
    font-weight: 650;
    padding: .5rem .6rem;
    border-radius: 7px;
    cursor: pointer;
}
.auth-tab.is-active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.auth-form { display: flex; flex-direction: column; gap: .9rem; }
.auth-alt { margin-top: 1rem; text-align: center; font-size: .85rem; color: var(--muted); }
.auth-foot { margin-top: 1.5rem; font-size: .75rem; color: var(--muted); }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   App (anggota)
   -------------------------------------------------------------------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.app-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 60px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.app-brand { display: flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; }
.app-brand:hover { text-decoration: none; }
.app-brand strong { font-size: 1rem; }
.app-nav { display: flex; gap: .2rem; margin-left: auto; align-items: center; }
.app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .65rem;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: .87rem;
    font-weight: 600;
}
.app-nav-link:hover { background: var(--card-alt); color: var(--text); text-decoration: none; }
.app-nav-link.is-active { background: var(--primary-soft); color: var(--primary); }
.app-user { display: flex; align-items: center; gap: .5rem; margin-left: .5rem; }
.app-user-name { font-size: .8rem; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-main { max-width: 1280px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.install-banner {
    display: flex;
    width: 100%;
    max-width: 460px;
    margin: 0 auto 1rem;
    justify-content: center;
    gap: .4rem;
}

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */
.top-warning {
    background: var(--danger);
    color: #fff;
    text-align: center;
    padding: .45rem 1rem;
    font-size: .84rem;
    font-weight: 600;
}
.top-warning a { color: #fff; text-decoration: underline; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--bg-soft);
    border-right: 1px solid var(--border);
    padding: 1rem .75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .35rem 1rem; border-bottom: 1px solid var(--border); }
.admin-brand strong { display: block; font-size: 1rem; }
.admin-brand small { display: block; color: var(--muted); font-size: .72rem; }
.admin-nav { display: flex; flex-direction: column; gap: .12rem; flex: 1; overflow-y: auto; }
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .52rem .6rem;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: .87rem;
    font-weight: 550;
}
.admin-nav-link:hover { background: var(--card-alt); color: var(--text); text-decoration: none; }
.admin-nav-link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav-icon { width: 18px; text-align: center; font-size: .95rem; }
.admin-sidebar-foot { border-top: 1px solid var(--border); padding-top: .75rem; display: flex; flex-direction: column; gap: .6rem; }
.who { display: flex; align-items: center; gap: .55rem; }
.who strong { display: block; font-size: .84rem; }
.who small { display: block; color: var(--muted); font-size: .72rem; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    flex: 0 0 auto;
}
.admin-main { flex: 1; min-width: 0; padding: 1.5rem 1.6rem 3rem; }

/* --------------------------------------------------------------------------
   Ringkasan admin
   -------------------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat-card { padding: 1rem; }
.stat-label { font-size: .78rem; color: var(--muted); }
.stat-value { font-size: 1.7rem; font-weight: 700; margin-top: .15rem; letter-spacing: -.02em; }
.bar-chart { display: flex; align-items: flex-end; gap: .55rem; height: 150px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.bar-value { font-size: .74rem; color: var(--muted); }
.bar { width: 100%; max-width: 46px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, transparent)); min-height: 4px; }
.bar-label { font-size: .72rem; color: var(--muted); }
.service-list { display: flex; flex-direction: column; gap: .55rem; }
.service-item { display: flex; align-items: center; gap: .55rem; font-size: .87rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot-ok { background: var(--success); }
.dot-bad { background: var(--danger); }
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .84rem; }
.audit-item:last-child { border-bottom: 0; }
.audit-main { display: flex; flex-direction: column; gap: .1rem; }
.audit-main strong { font-weight: 650; }
.audit-time { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.audit-target { color: var(--text-soft); }
.audit-actor { color: var(--muted); font-size: .76rem; }

/* --------------------------------------------------------------------------
   Kalender
   -------------------------------------------------------------------------- */
.calendar-toolbar { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .9rem; }
.calendar-title { font-size: 1.15rem; font-weight: 700; min-width: 180px; text-transform: capitalize; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.segmented a, .segmented button {
    padding: .38rem .7rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--card);
    border: 0;
    cursor: pointer;
    text-decoration: none;
}
.segmented a.is-active, .segmented button.is-active { background: var(--primary); color: #fff; }
.calendar-layout { display: flex; gap: 1rem; align-items: flex-start; }
.calendar-main { flex: 1; min-width: 0; }
.calendar-side { width: 320px; flex: 0 0 320px; }
.calendar-card { overflow: hidden; }
.calendar-dow {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--card-alt);
    border-bottom: 1px solid var(--border);
}
.calendar-dow span { padding: .45rem .3rem; text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-cell {
    min-height: 108px;
    padding: .35rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .25rem;
    color: inherit;
    text-decoration: none;
    background: var(--card);
    min-width: 0;
    position: relative;
}
.calendar-cell > *:not(.cell-select) { position: relative; z-index: 1; }
.cell-select { position: absolute; inset: 0; z-index: 0; }
.calendar-cell .task-chip { z-index: 2; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell:hover { background: color-mix(in srgb, var(--primary-soft) 45%, var(--card)); text-decoration: none; }
.calendar-cell.is-outside { background: var(--bg-soft); color: var(--muted); }
.calendar-cell.is-selected { box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-cell.is-today .cell-date { background: var(--primary); color: #fff; }
.cell-head { display: flex; align-items: center; justify-content: space-between; }
.cell-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 .25rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}
.cell-count { font-size: .68rem; color: var(--muted); }
.task-chip {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .16rem .35rem;
    border-radius: 5px;
    font-size: .7rem;
    line-height: 1.25;
    background: var(--card-alt);
    color: var(--text-soft);
    overflow: hidden;
}
.task-chip .chip-time { font-weight: 700; font-size: .66rem; opacity: .9; flex: 0 0 auto; }
.task-chip .chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-chip.is-done { opacity: .55; text-decoration: line-through; }
.cat-rapat { background: #e8eeff; color: #2f5eea; }
.cat-tugas { background: #e6f5ee; color: #1f8a5b; }
.cat-tenggat { background: #fdeaea; color: #c43c3c; }
.cat-pribadi { background: #f3ecff; color: #7c3aed; }
.cat-default { background: var(--card-alt); color: var(--text-soft); }
.theme-admin .cat-rapat { background: rgba(109, 140, 255, .2); color: #9db4ff; }
.theme-admin .cat-tugas { background: rgba(91, 214, 160, .18); color: #7ee3b7; }
.theme-admin .cat-tenggat { background: rgba(255, 122, 122, .18); color: #ff9c9c; }
.theme-admin .cat-pribadi { background: rgba(178, 132, 255, .18); color: #c6a4ff; }
.more-count { font-size: .68rem; color: var(--muted); padding-left: .2rem; }

/* minggu */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week-day { min-height: 330px; border-right: 1px solid var(--border); padding: .4rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.week-day:last-child { border-right: 0; }
.week-day.is-today { background: color-mix(in srgb, var(--primary-soft) 40%, var(--card)); }
.week-day-head { text-align: center; padding-bottom: .35rem; border-bottom: 1px solid var(--border); margin-bottom: .2rem; }
.week-day-name { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.week-day-num { display: block; font-size: .95rem; font-weight: 700; }
.week-task { display: block; padding: .3rem .35rem; border-radius: 5px; font-size: .72rem; line-height: 1.25; overflow: hidden; }
.week-task strong { display: block; font-size: .7rem; }
.week-task span { display: block; opacity: .85; font-size: .66rem; }

/* panel hari */
.day-panel-head { padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--border); }
.day-panel-head h2 { font-size: 1rem; }
.day-panel-head p { color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.day-list { display: flex; flex-direction: column; }
.day-empty { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }
.task-row { display: flex; align-items: flex-start; gap: .55rem; padding: .7rem .85rem; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-check { margin-top: .25rem; }
.task-check button {
    width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border-strong);
    background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
}
.task-check button.is-done { background: var(--success); border-color: var(--success); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: .88rem; font-weight: 600; word-break: break-word; }
.task-title.is-done { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .2rem; font-size: .72rem; color: var(--muted); }
.task-actions { display: flex; gap: .25rem; align-items: center; }
.task-actions button,
.task-actions .task-action-link { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .15rem; border-radius: 4px; font-size: .85rem; text-decoration: none; line-height: 1; }
.task-actions button:hover,
.task-actions .task-action-link:hover { background: var(--card-alt); color: var(--text); }
.task-title-link { color: inherit; text-decoration: none; }
.task-title-link:hover { text-decoration: underline; }

.category-filter { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .9rem; }
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--card);
}
.category-pill:hover { border-color: var(--primary); text-decoration: none; }
.category-pill.is-active { border-color: currentColor; }
.category-pill[style] {
    background: color-mix(in srgb, var(--cat-color) 11%, var(--card));
    border-color: color-mix(in srgb, var(--cat-color) 35%, var(--border));
    color: color-mix(in srgb, var(--cat-color) 70%, var(--text) 30%);
}
.category-pill[style]::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cat-color);
    flex: 0 0 auto;
}
.category-pill[style].is-active {
    border-color: var(--cat-color);
    box-shadow: inset 0 0 0 1px var(--cat-color);
}
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--cat-color) 35%, var(--border));
    background: color-mix(in srgb, var(--cat-color) 12%, transparent);
    color: color-mix(in srgb, var(--cat-color) 68%, var(--text) 32%);
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.theme-admin .category-tag { background: color-mix(in srgb, var(--cat-color) 22%, transparent); }
.category-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cat-color);
    flex: 0 0 auto;
}
.category-dot-inline {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cat-color, var(--muted));
    flex: 0 0 auto;
}
.today-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--border);
    margin-bottom: .9rem;
    font-size: .84rem;
    color: var(--text-soft);
}
.today-summary strong { color: var(--text); }

/* modal */
dialog.modal {
    position: fixed;
    inset: 0;
    margin: auto;
    border: 0;
    padding: 0;
    background: transparent;
    width: min(560px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    color: var(--text);
}
dialog.modal::backdrop { background: rgba(12, 16, 30, .55); backdrop-filter: blur(2px); }
.modal-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
    overflow: hidden;
}
.modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.02rem; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.modal-body { padding: 1.1rem; }
.modal-foot { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: .5rem; padding: .85rem 1.1rem; border-top: 1px solid var(--border); background: var(--bg-soft); flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */
.timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.timeline-head p { color: var(--muted); font-size: .88rem; margin-top: .15rem; text-transform: capitalize; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: .76rem;
    font-weight: 700;
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
}
.status-pill .dot { width: 7px; height: 7px; }
.status-pill.is-live { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); background: var(--success-soft); }
.status-pill.is-live .dot { background: var(--success); animation: pulse 1.6s infinite; }
.status-pill.is-offline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-soft); }
.status-pill.is-offline .dot { background: var(--danger); }
.status-pill.is-connecting { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); background: var(--warning-soft); }
.status-pill.is-connecting .dot { background: var(--warning); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.timeline-layout { display: flex; gap: 1rem; align-items: flex-start; }
.timeline-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.timeline-side { width: 320px; flex: 0 0 320px; }
.focus-card {
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary), #6d3fe0);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.focus-eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; opacity: .82; font-weight: 700; }
.focus-title { font-size: 1.25rem; font-weight: 700; margin-top: .25rem; }
.focus-meta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .45rem; font-size: .84rem; opacity: .9; }
.focus-empty { opacity: .9; margin-top: .4rem; font-size: .9rem; }
.focus-badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: .72rem; font-weight: 700; }

.ruler { display: flex; flex-direction: column; }
.ruler-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); min-height: 44px; border-bottom: 1px dashed var(--border); }
.ruler-row:last-child { border-bottom: 0; }
.ruler-label { font-size: .72rem; color: var(--muted); padding: .35rem .4rem 0 0; text-align: right; font-variant-numeric: tabular-nums; }
.ruler-tasks { padding: .25rem 0 .25rem .6rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: .25rem; }
.ruler-task { display: flex; align-items: center; gap: .45rem; padding: .3rem .55rem; border-radius: 6px; font-size: .8rem; }
.ruler-task strong { font-weight: 650; }
.ruler-task span { font-size: .72rem; opacity: .8; }
.ruler-task.is-done { opacity: .55; }
.activity-list { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; }
.activity-item { display: flex; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--card-alt); display: flex; align-items: center; justify-content: center; font-size: .78rem; flex: 0 0 auto; }
.activity-text { font-size: .84rem; }
.activity-time { font-size: .72rem; color: var(--muted); margin-top: .12rem; }

/* --------------------------------------------------------------------------
   Rekaman
   -------------------------------------------------------------------------- */
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.upload-card { padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.upload-card h2 { font-size: .95rem; }
.upload-card p { font-size: .8rem; color: var(--muted); }
.recorder-controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.recorder-timer { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .9rem; color: var(--text-soft); }
.recording-list { display: flex; flex-direction: column; }
.recording-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}
.recording-item:last-child { border-bottom: 0; }
.recording-item:hover { background: var(--card-alt); text-decoration: none; }
.recording-item.is-selected { background: var(--primary-soft); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.status-dot.queued { background: #4f8ef7; }
.status-dot.processing { background: var(--warning); animation: pulse 1.6s infinite; }
.status-dot.done { background: var(--success); }
.status-dot.failed { background: var(--danger); }
.recording-main { flex: 1; min-width: 0; }
.recording-title { font-size: .9rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recording-meta { font-size: .74rem; color: var(--muted); margin-top: .1rem; }
.recording-duration { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-card { padding: 1.1rem; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.detail-head h1 { font-size: 1.2rem; }
.detail-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .35rem; font-size: .78rem; color: var(--muted); }
.audio-player { width: 100%; margin: 1rem 0; }
.transcript { display: flex; flex-direction: column; gap: .6rem; }
.segment { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .7rem; padding: .55rem .7rem; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border); }
.segment-time { font-family: var(--mono); font-size: .72rem; color: var(--muted); padding-top: .15rem; }
.segment-speaker { font-size: .74rem; font-weight: 700; color: var(--primary); margin-bottom: .15rem; }
.segment-text { font-size: .88rem; }
.summary-box { display: flex; flex-direction: column; gap: .9rem; }
.summary-section h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .3rem; }
.summary-section p { font-size: .88rem; }
.summary-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.summary-list li { font-size: .86rem; }
.action-item-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.action-item-row:last-child { border-bottom: 0; }
.action-item-row span { font-size: .86rem; }

/* --------------------------------------------------------------------------
   Akses & pengaturan
   -------------------------------------------------------------------------- */
.access-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.access-layout > * { min-width: 0; }
.user-picker { max-height: 640px; overflow-y: auto; }
.user-pick {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}
.user-pick:last-child { border-bottom: 0; }
.user-pick:hover { background: var(--card-alt); text-decoration: none; }
.user-pick.is-active { background: var(--primary-soft); }
.user-pick-main { flex: 1; min-width: 0; }
.user-pick-name { font-size: .86rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pick-email { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.perm-table th, .perm-table td { padding: .5rem .45rem; border-bottom: 1px solid var(--border); text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.perm-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.perm-note { font-size: .78rem; color: var(--muted); margin-bottom: .75rem; }

/* --------------------------------------------------------------------------
   Peran dinamis & matriks izin responsif
   -------------------------------------------------------------------------- */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: .85rem;
}
.role-card {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}
.role-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.role-card-title { min-width: 0; }
.role-card-title h3 { font-size: .98rem; line-height: 1.25; overflow-wrap: anywhere; }
.role-card-desc { margin: 0; overflow-wrap: anywhere; }
.role-card-meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.role-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .35rem; }
.role-card-actions .inline-form { display: flex; }

.perm-block { margin-top: .2rem; }
.perm-block[hidden] { display: none !important; }
.perm-block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .65rem; margin-bottom: .5rem; }
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: .6rem;
}
.perm-module {
    min-width: 0;
    padding: .6rem .7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-alt);
}
.perm-module-head { font-size: .82rem; font-weight: 700; margin-bottom: .4rem; overflow-wrap: anywhere; }
.perm-actions { display: flex; flex-wrap: wrap; gap: .35rem .75rem; }
.perm-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; cursor: pointer; }
.perm-check input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--primary); }
.perm-summary { display: flex; flex-wrap: wrap; gap: .3rem; }

.role-select-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.role-select-row .select { flex: 1 1 180px; min-width: 0; max-width: 280px; }
.settings-section { padding: 1rem; }
.settings-section + .settings-section { border-top: 1px solid var(--border); }
.settings-section h2 { font-size: .95rem; margin-bottom: .2rem; }
.settings-section > p { color: var(--muted); font-size: .82rem; margin-bottom: .75rem; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1rem; align-items: start; }

/* --------------------------------------------------------------------------
   Responsif
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-layout, .timeline-layout { flex-direction: column; }
    .calendar-side, .timeline-side { width: 100%; flex: 1 1 auto; }
    .access-layout { grid-template-columns: 1fr; }
    .user-picker { max-height: 320px; }
}
@media (max-width: 860px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; flex: none; height: auto; position: static; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-nav-link { flex: 1 1 auto; justify-content: center; }
    .admin-sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; }
    .admin-main { padding: 1rem; }
    .app-nav .nav-label { display: none; }
    .app-user-name { display: none; }
    .upload-grid, .profile-grid, .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .checkbox-grid { grid-template-columns: 1fr; }
}
/* --------------------------------------------------------------------------
   Status task
   -------------------------------------------------------------------------- */
.st-choose   { --st-color: #ffffff; --st-bg: #ffffff; --st-text: #4b5568; --st-border: #cdd2dc; }
.st-on-going { --st-color: #949cb0; --st-bg: #eef0f4; --st-text: #545e74; --st-border: #d6dae2; }
.st-progress { --st-color: #2f6fe4; --st-bg: #e8f0ff; --st-text: #1f5fd0; --st-border: #bcd3ff; }
.st-pending  { --st-color: #e0a32c; --st-bg: #fdf3df; --st-text: #9a6212; --st-border: #f0dcae; }
.st-done     { --st-color: #1f8a5b; --st-bg: #e6f5ee; --st-text: #177a4f; --st-border: #bfe6d4; }
.st-cancel   { --st-color: #d33c3c; --st-bg: #fdeaea; --st-text: #b32f2f; --st-border: #f3c9c9; }

.theme-admin .st-choose   { --st-color: #e6e8f2; --st-bg: rgba(255, 255, 255, .1); --st-text: #e6e8f2; --st-border: rgba(255, 255, 255, .28); }
.theme-admin .st-on-going { --st-color: #a8b0c6; --st-bg: rgba(255, 255, 255, .08); --st-text: #c3c6d8; --st-border: rgba(255, 255, 255, .18); }
.theme-admin .st-progress { --st-color: #82a7ff; --st-bg: rgba(130, 167, 255, .18); --st-text: #a9c1ff; --st-border: rgba(130, 167, 255, .4); }
.theme-admin .st-pending  { --st-color: #f0c36b; --st-bg: rgba(240, 195, 107, .18); --st-text: #f5d391; --st-border: rgba(240, 195, 107, .4); }
.theme-admin .st-done     { --st-color: #5bd6a0; --st-bg: rgba(91, 214, 160, .18); --st-text: #82e4bb; --st-border: rgba(91, 214, 160, .4); }
.theme-admin .st-cancel   { --st-color: #ff7a7a; --st-bg: rgba(255, 122, 122, .18); --st-text: #ff9c9c; --st-border: rgba(255, 122, 122, .4); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--st-border, var(--border));
    background: var(--st-bg, var(--card-alt));
    color: var(--st-text, var(--text-soft));
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--st-color, var(--muted));
    border: 1px solid color-mix(in srgb, var(--st-color, var(--muted)) 55%, #000 12%);
    flex: 0 0 auto;
}
.status-badge .status-dot-inline { background: var(--st-color); }
.st-choose .status-dot-inline { border-color: #b9c0cd; background: #fff; }

.status-select {
    width: auto;
    min-width: 118px;
    min-height: 32px;
    padding: .2rem 1.6rem .2rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--st-border, var(--border-strong));
    background-color: var(--st-bg, var(--bg-soft));
    color: var(--st-text, var(--text));
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
}
.status-select.is-saving { opacity: .55; }
.status-form { margin: .1rem 0 0; flex: 0 0 auto; }
.task-status-static { flex: 0 0 auto; }

.task-chip.st-choose, .task-chip.st-on-going, .task-chip.st-progress,
.task-chip.st-pending, .task-chip.st-done, .task-chip.st-cancel,
.week-task.st-choose, .week-task.st-on-going, .week-task.st-progress,
.week-task.st-pending, .week-task.st-done, .week-task.st-cancel {
    background: var(--st-bg);
    color: var(--st-text);
    border-left: 3px solid var(--st-color);
}
.task-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cat-color, var(--muted));
    flex: 0 0 auto;
}
.task-chip.cat-rapat::before   { background: #2f5eea; }
.task-chip.cat-tugas::before   { background: #1f8a5b; }
.task-chip.cat-tenggat::before { background: #c43c3c; }
.task-chip.cat-pribadi::before { background: #7c3aed; }
.task-chip.cat-default::before { background: var(--muted); }
.task-chip.st-choose, .week-task.st-choose { border-left-color: #c9cfda; }
.task-chip.is-done { opacity: .5; }
.task-row { border-left: 3px solid transparent; }
.task-row.st-choose { border-left-color: transparent; }
.task-row.st-on-going, .task-row.st-progress, .task-row.st-pending,
.task-row.st-done, .task-row.st-cancel { border-left-color: var(--st-color); }

.summary-status { display: inline-flex; align-items: center; gap: .3rem; }
.category-pill .st-choose .status-dot-inline { border-color: #b9c0cd; }

/* --------------------------------------------------------------------------
   Rekap bulanan
   -------------------------------------------------------------------------- */
.calendar-layout.has-recap .calendar-side { width: 360px; flex-basis: 360px; }
.calendar-side { display: flex; flex-direction: column; gap: 1rem; }
.recap-card { overflow: hidden; }
.recap-head { align-items: flex-start; }
.recap-head h2 { font-size: 1rem; }
.recap-nav { display: flex; gap: .25rem; }
.recap-filter { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.recap-filter .input { max-width: 170px; }
.input-sm { min-height: 32px; padding: .25rem .5rem; font-size: .82rem; }
.recap-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: .9rem 0; }
.recap-count {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .5rem;
    border-radius: 8px;
    border: 1px solid var(--st-border);
    background: var(--st-bg);
    color: var(--st-text);
    font-size: .76rem;
    font-weight: 650;
}
.recap-count strong { margin-left: auto; font-size: .92rem; }
.recap-count.is-zero { opacity: .5; }
.recap-count-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-groups { display: flex; flex-direction: column; gap: .45rem; }
.recap-group { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); overflow: hidden; }
.recap-group > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .55rem;
    cursor: pointer;
    list-style: none;
}
.recap-group > summary::-webkit-details-marker { display: none; }
.recap-group > summary::before {
    content: '▸';
    font-size: .7rem;
    color: var(--muted);
    transition: transform .15s ease;
}
.recap-group[open] > summary::before { transform: rotate(90deg); }
.recap-group-count { margin-left: auto; font-size: .76rem; font-weight: 700; color: var(--text-soft); }
.recap-empty { padding: .1rem .7rem .6rem; font-size: .78rem; color: var(--muted); }
.recap-list { list-style: none; margin: 0; padding: 0 0 .25rem; }
.recap-item {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: .15rem .5rem;
    padding: .38rem .65rem;
    color: inherit;
    font-size: .8rem;
    border-top: 1px dashed var(--border);
}
.recap-item:hover { background: var(--card); text-decoration: none; }
.recap-item-date { font-weight: 650; color: var(--text-soft); font-size: .74rem; white-space: nowrap; }
.recap-item-date .muted { display: block; font-weight: 500; }
.recap-item-title { min-width: 0; overflow-wrap: anywhere; }
.recap-item-meta { grid-column: 2; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .7rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Lonceng notifikasi
   -------------------------------------------------------------------------- */
.notif { position: relative; }
.notif-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 34px;
    padding: .25rem .5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    cursor: pointer;
    position: relative;
}
.notif-toggle:hover { background: var(--card-alt); color: var(--text); }
.notif-icon { font-size: 1rem; line-height: 1; }
.notif-count {
    min-width: 18px;
    height: 18px;
    padding: 0 .28rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notif-count[hidden] { display: none; }
.notif-panel {
    position: absolute;
    top: calc(100% + .45rem);
    right: 0;
    width: min(360px, calc(100vw - 2rem));
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(12, 16, 30, .25);
    z-index: 70;
    overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.notif-head strong { font-size: .85rem; }
.notif-read-all { border: 0; background: transparent; color: var(--primary); font: inherit; font-size: .74rem; font-weight: 650; cursor: pointer; padding: .2rem; }
.notif-read-all:hover { text-decoration: underline; }
.notif-read-all[hidden] { display: none; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: .55rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--card-alt); text-decoration: none; }
.notif-item.is-unread { background: color-mix(in srgb, var(--primary-soft) 55%, var(--card)); }
.notif-dot { width: 9px; height: 9px; margin-top: .3rem; border-radius: 50%; background: var(--st-color, var(--muted)); flex: 0 0 auto; }
.notif-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.notif-title { font-size: .82rem; font-weight: 700; }
.notif-message { font-size: .78rem; color: var(--text-soft); overflow-wrap: anywhere; }
.notif-time { font-size: .7rem; color: var(--muted); }
.notif-empty { padding: 1rem .75rem; text-align: center; font-size: .82rem; color: var(--muted); }

.admin-nav-label {
    display: block;
    padding: .55rem .6rem .2rem;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
}
.admin-nav-label:first-child { padding-top: .15rem; }
.admin-sidebar-foot .notif { width: 100%; }
.admin-sidebar-foot .notif-toggle { width: 100%; justify-content: flex-start; border-color: var(--border); background: var(--card); }
.admin-sidebar-foot .notif-panel { top: auto; bottom: calc(100% + .45rem); left: 0; right: auto; }
.app-brand-tag {
    padding: .1rem .42rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Penyesuaian proporsional & responsif
   -------------------------------------------------------------------------- */
.calendar-cell { min-height: clamp(92px, 10.5vw, 132px); }
.calendar-grid { grid-auto-rows: minmax(92px, auto); }
.calendar-side .card { min-width: 0; }

@media (max-width: 1100px) {
    .calendar-layout.has-recap .calendar-side { width: 100%; flex-basis: auto; }
    .calendar-layout.has-recap .calendar-main { width: 100%; }
    .recap-counts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .admin-sidebar-foot .notif-panel { bottom: auto; top: calc(100% + .45rem); }
}
@media (max-width: 860px) {
    .admin-nav-label { flex: 1 1 100%; padding-left: .2rem; }
    .admin-sidebar-foot { flex-wrap: wrap; }
    .admin-sidebar-foot .notif { width: auto; }
    .admin-sidebar-foot .notif-toggle { width: auto; justify-content: center; }
    .app-brand-tag { display: none; }
    .recap-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    body { font-size: 14px; }
    .app-main { padding: .9rem .7rem 2.5rem; }
    .app-header-inner { padding: 0 .6rem; gap: .4rem; }
    .app-nav-link { padding: .4rem .4rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .calendar-cell { min-height: 78px; padding: .25rem; }
    .calendar-grid { grid-auto-rows: minmax(78px, auto); }
    .calendar-cell .task-chip:nth-of-type(n+3) { display: none; }
    .week-grid { grid-template-columns: 1fr; }
    .week-day { min-height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .week-day-head { text-align: left; display: flex; align-items: baseline; gap: .4rem; }
    .week-day-name, .week-day-num { display: inline; }
    .day-panel { border-radius: var(--radius); }
    .segment { grid-template-columns: 1fr; gap: .2rem; }
    .modal-card { border-radius: 12px; }
    .page-heading { flex-direction: column; }
    .recap-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .recap-item { grid-template-columns: 64px minmax(0, 1fr); }
    .notif-panel { position: fixed; top: 62px; right: .6rem; left: .6rem; width: auto; max-height: 65vh; }
    .admin-sidebar-foot .notif-panel { position: fixed; top: 62px; bottom: auto; }
    .status-select { min-width: 104px; font-size: .74rem; }
    .task-row { padding: .6rem .65rem; }
    .role-select-row .select { max-width: none; flex: 1 1 100%; }
    .role-select-row .btn { width: 100%; }
    .role-card-actions .btn, .role-card-actions .inline-form { flex: 1 1 auto; }
    .role-card-actions .inline-form .btn { width: 100%; }
    .form-actions { flex-wrap: wrap; }
}
@media (max-width: 365px) {
    /* Layar sangat sempit: tampilkan logo saja agar header tidak meluber. */
    .app-brand strong { display: none; }
}

/* --------------------------------------------------------------------------
   Kategori dinamis (panel superadmin)
   -------------------------------------------------------------------------- */
.color-field { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.color-input {
    width: 58px;
    height: 40px;
    padding: .2rem;
    cursor: pointer;
    flex: 0 0 auto;
}
.color-choices { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.color-choice {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--card);
    background: var(--swatch);
    box-shadow: 0 0 0 1px var(--border);
    cursor: pointer;
}
.color-choice:hover { transform: scale(1.08); }
.category-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--swatch);
    box-shadow: 0 0 0 1px var(--border);
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Popup detail task
   -------------------------------------------------------------------------- */
.modal.modal-wide {
    width: min(780px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
}
.modal-wide .modal-card { max-height: min(88vh, calc(100dvh - 2rem)); }
.detail-badges { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
    padding: .85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-soft);
}
.detail-fact { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.detail-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}
.detail-fact strong { font-size: .82rem; font-weight: 650; word-break: break-word; }
.detail-section { margin-top: 1.15rem; }
.detail-section h3 { font-size: .9rem; margin-bottom: .45rem; }
.detail-notes {
    padding: .7rem .8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-alt);
    font-size: .85rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.attachment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.attachment-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}
.attachment-icon { font-size: 1.15rem; flex: 0 0 auto; }
.attachment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.attachment-main a { font-size: .83rem; font-weight: 650; word-break: break-word; }
.attachment-meta { font-size: .72rem; color: var(--muted); }
.attachment-upload {
    margin-top: .7rem;
    padding: .7rem;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
}
.attachment-upload .inline-actions { margin-top: .35rem; }
.detail-log { list-style: none; margin: 0; padding: 0 0 0 .15rem; border-left: 2px solid var(--border); }
.detail-log-item { position: relative; padding: .05rem 0 .8rem 1rem; }
.detail-log-item:last-child { padding-bottom: 0; }
.detail-log-dot {
    position: absolute;
    left: -7px;
    top: .28rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--st-color, var(--muted));
    border: 2px solid var(--card);
    box-shadow: 0 0 0 1px var(--border);
}
.detail-log-main { display: flex; flex-direction: column; gap: .12rem; }
.detail-log-main strong { font-size: .85rem; }
.detail-log-title { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .82rem; }
.detail-log-meta { font-size: .73rem; color: var(--muted); }
.detail-log-arrow { color: var(--muted); font-weight: 700; }

@media (max-width: 620px) {
    dialog.modal {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    .modal-card,
    .modal-wide .modal-card {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .65rem; }
    .attachment-item { align-items: flex-start; flex-wrap: wrap; }
    .attachment-item .btn { margin-left: 1.6rem; }
}


/* --------------------------------------------------------------------------
   Branding, pemilih cetak, dan halaman cetak task
   -------------------------------------------------------------------------- */
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--border);
    overflow: hidden;
    flex: 0 0 auto;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.auth-contact { margin-top: 1.1rem; margin-bottom: -.7rem; max-width: 430px; text-align: center; }
.app-foot {
    display: flex;
    justify-content: space-between;
    gap: .5rem 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
    font-size: .74rem;
    color: var(--muted);
}
.branding-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 48px;
    padding: .45rem .6rem;
    margin-bottom: .5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-soft);
}
.branding-preview img { max-width: 180px; max-height: 72px; object-fit: contain; display: block; }
.branding-preview.is-favicon img { max-width: 36px; max-height: 36px; }

.timeline-toolbar {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .9rem;
}
.date-jump { display: flex; align-items: center; gap: .35rem; }

.print-form { display: none !important; }
.print-check {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: var(--text-soft);
    cursor: pointer;
    white-space: nowrap;
}
.print-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.task-select { flex: 0 0 auto; padding-top: .1rem; }
.print-toolbar {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    padding: .55rem .85rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}
.print-toolbar .btn { margin-left: auto; }
.print-toolbar-recap {
    margin: .55rem .65rem .1rem;
    padding: .5rem .6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.recap-list li { display: flex; align-items: flex-start; gap: .15rem; }
.recap-list li .recap-item { flex: 1; min-width: 0; }
.recap-check { padding: .42rem 0 0 .35rem; }
.result-form {
    margin-top: .7rem;
    padding: .7rem;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
}
.result-form .label { display: block; margin-bottom: .35rem; }

.print-document {
    background: #fff;
    color: #172033;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}
.print-doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 2px solid #172033;
}
.print-brand { display: flex; align-items: flex-start; gap: .65rem; min-width: 0; }
.print-brand .brand-logo, .print-brand .brand-mark { width: 46px; height: 46px; }
.print-brand strong { display: block; font-size: 1.05rem; }
.print-brand span { display: block; max-width: 420px; font-size: .74rem; color: #5b6475; overflow-wrap: anywhere; }
.print-doc-meta { text-align: right; }
.print-doc-meta h1 { font-size: 1.25rem; }
.print-doc-meta p { font-size: .74rem; color: #5b6475; }
.print-task {
    margin-top: 1.3rem;
    padding-top: 1rem;
    border-top: 1px solid #d8dde8;
    break-inside: avoid;
    page-break-inside: avoid;
}
.print-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.print-task-head h2 { font-size: 1rem; display: flex; align-items: baseline; gap: .45rem; }
.print-task-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #172033;
    color: #fff;
    font-size: .72rem;
    flex: 0 0 auto;
}
.print-task-badges { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.print-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .55rem .9rem;
    margin: .7rem 0 0;
    padding: .65rem .75rem;
    border: 1px solid #e2e6ee;
    border-radius: 8px;
    background: #f8f9fc;
}
.print-facts dt {
    font-size: .63rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7385;
}
.print-facts dd { margin: .1rem 0 0; font-size: .78rem; font-weight: 600; overflow-wrap: anywhere; }
.print-block { margin-top: .8rem; }
.print-block h3 { font-size: .8rem; margin-bottom: .3rem; }
.print-text {
    padding: .55rem .65rem;
    border: 1px solid #e2e6ee;
    border-radius: 7px;
    background: #fbfbfd;
    font-size: .78rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.print-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; font-size: .76rem; }
.print-list li { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; }
.print-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.print-table th, .print-table td { padding: .35rem .45rem; border-bottom: 1px solid #e2e6ee; text-align: left; vertical-align: top; }
.print-table th { background: #f3f5fa; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7385; }
.print-doc-foot {
    display: flex;
    justify-content: space-between;
    gap: .4rem 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: .75rem;
    border-top: 1px solid #d8dde8;
    font-size: .68rem;
    color: #6b7385;
}

@media print {
    @page { margin: 14mm; }
    body.theme-app { background: #fff !important; }
    .app-header, .app-foot, .install-app, .install-banner, .flash-stack, .no-print { display: none !important; }
    .app-main { max-width: none; padding: 0 !important; margin: 0 !important; }
    .print-document {
        border: 0;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        background: #fff;
    }
    .print-document a { color: inherit; text-decoration: none; }
    .print-task { page-break-inside: avoid; }
    .print-doc-foot { page-break-inside: avoid; }
}
