/* Tema: hijau emerald (ARK to do) */
:root {
    --bs-primary: #059669;
    --bs-primary-rgb: 5, 150, 105;
    --bs-link-color: #047857;
    --bs-link-hover-color: #065f46;
    --app-bg: #e8f7f0;
    --app-bg-mid: #f0fdf9;
    --app-surface: #ffffff;
    --app-text: #0f172a;
    --app-text-soft: #334155;
    --app-muted: #64748b;
    --app-border: rgba(6, 95, 70, 0.14);
    --app-radius: 0.85rem;
    --app-radius-sm: 0.5rem;
    --sidebar-width: 260px;
    --sidebar-from: #022c22;
    --sidebar-via: #065f46;
    --sidebar-to: #059669;
    --accent-soft: rgba(5, 150, 105, 0.12);
    --accent-shadow: rgba(6, 95, 70, 0.1);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 24px rgba(2, 44, 34, 0.07);
    --focus-ring: 0 0 0 0.2rem rgba(5, 150, 105, 0.22);
}

.app-body {
    background: linear-gradient(180deg, var(--app-bg) 0%, var(--app-bg-mid) 38%, #f8fafc 100%);
    background-attachment: fixed;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--app-text-soft);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.app-wrapper {
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    max-height: 100vh;
    background: linear-gradient(165deg, var(--sidebar-from) 0%, var(--sidebar-via) 45%, var(--sidebar-to) 100%) !important;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 1040;
    transition: transform 0.25s ease;
    box-shadow: 4px 0 32px rgba(2, 44, 34, 0.35);
    overflow: hidden;
}

.sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.92);
    border-radius: var(--app-radius-sm);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar .nav-link i {
    width: 1.15rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.95;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.22);
    font-weight: 600;
    color: #fff;
    box-shadow: 0 8px 18px rgba(2, 44, 34, 0.18);
}

.sidebar-brand-logo {
    object-fit: contain;
    border-radius: 0.5rem;
}

.main-content {
    min-width: 0;
    background: var(--app-bg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1042;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--app-border) !important;
}

.topbar-app {
    box-shadow: var(--shadow-sm);
}

.content-area {
    max-width: 1320px;
    margin: 0 auto;
    padding-bottom: 2.5rem;
}

.content-area > .alert {
    margin-bottom: 1rem;
}

.stat-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--shadow-md);
    background: var(--app-surface);
    overflow: hidden;
}

.stat-card .card-header {
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%) !important;
    border-bottom: 1px solid var(--app-border);
    padding: 0.85rem 1.15rem;
    font-weight: 600;
    color: var(--app-text);
}

.stat-card .card-body {
    padding: 1.15rem 1.25rem;
}

.stat-card .icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.table-hover tbody tr:hover {
    background-color: var(--accent-soft);
}

.stat-card .table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.stat-card .table > :not(caption) > * > * {
    padding: 0.7rem 1rem;
    vertical-align: middle;
}

.stat-card .table thead th,
.stat-card .table-light th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted);
    border-bottom-color: var(--app-border);
    white-space: nowrap;
}

.stat-card .table-responsive {
    border-radius: 0;
}

.stat-card > .table-responsive:last-child {
    border-radius: 0 0 calc(var(--app-radius) - 1px) calc(var(--app-radius) - 1px);
}

.progress-thin {
    height: 8px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 44, 34, 0.55);
    z-index: 1035;
}

body.sidebar-open .sidebar-backdrop {
    display: block;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 0 0 2rem rgba(0, 0, 0, 0.3);
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    /* Keep footer actions visible on mobile (incl. "Keluar") */
    .sidebar-nav {
        max-height: calc(100dvh - 230px);
        overflow-y: auto;
    }

    .sidebar-footer {
        margin-top: auto;
        background: inherit;
    }
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(165deg, #ccfbf1 0%, #ecfdf5 42%, #f8fafc 100%) !important;
}

.login-brand-logo {
    max-height: 56px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
}

.login-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* —— Kalender tugas —— */
.calendar-card-wrap .calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.calendar-grid {
    min-width: min(100%, 720px);
    margin: 0 auto;
}

.calendar-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
}

.calendar-row-head {
    margin-bottom: 4px;
}

.calendar-weekday {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0.5rem 0.25rem;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}

.calendar-cell-empty {
    min-height: 4.5rem;
    border-radius: 0.5rem;
    background: #fafafa;
    border: 1px dashed #e5e7eb;
    pointer-events: none;
}

.calendar-cell {
    position: relative;
    min-height: 4.75rem;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    padding: 0.35rem 0.2rem 0.25rem;
    text-decoration: none;
    color: #334155;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.15rem;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    background: #fff;
    overflow: hidden;
}

/* Make whole cell clickable without nesting anchors */
.calendar-cell-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.calendar-plus,
.calendar-sched-list,
.calendar-count,
.calendar-cell-badges,
.calendar-day-num {
    position: relative;
    z-index: 2;
}
.calendar-sched-item {
    position: relative;
    z-index: 3;
}

@media (min-width: 768px) {
    .calendar-cell {
        min-height: 5.5rem;
        padding: 0.45rem 0.25rem 0.35rem;
    }

    .calendar-cell-empty {
        min-height: 5.5rem;
    }
}

.calendar-cell:hover {
    background: #ecfdf5;
    border-color: #34d399;
    color: #064e3b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.calendar-cell-weekend {
    background: #f0fdf4;
}

.calendar-cell-busy {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}

.calendar-cell-today:not(.calendar-cell-selected) {
    outline: 2px solid #059669;
    outline-offset: -1px;
}

.calendar-cell-selected {
    border-color: #059669 !important;
    background: #d1fae5 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.35);
    z-index: 1;
}

.calendar-day-num {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    color: #1e293b;
    text-align: center;
}

.calendar-cell-today .calendar-day-num {
    color: #059669;
}

.calendar-cell-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    min-height: 1.1rem;
}

.calendar-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    min-width: 1.1rem;
    padding: 0.2em 0.35em;
    border-radius: 999px;
    color: #fff;
}

.calendar-pill--mulai {
    background: #059669;
}

.calendar-pill--deadline {
    background: #dc2626;
}

.calendar-pill--schedule {
    background: #7c3aed;
}

.calendar-plus {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.75rem;
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.10);
    cursor: default;
}

.calendar-plus.js-cal-quick-add {
    cursor: pointer;
    z-index: 3;
}
.calendar-plus.js-cal-quick-add:hover {
    background: rgba(5, 150, 105, 0.14);
    border-color: rgba(5, 150, 105, 0.35);
}

.calendar-sched-list {
    display: block;
    margin-top: 0.35rem;
    text-align: left;
    width: 100%;
    padding: 0 0.25rem;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.calendar-sched-item {
    display: block;
    border-radius: 10px;
    padding: 0.28rem 0.4rem;
    margin-top: 0.25rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.calendar-sched-item:hover {
    filter: brightness(0.98);
    border-color: rgba(15, 23, 42, 0.18);
}

.calendar-sched-time {
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
    opacity: 0.95;
}
.calendar-sched-title {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 0.12rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.calendar-sched-meta {
    font-size: 0.62rem;
    line-height: 1.1;
    margin-top: 0.12rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-count {
    margin-top: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: #047857;
    background: rgba(5, 150, 105, 0.12);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    line-height: 1.2;
}

.calendar-legend .calendar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-dot--mulai {
    background: #059669;
}

.calendar-dot--deadline {
    background: #dc2626;
}

.calendar-dot--count {
    background: #d1fae5;
    border: 1px solid #059669;
}

.calendar-dot--schedule {
    background: #ede9fe;
    border: 1px solid #7c3aed;
}

.calendar-dot--today {
    background: #fff;
    border: 2px solid #059669;
}

/* Week time-grid (penjadwalan jam) */
.week-cal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.week-cal {
    min-width: 980px;
}

.week-cal-grid {
    display: grid;
    grid-template-columns: 64px repeat(7, minmax(120px, 1fr));
    gap: 8px;
    align-items: start;
}

.week-cal-corner {
    height: 44px;
}

.week-cal-head {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 8px 6px;
}

.week-time-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.week-hour-label {
    height: 44px;
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.week-day-col {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.week-day-col--today {
    outline: 2px solid rgba(5, 150, 105, 0.35);
    outline-offset: 1px;
}

.week-day-inner {
    position: relative;
    height: calc(17 * 44px); /* 06:00–22:00 inclusive = 17 hours */
}

.week-hour {
    height: 44px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.week-ev {
    position: absolute;
    box-sizing: border-box;
    padding: 4px 6px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(124, 58, 237, 0.12);
    overflow: hidden;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.week-ev--team {
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.10);
}

.week-ev-time {
    font-size: 0.68rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.week-ev-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.15;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.week-ev-meta {
    margin-top: 2px;
    font-size: 0.66rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-nav {
    max-width: 100%;
}

@media (min-width: 768px) {
    .calendar-nav {
        min-width: 260px;
    }
}

.calendar-month-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: #064e3b;
    line-height: 1.2;
}

.calendar-detail-card .card-header {
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Paksa warna di atas stylesheet Bootstrap (CDN) */
.btn-primary,
.btn-primary:focus {
    --bs-btn-bg: #059669;
    --bs-btn-border-color: #059669;
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-primary:hover,
.btn-primary:active {
    --bs-btn-hover-bg: #047857;
    --bs-btn-hover-border-color: #047857;
    --bs-btn-active-bg: #065f46;
    --bs-btn-active-border-color: #065f46;
    background-color: #047857 !important;
    border-color: #047857 !important;
}

.btn-outline-primary {
    --bs-btn-color: #047857;
    --bs-btn-border-color: #059669;
    color: #047857 !important;
    border-color: #059669 !important;
}

.btn-outline-primary:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #fff !important;
}

.bg-primary {
    background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important;
}

.text-primary {
    color: #047857 !important;
}

.badge.bg-primary {
    background-color: #059669 !important;
}

/* —— Badge peran (warna berbeda, teks selalu terbaca) —— */
.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2em 0.55em;
    border-radius: 0.375rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    border: 1px solid transparent;
}

.role-badge--super_admin {
    background: rgba(219, 234, 254, 0.76);
    color: #1e40af;
    border-color: rgba(147, 197, 253, 0.58);
}

.role-badge--pengawas {
    background: rgba(209, 250, 229, 0.78);
    color: #065f46;
    border-color: rgba(110, 231, 183, 0.62);
}

.role-badge--karyawan {
    background: rgba(243, 244, 246, 0.9);
    color: #374151;
    border-color: rgba(209, 213, 219, 0.82);
}

.role-badge--unknown {
    background: rgba(243, 244, 246, 0.85);
    color: #4b5563;
    border-color: rgba(209, 213, 219, 0.8);
}

.sidebar .role-badge {
    font-size: 0.8rem;
    padding: 0.28em 0.65em;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(209, 213, 219, 0.7);
    color: #1f2937;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.topbar .role-badge {
    font-size: 0.8rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* —— Form, modal, notifikasi —— */
.form-control,
.form-select {
    border-radius: var(--app-radius-sm);
    border-color: #cbd5e1;
}

.form-control:focus,
.form-select:focus {
    border-color: #34d399;
    box-shadow: var(--focus-ring);
}

.form-label {
    font-weight: 500;
    color: var(--app-text);
    margin-bottom: 0.35rem;
}

.btn {
    border-radius: var(--app-radius-sm);
    font-weight: 500;
    padding: 0.45rem 0.95rem;
}

.btn-sm {
    padding: 0.3rem 0.65rem;
}

.btn-lg {
    padding: 0.6rem 1.15rem;
}

.modal-content {
    border: none;
    border-radius: var(--app-radius);
    box-shadow: 0 1.25rem 3rem rgba(2, 44, 34, 0.14);
}

.modal-header {
    border-bottom-color: var(--app-border);
    padding: 1rem 1.25rem;
}

.modal-footer {
    border-top-color: var(--app-border);
    padding: 0.85rem 1.25rem;
}

.modal-body {
    padding: 1.15rem 1.25rem;
}

.alert-app {
    border: none;
    border-radius: var(--app-radius-sm);
    box-shadow: var(--shadow-sm);
}

.alert-app.alert-dismissible .btn-close {
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.5rem;
}

.alert-success.alert-app {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #064e3b;
}

.alert-danger.alert-app {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #7f1d1d;
}

.text-muted {
    color: var(--app-muted) !important;
}

.badge {
    font-weight: 600;
    padding: 0.35em 0.55em;
}

.login-card .card-body {
    padding: 1.5rem 1.35rem;
}

@media (min-width: 576px) {
    .login-card .card-body {
        padding: 1.75rem 2rem;
    }
}

.login-page .form-control {
    border-radius: var(--app-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .calendar-cell {
        transition: none !important;
    }

    .calendar-cell:hover {
        transform: none;
    }
}

/* Pratinjau lampiran bukti (gambar / PDF) */
.attachment-preview-thumb img {
    max-height: 180px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: #f8fafc;
}

.attachment-preview-pdf iframe {
    background: #f8fafc;
}

.attachment-table-thumb img {
    max-height: 42px;
    max-width: 56px;
    width: auto;
    object-fit: cover;
    border-radius: 0.35rem;
    border: 1px solid var(--app-border);
    vertical-align: middle;
    background: #f8fafc;
}

/* =========================================================
   Liquid Glass Theme (Apple-like)
   UI-only layer: overrides existing components globally
   ========================================================= */

:root {
    --lg-font: "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --lg-text: #111827;
    --lg-text-soft: #1f2937;
    --lg-muted: #6b7280;
    --lg-surface: rgba(255, 255, 255, 0.38);
    --lg-surface-strong: rgba(255, 255, 255, 0.52);
    --lg-surface-soft: rgba(255, 255, 255, 0.24);
    --lg-border: rgba(255, 255, 255, 0.34);
    --lg-border-soft: rgba(255, 255, 255, 0.2);
    --lg-blur: 18px;
    --lg-blur-strong: 28px;
    --lg-radius: 22px;
    --lg-radius-sm: 16px;
    --lg-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
    --lg-shadow-hover: 0 8px 18px rgba(37, 99, 235, 0.12), 0 3px 8px rgba(15, 23, 42, 0.06);
    --lg-primary: #4f9dff;
    --lg-primary-2: #7cb7ff;
    --lg-primary-soft: rgba(79, 157, 255, 0.22);
    --lg-focus: 0 0 0 0.2rem rgba(79, 157, 255, 0.22);
}

.app-body {
    font-family: var(--lg-font);
    color: var(--lg-text-soft);
    background: #ffffff !important;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

.app-body::before,
.app-body::after {
    display: none;
}

.main-content {
    background: #ffffff;
}

.topbar,
.sidebar,
.stat-card,
.modal-content,
.alert-app,
.card,
.table-responsive,
.calendar-card-wrap .calendar-scroll {
    background: var(--lg-surface) !important;
    backdrop-filter: blur(var(--lg-blur));
    -webkit-backdrop-filter: blur(var(--lg-blur));
    border: 1px solid var(--lg-border) !important;
    box-shadow: var(--lg-shadow);
}

h1, h2, h3, h4, h5, h6,
.card-title,
.fw-semibold,
.modal-title,
label,
.form-label {
    color: var(--lg-text) !important;
}

p,
td,
th,
small,
.small,
.form-text,
.text-muted {
    color: var(--lg-text-soft);
}

a {
    color: #2563eb;
}

a:hover {
    color: #1d4ed8;
}

.topbar {
    border-radius: 0 0 var(--lg-radius) var(--lg-radius);
    background: var(--lg-surface-strong) !important;
    z-index: 1045;
}

.topbar::after,
.stat-card::before,
.modal-content::before,
.sidebar::after {
    content: "";
    position: absolute;
    pointer-events: none;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 35%, rgba(255, 255, 255, 0.02) 100%);
}

.topbar::after {
    opacity: 0.65;
}

.sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(249, 250, 251, 0.72) 100%) !important;
    color: var(--lg-text);
    border-radius: 0 24px 24px 0;
    border-right-color: rgba(209, 213, 219, 0.58) !important;
    box-shadow: 3px 0 10px rgba(15, 23, 42, 0.08), 1px 0 4px rgba(15, 23, 42, 0.04);
}

.sidebar .nav-link {
    color: #1f2937;
    border-radius: 14px;
    transition: transform 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease, color 0.35s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: rgba(239, 246, 255, 0.86);
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.12);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(191, 219, 254, 0.75), rgba(219, 234, 254, 0.75));
    color: #1d4ed8;
    border: 1px solid rgba(147, 197, 253, 0.55);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.12);
}

.sidebar-footer,
.sidebar-brand {
    border-color: rgba(148, 163, 184, 0.2) !important;
}

.sidebar .text-white-50 {
    color: #6b7280 !important;
}

.sidebar .btn-outline-light {
    --bs-btn-color: #1f2937;
    --bs-btn-border-color: rgba(156, 163, 175, 0.55);
    --bs-btn-hover-bg: rgba(229, 231, 235, 0.62);
    --bs-btn-hover-border-color: rgba(107, 114, 128, 0.65);
    --bs-btn-hover-color: #111827;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stat-card,
.card,
.modal-content {
    position: relative;
    border-radius: var(--lg-radius);
    overflow: hidden;
}

.stat-card:hover,
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--lg-shadow-hover);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.stat-card .card-header,
.card-header {
    background: rgba(255, 255, 255, 0.3) !important;
    border-bottom: 1px solid var(--lg-border-soft) !important;
}

.btn {
    border-radius: 999px;
    transition: all 0.35s ease;
}

.btn-primary {
    --bs-btn-bg: rgba(79, 157, 255, 0.6);
    --bs-btn-border-color: rgba(79, 157, 255, 0.52);
    --bs-btn-hover-bg: rgba(59, 130, 246, 0.7);
    --bs-btn-hover-border-color: rgba(59, 130, 246, 0.64);
    --bs-btn-active-bg: rgba(37, 99, 235, 0.74);
    --bs-btn-active-border-color: rgba(37, 99, 235, 0.68);
    color: #f8fbff !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.22), 0 0 0 0.15rem rgba(79, 157, 255, 0.1);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-warning,
.btn-outline-danger {
    background: rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-width: 1px;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover {
    transform: translateY(-1px);
}

.form-control,
.form-select,
.form-check-input,
textarea.form-control {
    background: rgba(255, 255, 255, 0.34);
    border: 1px solid var(--lg-border-soft);
    border-radius: var(--lg-radius-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--lg-text);
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(79, 157, 255, 0.6);
    box-shadow: var(--lg-focus);
    background: rgba(255, 255, 255, 0.5);
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.table-hover tbody tr {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.38);
    transform: translateY(-1px);
}

.modal-content {
    backdrop-filter: blur(var(--lg-blur-strong));
    -webkit-backdrop-filter: blur(var(--lg-blur-strong));
}

.modal-header,
.modal-footer {
    border-color: rgba(255, 255, 255, 0.24);
}

.alert-app {
    background: rgba(255, 255, 255, 0.4);
}

.badge {
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Liquid badge system: status, prioritas, role */
.badge.bg-secondary {
    background: rgba(148, 163, 184, 0.34) !important;
    color: #334155 !important;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge.bg-info,
.badge.bg-info.text-dark {
    background: rgba(125, 211, 252, 0.32) !important;
    color: #0c4a6e !important;
    border: 1px solid rgba(56, 189, 248, 0.34);
}

.badge.bg-success {
    background: rgba(74, 222, 128, 0.28) !important;
    color: #166534 !important;
    border: 1px solid rgba(74, 222, 128, 0.34);
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
    background: rgba(253, 224, 71, 0.3) !important;
    color: #854d0e !important;
    border: 1px solid rgba(250, 204, 21, 0.34);
}

.badge.bg-danger {
    background: rgba(248, 113, 113, 0.28) !important;
    color: #991b1b !important;
    border: 1px solid rgba(248, 113, 113, 0.36);
}

.badge.bg-light.text-dark,
.badge.bg-light {
    background: rgba(255, 255, 255, 0.38) !important;
    color: #334155 !important;
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.progress {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Progress color sync with liquid badges/status */
.progress-bar.bg-secondary {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.86), rgba(148, 163, 184, 0.62)) !important;
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.88), rgba(125, 211, 252, 0.68)) !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.88), rgba(74, 222, 128, 0.66)) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.9), rgba(253, 224, 71, 0.74)) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), rgba(248, 113, 113, 0.7)) !important;
}

.sidebar-backdrop {
    background: rgba(236, 246, 255, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.content-area > * {
    animation: lg-fade-up 0.45s ease both;
}

@keyframes lg-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        border-radius: 0 24px 24px 0;
    }
    .topbar {
        border-radius: 0 0 18px 18px;
    }
    .stat-card,
    .card,
    .modal-content {
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .content-area > *,
    .stat-card,
    .card,
    .btn,
    .table-hover tbody tr {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Optional dark mode with liquid glass preserved */
@media (prefers-color-scheme: dark) {
    :root {
        --lg-text: #e2e8f0;
        --lg-text-soft: #cbd5e1;
        --lg-muted: #94a3b8;
        --lg-surface: rgba(15, 23, 42, 0.45);
        --lg-surface-strong: rgba(15, 23, 42, 0.58);
        --lg-surface-soft: rgba(30, 41, 59, 0.34);
        --lg-border: rgba(148, 163, 184, 0.28);
        --lg-border-soft: rgba(148, 163, 184, 0.2);
        --lg-shadow: 0 14px 34px rgba(2, 6, 23, 0.5), 0 4px 14px rgba(2, 6, 23, 0.35);
    }

    .app-body {
        background:
            radial-gradient(1200px 700px at -10% -10%, rgba(30, 64, 175, 0.42), transparent 60%),
            radial-gradient(900px 600px at 100% 0%, rgba(14, 116, 144, 0.35), transparent 58%),
            linear-gradient(160deg, #0b1220 0%, #111827 50%, #0b1220 100%);
        color: var(--lg-text-soft);
    }

    .sidebar .nav-link {
        color: #e2e8f0;
    }
    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
        color: #dbeafe;
        background: rgba(59, 130, 246, 0.24);
    }

    .form-control,
    .form-select,
    .form-check-input,
    textarea.form-control {
        color: #e5e7eb;
        background: rgba(15, 23, 42, 0.42);
    }

    .stat-card .card-header,
    .card-header {
        color: #e5e7eb;
    }

    .text-muted {
        color: #94a3b8 !important;
    }

    .role-badge--super_admin {
        background: rgba(59, 130, 246, 0.28);
        color: #dbeafe;
        border-color: rgba(96, 165, 250, 0.36);
    }

    .role-badge--pengawas {
        background: rgba(16, 185, 129, 0.24);
        color: #d1fae5;
        border-color: rgba(52, 211, 153, 0.34);
    }

    .role-badge--karyawan,
    .role-badge--unknown {
        background: rgba(148, 163, 184, 0.22);
        color: #e2e8f0;
        border-color: rgba(148, 163, 184, 0.3);
    }

    .sidebar .role-badge {
        background: rgba(30, 41, 59, 0.55);
        color: #e5e7eb;
        border-color: rgba(148, 163, 184, 0.34);
    }

    .badge.bg-secondary {
        background: rgba(148, 163, 184, 0.24) !important;
        color: #cbd5e1 !important;
        border-color: rgba(148, 163, 184, 0.3);
    }

    .badge.bg-info,
    .badge.bg-info.text-dark {
        background: rgba(56, 189, 248, 0.22) !important;
        color: #bae6fd !important;
        border-color: rgba(56, 189, 248, 0.3);
    }

    .badge.bg-success {
        background: rgba(34, 197, 94, 0.24) !important;
        color: #bbf7d0 !important;
        border-color: rgba(34, 197, 94, 0.28);
    }

    .badge.bg-warning,
    .badge.bg-warning.text-dark {
        background: rgba(234, 179, 8, 0.24) !important;
        color: #fde68a !important;
        border-color: rgba(234, 179, 8, 0.3);
    }

    .badge.bg-danger {
        background: rgba(239, 68, 68, 0.24) !important;
        color: #fecaca !important;
        border-color: rgba(239, 68, 68, 0.3);
    }

    .badge.bg-light,
    .badge.bg-light.text-dark {
        background: rgba(148, 163, 184, 0.2) !important;
        color: #e2e8f0 !important;
        border-color: rgba(148, 163, 184, 0.28);
    }

    .progress {
        background: rgba(30, 41, 59, 0.52);
        border-color: rgba(148, 163, 184, 0.22);
    }

    .progress-bar.bg-secondary {
        background: linear-gradient(90deg, rgba(148, 163, 184, 0.78), rgba(148, 163, 184, 0.52)) !important;
    }

    .progress-bar.bg-info {
        background: linear-gradient(90deg, rgba(14, 165, 233, 0.82), rgba(56, 189, 248, 0.58)) !important;
    }

    .progress-bar.bg-success {
        background: linear-gradient(90deg, rgba(22, 163, 74, 0.84), rgba(74, 222, 128, 0.58)) !important;
    }

    .progress-bar.bg-warning {
        background: linear-gradient(90deg, rgba(217, 119, 6, 0.86), rgba(245, 158, 11, 0.62)) !important;
    }

    .progress-bar.bg-danger {
        background: linear-gradient(90deg, rgba(220, 38, 38, 0.86), rgba(248, 113, 113, 0.6)) !important;
    }
}

/* ============================================
   Final palette alignment: text + buttons
   (kept at bottom to override legacy green rules)
   ============================================ */

body,
.app-body {
    color: #1f2937 !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.fw-semibold,
.card-header,
.modal-title,
.form-label {
    color: #111827 !important;
}

p, li, td, th, span, small, .small {
    color: #1f2937;
}

.text-muted {
    color: #6b7280 !important;
}

.text-primary {
    color: #2563eb !important;
}

a {
    color: #2563eb;
}

a:hover,
a:focus {
    color: #1d4ed8;
}

.btn-primary,
.btn-primary:focus {
    --bs-btn-bg: #3b82f6;
    --bs-btn-border-color: #3b82f6;
    --bs-btn-color: #ffffff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.88), rgba(96, 165, 250, 0.82)) !important;
    border-color: rgba(59, 130, 246, 0.9) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus:active {
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(59, 130, 246, 0.86)) !important;
    border-color: rgba(37, 99, 235, 0.94) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: rgba(59, 130, 246, 0.55);
    color: #2563eb !important;
    border-color: rgba(59, 130, 246, 0.55) !important;
    background: rgba(239, 246, 255, 0.85) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background: rgba(59, 130, 246, 0.14) !important;
    border-color: rgba(37, 99, 235, 0.62) !important;
    color: #1d4ed8 !important;
}

.btn-outline-secondary {
    color: #374151 !important;
    border-color: rgba(156, 163, 175, 0.62) !important;
    background: rgba(249, 250, 251, 0.9) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    color: #111827 !important;
    border-color: rgba(107, 114, 128, 0.68) !important;
    background: rgba(229, 231, 235, 0.9) !important;
}

.btn-outline-warning {
    color: #92400e !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    background: rgba(255, 251, 235, 0.9) !important;
}

.btn-outline-danger {
    color: #b91c1c !important;
    border-color: rgba(239, 68, 68, 0.62) !important;
    background: rgba(254, 242, 242, 0.9) !important;
}

@media (prefers-color-scheme: dark) {
    body,
    .app-body {
        color: #e5e7eb !important;
    }

    h1, h2, h3, h4, h5, h6,
    .h1, .h2, .h3, .h4, .h5, .h6,
    .fw-semibold,
    .card-header,
    .modal-title,
    .form-label {
        color: #f3f4f6 !important;
    }

    .text-muted {
        color: #9ca3af !important;
    }

    .text-primary,
    a {
        color: #93c5fd !important;
    }

    a:hover,
    a:focus {
        color: #bfdbfe !important;
    }

    .btn-primary,
    .btn-primary:focus {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(59, 130, 246, 0.78)) !important;
        border-color: rgba(96, 165, 250, 0.7) !important;
    }

    .btn-outline-primary {
        color: #bfdbfe !important;
        border-color: rgba(147, 197, 253, 0.5) !important;
        background: rgba(30, 41, 59, 0.65) !important;
    }

    .btn-outline-secondary {
        color: #e5e7eb !important;
        border-color: rgba(148, 163, 184, 0.48) !important;
        background: rgba(30, 41, 59, 0.62) !important;
    }
}

/* ============================================
   Final readability + action buttons cleanup
   ============================================ */

/* Keep light palette stable on all devices */
html, body, .app-body, .main-content {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.topbar,
.stat-card,
.card,
.table-responsive,
.modal-content {
    background: rgba(255, 255, 255, 0.84) !important;
}

.card-body,
.table,
.table td,
.table th,
.small,
small,
p,
label,
input,
select,
textarea {
    color: #1f2937 !important;
}

.text-muted {
    color: #6b7280 !important;
}

.table thead th {
    color: #475569 !important;
}

/* Action buttons: Edit / Reset PW / Hapus */
.btn.btn-sm {
    border-radius: 12px !important;
    padding: 0.38rem 0.72rem !important;
    font-weight: 600;
    line-height: 1.2;
}

.btn-sm.btn-outline-secondary {
    background: rgba(239, 246, 255, 0.92) !important;
    border: 1px solid rgba(147, 197, 253, 0.85) !important;
    color: #1d4ed8 !important;
}

.btn-sm.btn-outline-secondary:hover,
.btn-sm.btn-outline-secondary:focus {
    background: rgba(219, 234, 254, 0.95) !important;
    border-color: rgba(96, 165, 250, 0.9) !important;
    color: #1e40af !important;
}

.btn-sm.btn-outline-warning {
    background: rgba(255, 251, 235, 0.96) !important;
    border: 1px solid rgba(252, 211, 77, 0.95) !important;
    color: #92400e !important;
}

.btn-sm.btn-outline-warning:hover,
.btn-sm.btn-outline-warning:focus {
    background: rgba(254, 243, 199, 0.98) !important;
    border-color: rgba(245, 158, 11, 0.92) !important;
    color: #78350f !important;
}

.btn-sm.btn-outline-danger {
    background: rgba(254, 242, 242, 0.96) !important;
    border: 1px solid rgba(248, 113, 113, 0.92) !important;
    color: #b91c1c !important;
}

.btn-sm.btn-outline-danger:hover,
.btn-sm.btn-outline-danger:focus {
    background: rgba(254, 226, 226, 0.98) !important;
    border-color: rgba(239, 68, 68, 0.94) !important;
    color: #991b1b !important;
}

/* Prevent gray overlay on desktop when sidebar-open class remains */
@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    body.sidebar-open .sidebar-backdrop {
        display: none !important;
    }
}

/* Mobile layering: sidebar must stay above header */
@media (max-width: 991.98px) {
    .topbar {
        z-index: 1042 !important;
    }
    .sidebar {
        z-index: 1060 !important;
    }
    .sidebar-backdrop {
        z-index: 1050 !important;
    }
}

/* Icon-only action buttons (detail/edit/reset/hapus) */
a.btn.btn-sm.btn-outline-secondary[href*="task_detail.php"],
button.btn.btn-sm.btn-outline-secondary[data-bs-target^="#edit"],
button.btn.btn-sm.btn-outline-primary[data-bs-target^="#edit"],
button.btn.btn-sm.btn-outline-warning[data-bs-target^="#reset"],
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#del"],
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#delete"] {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    line-height: 1 !important;
    border-radius: 10px !important;
}

a.btn.btn-sm.btn-outline-secondary[href*="task_detail.php"]::before,
button.btn.btn-sm.btn-outline-secondary[data-bs-target^="#edit"]::before,
button.btn.btn-sm.btn-outline-primary[data-bs-target^="#edit"]::before,
button.btn.btn-sm.btn-outline-warning[data-bs-target^="#reset"]::before,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#del"]::before,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#delete"]::before {
    font-family: "bootstrap-icons";
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 400;
}

/* detail */
a.btn.btn-sm.btn-outline-secondary[href*="task_detail.php"]::before {
    content: "\F341";
}

/* edit */
button.btn.btn-sm.btn-outline-secondary[data-bs-target^="#edit"]::before,
button.btn.btn-sm.btn-outline-primary[data-bs-target^="#edit"]::before {
    content: "\F4CA";
}

/* reset password */
button.btn.btn-sm.btn-outline-warning[data-bs-target^="#reset"]::before {
    content: "\F47A";
}

/* delete */
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#del"]::before,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#delete"]::before {
    content: "\F5DE";
}

/* Keep action buttons in one horizontal row */
.table td.text-end {
    white-space: nowrap !important;
}

.table td.text-end .btn {
    display: inline-flex !important;
    vertical-align: middle;
}

.table td.text-end .btn + .btn {
    margin-left: 6px;
}

/* Final text readability (exclude buttons from force-black) */
body,
.app-body,
p,
span,
small,
.small,
label,
th,
td,
li,
input,
select,
textarea {
    color: #111111 !important;
}

.text-muted,
.text-white,
.text-white-50,
.text-secondary,
.text-light {
    color: #111111 !important;
}

/* =====================================================
   Unified button style: pill gradient + white text
   ===================================================== */
.btn,
button.btn {
    border-radius: 999px !important;
    border-width: 1px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.14);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.btn:hover,
button.btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Legend kontras tombol:
   - tombol gelap  : teks putih
   - tombol terang : teks hitam
*/

/* Primary / detail (gelap -> putih) */
.btn-primary,
.btn-outline-primary {
    background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
    border-color: #4f8ff5 !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* Secondary / neutral actions (gelap -> putih) */
.btn-secondary,
.btn-outline-secondary,
.btn-outline-light {
    background: linear-gradient(135deg, #64748b, #94a3b8) !important;
    border-color: #7b8a9f !important;
    color: #ffffff !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active {
    background: linear-gradient(135deg, #475569, #64748b) !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

/* Success (gelap -> putih) */
.btn-success,
.btn-outline-success {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    border-color: #1dbf8a !important;
    color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

/* Warning / reset (terang -> hitam) */
.btn-warning,
.btn-outline-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    border-color: #f2ad1f !important;
    color: #111111 !important;
    text-shadow: none;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    border-color: #f59e0b !important;
    color: #111111 !important;
    text-shadow: none;
}

/* Danger / delete (gelap -> putih) */
.btn-danger,
.btn-outline-danger {
    background: linear-gradient(135deg, #ef4444, #f87171) !important;
    border-color: #f06464 !important;
    color: #ffffff !important;
}

/* Info (terang -> hitam) */
.btn-info,
.btn-outline-info {
    background: linear-gradient(135deg, #67e8f9, #22d3ee) !important;
    border-color: #2dd4ea !important;
    color: #111111 !important;
    text-shadow: none;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
    background: linear-gradient(135deg, #22d3ee, #06b6d4) !important;
    border-color: #06b6d4 !important;
    color: #111111 !important;
    text-shadow: none;
}

/* Light (terang -> hitam) */
.btn-light,
.btn-outline-light {
    background: linear-gradient(135deg, #f9fafb, #e5e7eb) !important;
    border-color: #d1d5db !important;
    color: #111111 !important;
    text-shadow: none;
}

.btn-light:hover,
.btn-light:focus,
.btn-light:active,
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active {
    background: linear-gradient(135deg, #f3f4f6, #d1d5db) !important;
    border-color: #cbd5e1 !important;
    color: #111111 !important;
    text-shadow: none;
}

/* Dark (gelap -> putih) */
.btn-dark,
.btn-outline-dark {
    background: linear-gradient(135deg, #1f2937, #374151) !important;
    border-color: #374151 !important;
    color: #ffffff !important;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active,
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-dark:active {
    background: linear-gradient(135deg, #111827, #1f2937) !important;
    border-color: #1f2937 !important;
    color: #ffffff !important;
}

/* ============================================
   Final: all non-button text must be black
   ============================================ */
body,
.app-body,
.main-content,
h1, h2, h3, h4, h5, h6,
p, span, small, label, li,
th, td,
input, select, textarea, option,
.small, .form-text, .form-label,
.card-title, .card-header, .modal-title,
.text-muted, .text-primary, .text-secondary, .text-info, .text-success, .text-warning, .text-danger, .text-light, .text-dark, .text-white, .text-white-50 {
    color: #111111 !important;
}

a:not(.btn):not([class*="btn-"]) {
    color: #111111 !important;
}

a:not(.btn):not([class*="btn-"]):hover,
a:not(.btn):not([class*="btn-"]):focus {
    color: #111111 !important;
}

/* Header setiap halaman: pastikan kontras jelas */
.topbar h1,
.topbar .h5,
.topbar .fw-semibold,
.topbar .text-muted,
.topbar .small {
    color: #111111 !important;
}

/* Judul pengumuman + isi pengumuman */
.content-area .card .fw-semibold,
.content-area .card .card-header,
.content-area .card article .fw-semibold,
.content-area .card article .small,
.content-area .card article .text-muted {
    color: #111111 !important;
}

/* Badge status seperti contoh WA agar terbaca */
.badge {
    opacity: 1 !important;
}

.badge.bg-light,
.badge.bg-light.text-dark,
.badge.border.bg-light.text-dark {
    background: #e5e7eb !important;
    color: #111111 !important;
    border-color: #9ca3af !important;
    font-weight: 700 !important;
}

/* Status lain juga ditingkatkan kontras teks */
.badge.bg-secondary,
.badge.bg-info,
.badge.bg-info.text-dark,
.badge.bg-success,
.badge.bg-warning,
.badge.bg-warning.text-dark,
.badge.bg-danger {
    color: #111111 !important;
}

/* Contrast hotfix from latest screens */
.content-area h1,
.content-area h2,
.content-area h3,
.content-area h4,
.content-area h5,
.content-area h6,
.content-area .h1,
.content-area .h2,
.content-area .h3,
.content-area .h4,
.content-area .h5,
.content-area .h6,
.content-area .card-header,
.content-area .table td a:not(.btn),
.content-area .table th,
.content-area .table td {
    color: #111111 !important;
}

.alert,
.alert-success,
.alert-danger,
.alert .small,
.alert .text-muted,
.alert .btn-close {
    color: #111111 !important;
    opacity: 1 !important;
}

.alert-success {
    background: rgba(220, 252, 231, 0.96) !important;
    border: 1px solid rgba(134, 239, 172, 0.92) !important;
}

/* Status filter buttons on riwayat: custom colors */
.history-filter-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.history-filter-group .btn {
    min-width: 92px;
    justify-content: center;
    padding-inline: 1rem !important;
}

a.btn.btn-outline-primary[href*="f=all"] {
    background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

a.btn.btn-outline-primary[href*="f=aktif"] {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    border-color: #f59e0b !important;
    color: #111111 !important;
    text-shadow: none !important;
}

a.btn.btn-outline-primary[href*="f=selesai"] {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

/* Badges must be solid (non-transparent) */
.badge.bg-primary {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

.badge.bg-secondary {
    background-color: #94a3b8 !important;
    color: #111111 !important;
    border-color: #94a3b8 !important;
}

.badge.bg-info,
.badge.bg-info.text-dark {
    background-color: #22d3ee !important;
    color: #111111 !important;
    border-color: #22d3ee !important;
}

.badge.bg-success {
    background-color: #22c55e !important;
    color: #111111 !important;
    border-color: #22c55e !important;
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
    background-color: #fbbf24 !important;
    color: #111111 !important;
    border-color: #fbbf24 !important;
}

.badge.bg-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}

.badge.bg-light,
.badge.bg-light.text-dark,
.badge.border.bg-light.text-dark {
    background-color: #e5e7eb !important;
    color: #111111 !important;
    border-color: #9ca3af !important;
}

/* Final: textbox/input white background */
.form-control,
.form-select,
textarea.form-control,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="url"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #111111 !important;
    border-color: #d1d5db !important;
    border-radius: 5px !important;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #111111 !important;
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
    border-radius: 5px !important;
}

/* =====================================================
   Final solid badge palette (requested)
   Prioritas, Status, Role, Notifikasi
   ===================================================== */

/* Prioritas:
   Rendah (abu), Sedang (kuning), Tinggi (merah) */
.badge.bg-secondary {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #111111 !important;
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
    background-color: #fbbf24 !important;
    border-color: #fbbf24 !important;
    color: #111111 !important;
}

.badge.bg-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Status:
   Belum mulai (abu), Sedang dikerjakan (biru), Revisi (orange), Selesai (hijau) */
.badge.bg-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

.badge.badge-status-revisi {
    background-color: #f97316 !important;
    border: 1px solid #f97316 !important;
    color: #111111 !important;
}

.badge.bg-success {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

/* User/Role:
   Super Admin (emas shiny), Pengawas (ungu), Karyawan (teal) */
.role-badge--super_admin {
    background: linear-gradient(135deg, #facc15, #fde047) !important;
    color: #111111 !important;
    border: 1px solid #eab308 !important;
}

.role-badge--pengawas {
    background: #7c3aed !important;
    color: #ffffff !important;
    border: 1px solid #7c3aed !important;
}

.role-badge--karyawan {
    background: #0d9488 !important;
    color: #ffffff !important;
    border: 1px solid #0d9488 !important;
}

.role-badge--unknown {
    background: #6b7280 !important;
    color: #ffffff !important;
    border: 1px solid #6b7280 !important;
}

/* Notifikasi:
   WA (hijau WA), Email (merah tua) */
.badge.notify-badge {
    font-weight: 700 !important;
}

.badge.notify-badge--wa {
    background-color: #25d366 !important;
    border: 1px solid #25d366 !important;
    color: #111111 !important;
}

.badge.notify-badge--email {
    background-color: #7f1d1d !important;
    border: 1px solid #7f1d1d !important;
    color: #ffffff !important;
}

/* Badge sizing/alignment consistency */
.badge,
.role-badge,
.badge.notify-badge {
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    padding: 3px 8px !important;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    vertical-align: middle;
}

/* Make role badge width more stable in tables */
.role-badge {
    min-width: 76px;
}

/* Smooth modern scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e5e7eb;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border: 2px solid #e5e7eb;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b, #475569);
}

/* Mobile: thinner scrollbar */
@media (max-width: 768px) {
    * {
        scrollbar-width: thin;
    }

    *::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    *::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    *::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #94a3b8, #64748b);
        border: 1px solid #f1f5f9;
    }
}

/* Dashboard stat icons: solid background (no transparency) */
.icon-wrap.bg-primary.bg-opacity-10 {
    background-color: #bfdbfe !important;
}

.icon-wrap.bg-info.bg-opacity-10 {
    background-color: #a5f3fc !important;
}

.icon-wrap.bg-success.bg-opacity-10 {
    background-color: #86efac !important;
}

.icon-wrap.bg-danger.bg-opacity-10 {
    background-color: #fecaca !important;
}

/* Logo clarity fix */
.sidebar::after {
    z-index: 0;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-brand-logo,
.login-brand-logo {
    background: #ffffff;
    border: 1px solid rgba(209, 213, 219, 0.92);
    border-radius: 10px;
    padding: 2px;
    filter: contrast(1.1) saturate(1.08) brightness(1.02);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.sidebar-user-photo {
    object-fit: cover;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

.sidebar-user-photo-fallback {
    width: 34px;
    height: 34px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.95rem;
}

/* ============================================
   Badge shape + shiny finish
   ============================================ */
.badge,
.role-badge {
    border-radius: 5px !important;
    position: relative;
    overflow: hidden;
}

.badge::after,
.role-badge::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 45%;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.02));
}

/* Extra shiny emphasis for user/role badges */
.role-badge {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);
}

/* Reduce shadows: topbar + cards */
.topbar,
.topbar-app {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12) !important;
}

.stat-card,
.card {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
}

.stat-card:hover,
.card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14) !important;
    transform: translateY(-2px);
}

/* Pinned/Penting badge -> solid red */
.badge.badge-penting {
    background: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em;
}

/* ============================================
   Action icon buttons: solid colors
   detail / edit / reset / hapus
   ============================================ */
a.btn.btn-sm.btn-outline-secondary[href*="task_detail.php"] {
    background: #2563eb !important;
    border: 1px solid #2563eb !important;
    color: #ffffff !important;
}

button.btn.btn-sm.btn-outline-secondary[data-bs-target^="#edit"],
button.btn.btn-sm.btn-outline-primary[data-bs-target^="#edit"] {
    background: #2563eb !important;
    border: 1px solid #2563eb !important;
    color: #ffffff !important;
}

button.btn.btn-sm.btn-outline-warning[data-bs-target^="#reset"] {
    background: #f59e0b !important;
    border: 1px solid #f59e0b !important;
    color: #111111 !important;
}

button.btn.btn-sm.btn-outline-danger[data-bs-target^="#del"],
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#delete"] {
    background: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    color: #ffffff !important;
}

a.btn.btn-sm.btn-outline-secondary[href*="task_detail.php"]:hover,
button.btn.btn-sm.btn-outline-secondary[data-bs-target^="#edit"]:hover,
button.btn.btn-sm.btn-outline-primary[data-bs-target^="#edit"]:hover,
button.btn.btn-sm.btn-outline-warning[data-bs-target^="#reset"]:hover,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#del"]:hover,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#delete"]:hover {
    filter: brightness(0.95);
}

/* Final tweak: badge text white */
.badge,
.role-badge,
.badge.notify-badge,
.badge.notify-badge--wa,
.badge.notify-badge--email {
    color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

/* Contrast fix: Super Admin badge on gold background */
.role-badge--super_admin {
    color: #111111 !important;
    text-shadow: none !important;
}

/* ============================================
   Login page polish (isolated styling)
   ============================================ */
.login-page {
    background: radial-gradient(1100px 520px at 50% -10%, #dff5ff 0%, #eefbff 45%, #f5fdff 100%) !important;
}

.login-shell {
    max-width: 460px;
}

.login-title {
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.login-subtitle {
    font-size: 1.03rem;
}

.login-card {
    border-radius: 20px !important;
    border: 1px solid #dbe7f4 !important;
    background: #ffffff !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18) !important;
}

.login-card .card-body {
    padding: 1.65rem 1.55rem !important;
}

.login-page .form-label {
    font-size: 1.02rem;
    margin-bottom: 0.45rem;
}

.login-page .form-control.form-control-lg {
    min-height: 47px;
    border-radius: 10px !important;
    border: 1px solid #cfdcec !important;
}

.login-page .btn.btn-primary.btn-lg.w-100 {
    min-height: 50px;
    font-size: 1.05rem;
    border-radius: 999px !important;
}

.login-note {
    color: #475569 !important;
}

@media (max-width: 576px) {
    .login-shell {
        max-width: 100%;
    }
    .login-card {
        border-radius: 16px !important;
    }
    .login-card .card-body {
        padding: 1.25rem 1.1rem !important;
    }
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Keep icon-only actions centered and inherit text contrast */
a.btn.btn-sm.btn-outline-secondary[href*="task_detail.php"]::before,
button.btn.btn-sm.btn-outline-secondary[data-bs-target^="#edit"]::before,
button.btn.btn-sm.btn-outline-primary[data-bs-target^="#edit"]::before,
button.btn.btn-sm.btn-outline-warning[data-bs-target^="#reset"]::before,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#del"]::before,
button.btn.btn-sm.btn-outline-danger[data-bs-target^="#delete"]::before {
    color: currentColor !important;
}

/* ===== Sidebar final overrides (sticky + tidy buttons) ===== */
.sidebar {
    /* Desktop: fixed sidebar, never scrolls away */
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    transform: none !important;
}

/* Ensure menu scrolls and footer stays bottom */
.sidebar-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-bottom: 0.75rem;
}
.sidebar-footer {
    flex-shrink: 0 !important;
}

/* Give content room for fixed sidebar (desktop) */
@media (min-width: 992px) {
    .main-content {
        margin-left: var(--sidebar-width) !important;
    }
}

.sidebar .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem !important;
    padding: 0.75rem 0.9rem !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Hard-stop any accidental right-side decorations */
.sidebar .nav-link::before,
.sidebar .nav-link::after {
    content: none !important;
}

.sidebar-footer .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    min-height: 34px !important;
    border-radius: 14px !important;
    width: 100% !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.9rem !important;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        height: 100dvh !important;
        max-height: 100dvh !important;
        transform: translateX(-100%) !important;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }
}
