/* ==========================================
   1. DESIGN TOKENS (Kreasi Karisma-Inspired Clean Editorial SaaS)
   ========================================== */
:root,
[data-theme="light"] {
    /* Core Tokens */
    --kti-bg: #F6F8FB;
    --kti-surface: #FFFFFF;
    --kti-surface-muted: #F1F5F9;
    --kti-border: #E2E8F0;
    --kti-text: #0F172A;
    --kti-text-muted: #475569;
    --kti-primary: #0369A1;
    --kti-primary-dark: #0C4A6E;
    --kti-accent: #0284C7;
    --kti-accent-soft: #E0F2FE;
    --kti-topbar-glass: rgba(255, 255, 255, 0.88);
    --kti-shadow-elevated: 0 10px 26px -8px rgba(15, 23, 42, 0.12);
    --kti-shadow-hover: 0 12px 24px -10px rgba(3, 105, 161, 0.18);
    --kti-radius-sm: 8px;
    --kti-radius-md: 14px;
    --kti-radius-lg: 18px;

    /* Aliases for Existing Modules */
    --bg-body: var(--kti-bg);
    --bg-sidebar: var(--kti-surface);
    --bg-light: var(--kti-surface-muted);
    --text-primary: var(--kti-text);
    --text-primary-dark: var(--kti-text);
    --text-muted: var(--kti-text-muted);
    --color-primary: var(--kti-accent);
    --color-secondary: var(--kti-text-muted);
    --border-color: var(--kti-border);
    --border-soft: var(--kti-border);
    --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);

    /* Semantic Status Tones */
    --color-blue: #E0F2FE;
    --color-blue-text: #0369A1;
    --color-green: #DCFCE7;
    --color-green-text: #15803D;
    --color-yellow: #FEF3C7;
    --color-yellow-text: #92400E;
    --color-red: #FEE2E2;
    --color-red-text: #B91C1C;
    --color-purple: #F3E8FF;
    --color-purple-text: #6B21A8;
    --color-orange: #FFEDD5;
    --color-orange-text: #C2410C;

    --soft-blue: #E0F2FE;
    --soft-blue-card: linear-gradient(135deg, #67aefa56 0%, #f4fcff 100%);
    --soft-blue-btn: #eef3f9;
    --soft-blue-hover: #BAE6FD;
    --soft-green: #DCFCE7;
    --soft-red: #FEE2E2;
    --soft-yellow: #FEF3C7;
    --text-blue: #0369A1;
    --text-green: #15803D;
    --text-red: #B91C1C;
    --text-yellow: #92400E;
    --text-muted-soft: #475569;
}

[data-theme="dark"] {
    --kti-bg: #0B1120;
    --kti-surface: #111827;
    --kti-surface-muted: #1E293B;
    --kti-border: #334155;
    --kti-text: #F1F5F9;
    --kti-text-muted: #94A3B8;
    --kti-primary: #38BDF8;
    --kti-primary-dark: #0284C7;
    --kti-accent: #38BDF8;
    --kti-accent-soft: #0C2D48;
    --kti-topbar-glass: rgba(17, 24, 39, 0.86);
    --kti-shadow-elevated: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
    --kti-shadow-hover: 0 14px 28px -10px rgba(56, 189, 248, 0.22);

    --bg-body: var(--kti-bg);
    --bg-sidebar: var(--kti-surface);
    --bg-light: var(--kti-surface-muted);
    --text-primary: var(--kti-text);
    --text-primary-dark: var(--kti-text);
    --text-muted: var(--kti-text-muted);
    --color-primary: var(--kti-accent);
    --color-secondary: var(--kti-text-muted);
    --border-color: var(--kti-border);
    --border-soft: var(--kti-border);

    --soft-blue: #0C2D48;
    --soft-blue-hover: #133E63;
    --soft-green: #064E3B;
    --soft-red: #450A0A;
    --soft-yellow: #451A03;
    --text-blue: #7DD3FC;
    --text-green: #A7F3D0;
    --text-red: #FCA5A5;
    --text-yellow: #FDE68A;
    --color-blue: #0C2D48;
    --color-blue-text: #7DD3FC;
    --color-green: #064E3B;
    --color-green-text: #A7F3D0;
    --color-yellow: #451A03;
    --color-yellow-text: #FDE68A;
    --color-red: #450A0A;
    --color-red-text: #FCA5A5;
}

html, body {
    background-color: var(--kti-bg);
    color: var(--kti-text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.55;
    overflow-x: clip;
    max-width: 100%;
    transition: background-color 0.18s ease, color 0.18s ease;
}

/* Base Interaction & Keyboard Accessibility Affordances (R-32, R-39) */
a[href],
button,
summary,
select,
label[for],
input[type="checkbox"],
input[type="radio"],
[role="button"] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.disabled {
    cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--kti-accent);
    outline-offset: 2px;
}

.kti-num {
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   2. LAYOUT STRUCTURE (Sidebar, Header, Content)
   ========================================== */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100dvh;
}

#sidebar {
    width: 260px;
    background: var(--kti-surface);
    border-right: 1px solid var(--kti-border);
    z-index: 1045;
    transition: transform 0.25s ease, width 0.25s ease, background-color 0.18s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    overflow-y: auto;
}

.sidebar-logo-mini {
    display: none;
}

@media (min-width: 992px) {
    html.sidebar-minimized #sidebar {
        width: 76px;
        overflow-x: hidden;
    }

    html.sidebar-minimized #content {
        margin-left: 76px;
        width: calc(100% - 76px);
    }

    html.sidebar-minimized #sidebar .sidebar-header {
        padding: 14px 8px;
    }

    html.sidebar-minimized #sidebar .sidebar-logo-full {
        display: none !important;
    }

    html.sidebar-minimized #sidebar .sidebar-logo-mini {
        display: inline-block !important;
    }

    html.sidebar-minimized #sidebar ul li a {
        justify-content: center !important;
        padding: 14px 0 !important;
        position: relative;
    }

    html.sidebar-minimized #sidebar ul li a:hover,
    html.sidebar-minimized #sidebar ul li.active > a {
        padding-left: 0 !important;
    }

    html.sidebar-minimized #sidebar ul li a i {
        font-size: 1.2rem;
        margin: 0;
    }

    html.sidebar-minimized #sidebar .sidebar-link-text,
    html.sidebar-minimized #sidebar .sidebar-hide-on-mini {
        display: none !important;
    }

    html.sidebar-minimized #sidebar #sidebar-approval-badge {
        position: absolute;
        top: 6px;
        right: 10px;
        font-size: 0.6rem;
        padding: 0.2em 0.42em;
    }
}

#sidebar .sidebar-header {
    padding: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-blue-text);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

#sidebar .sidebar-header a {
    display: inline-block;
}

#sidebar .sidebar-header img {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

#sidebar .sidebar-header a:hover img {
    transform: scale(1.04);
}

#sidebar ul.components {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

#sidebar ul li a {
    padding: 0.65rem 0.9rem;
    min-height: 44px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--kti-radius-sm);
    color: var(--kti-text-muted);
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#sidebar ul li a:hover {
    background-color: var(--kti-surface-muted);
    color: var(--kti-text);
    transform: translateX(2px);
}

#sidebar ul li.active > a {
    background-color: var(--kti-accent-soft);
    color: var(--kti-primary);
    box-shadow: inset 3px 0 0 var(--kti-accent);
}

#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 260px;
    width: calc(100% - 260px);
    min-width: 0;
    transition: margin-left 0.25s ease, width 0.25s ease;
}

/* Single Frosted Glass Topbar (R-10 dose cap: 1 element only) */
.main-header {
    min-height: 64px;
    background-color: var(--kti-topbar-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--kti-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1035;
    transition: z-index 0.1s ease, background-color 0.18s ease;
}

.kti-page-title {
    font-size: clamp(1.02rem, 1.4vw, 1.25rem);
    font-weight: 700;
    color: var(--kti-text);
    margin: 0;
    letter-spacing: -0.015em;
}

.kti-icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--kti-radius-sm);
    background-color: var(--kti-surface-muted);
    color: var(--kti-text);
    border: 1px solid var(--kti-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.kti-icon-btn:hover {
    border-color: var(--kti-primary);
    color: var(--kti-primary);
    background-color: var(--kti-accent-soft);
    transform: translateY(-1px);
}

.kti-icon-btn:active {
    transform: scale(0.96);
}

.kti-main {
    padding: 1.5rem;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.main-header:has(.dropdown-menu.show),
.main-header.header-dropdown-open {
    z-index: 1150 !important;
}

.main-header .dropdown {
    position: relative;
    z-index: 1040;
}

.kti-footer,
.main-footer {
    background: var(--kti-surface);
    border-top: 1px solid var(--kti-border);
    padding: 0.9rem 1.5rem;
    font-size: 0.82rem;
    color: var(--kti-text-muted);
}

/* Mobile Bottom Navigation */
.kti-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--kti-surface);
    border-top: 1px solid var(--kti-border);
    display: flex;
    gap: 4px;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    z-index: 1030;
}

.kti-bottom-item {
    flex: 1 1 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--kti-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--kti-radius-sm);
    transition: background-color 0.16s ease, color 0.16s ease;
}

.kti-bottom-item i {
    font-size: 1.15rem;
}

.kti-bottom-item.active {
    color: var(--kti-primary);
    background-color: var(--kti-accent-soft);
}

/* ==========================================
   3. COMPONENTS & BADGES
   ========================================== */
.card-custom {
    background: var(--kti-surface);
    border-radius: var(--kti-radius-md);
    border: 1px solid var(--kti-border);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: var(--card-shadow);
}

.card-custom:hover {
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow: var(--kti-shadow-hover);
}

.badge-soft-blue {
    background-color: var(--soft-blue) !important;
    color: var(--text-blue) !important;
    border: 1px solid rgba(2, 132, 199, 0.2);
    font-weight: 600;
}

.badge-soft-green {
    background-color: var(--soft-green) !important;
    color: var(--text-green) !important;
    border: 1px solid rgba(22, 163, 74, 0.2);
    font-weight: 600;
}

.badge-soft-red {
    background-color: var(--soft-red) !important;
    color: var(--text-red) !important;
    border: 1px solid rgba(220, 38, 38, 0.2);
    font-weight: 600;
}

.badge-soft-yellow {
    background-color: var(--soft-yellow) !important;
    color: var(--text-yellow) !important;
    border: 1px solid rgba(217, 119, 6, 0.2);
    font-weight: 600;
}

/* ==========================================
   4. HORIZONTAL CHECKPOINT TIMELINE (OVERHAUL)
   ========================================== */

/* 1. PEMBUNGKUS SCROLL */
.checkpoint-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 0 2px; 
    scroll-behavior: smooth; 
    -webkit-overflow-scrolling: touch;
}

/* 2. CONTAINER FLEX (Garis & Node) */
.checkpoint-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px; /* Jarak minimal antar node jika data ada sangat banyak */
    position: relative;
    
    /* KUNCI: Memaksa container selebar layar jika data sedikit, tapi bebas memanjang jika data banyak */
    min-width: 100%; 
    width: max-content; 
    
    padding: 105px 8px; /* Ruang vertikal ekstra agar nama checkpoint panjang yang bertumpuk tidak terpotong */
    min-height: 315px;
}

/* 3. GARIS UTAMA */
.checkpoint-line-main {
    position: absolute;
    top: 50%;
    /* 60px diambil dari setengah lebar node (120px) agar garis membentang lebih lebar hingga ke pinggir */
    left: 60px; 
    right: 60px; 
    height: 8px;
    background: linear-gradient(90deg, #fde047 0%, #f97316 20%, #ef4444 40%, #ec4899 60%, #a855f7 80%, #0284c7 100%);
    border-radius: 6px;
    z-index: 4;
    transform: translateY(-50%);
}

/* 4. NODE CHECKPOINT */
.checkpoint-node {
    position: relative;
    z-index: 2;
    width: 120px; /* Ukuran lebih ramping agar garis lebih lebar */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* --- Node Genap (Atas Garis) --- */
.checkpoint-node:nth-child(odd) { transform: translateY(-50%); }
.checkpoint-node:nth-child(odd) .node-content   { order: 1; } 
.checkpoint-node:nth-child(odd) .node-circle    { order: 2; } 
.checkpoint-node:nth-child(odd) .node-connector { order: 3; } 

/* --- Node Ganjil (Bawah Garis) --- */
.checkpoint-node:nth-child(even) { transform: translateY(50%); }
.checkpoint-node:nth-child(even) .node-connector { order: 1; } 
.checkpoint-node:nth-child(even) .node-circle    { order: 2; } 
.checkpoint-node:nth-child(even) .node-content   { order: 3; } 

/* --- Komponen Dalam Node --- */
.node-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--color-blue-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    z-index: 3;
}

.checkpoint-node:hover .node-circle {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.checkpoint-node.active-node .node-circle {
    transform: scale(1.18);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.4), 0 8px 20px rgba(0, 0, 0, 0.18);
    border-color: #0284c7 !important;
}

.card-checkpoint-focus {
    animation: cpCardFocusGlow 1.2s ease-out;
}

@keyframes cpCardFocusGlow {
    0% {
        box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.45);
        border-color: #0ea5e9;
    }
    100% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        border-color: var(--border-color);
    }
}

.node-connector {
    width: 2px;
    height: 22px;   
    background-color: var(--border-color);
    border-radius: 2px;
}

.node-content {
    position: static;
    width: 120px;
    text-align: center;
    font-size: 0.78rem;
    padding: 2px 0;
}

.checkpoint-title-wrap {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.25;
}


/* ==========================================
   5. FLUID ANIMATIONS & EXTRA TRANSITIONS
   ========================================== */
.btn, a, .list-group-item {
    transition: all 0.25s ease-in-out;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    transform: scale(0.95);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    z-index: 1075 !important;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Elevasi Dropdown Menu dan Action Dropdown Tabel di atas baris tabel (Kompatibel penuh Firefox, Chrome, Safari) */
.action-dropdown,
.table .dropdown {
    position: relative;
    z-index: 55;
}

/* Pastikan tombol aksi dan dropdown toggle tidak terpengaruh oleh transform translateY hover */
.action-dropdown .btn,
.table .dropdown-toggle,
.table .status-badge-btn,
.btn.dropdown-toggle-no-caret {
    transform: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.action-dropdown .btn:hover,
.table .dropdown-toggle:hover,
.table .status-badge-btn:hover,
.btn.dropdown-toggle-no-caret:hover {
    transform: none !important;
}

/* Dropdown Menu Statis di dalam Tabel: Terkunci tepat di bawah tombol aksi, tidak akan melompat */
.table .dropdown-menu,
.action-dropdown .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 4px !important;
    z-index: 120 !important;
}

/* Dropup Menu di dalam Tabel: Terkunci tepat di atas tombol aksi jika dekat batas bawah layar */
.table .dropup .dropdown-menu,
.action-dropdown.dropup .dropdown-menu {
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

/* Baseline stacking context baris tabel */
.table tbody tr {
    position: relative;
    z-index: 1;
}

/* Ketika dropdown di tabel sedang terbuka, angkat cell dan baris di atas baris tabel lainnya */
.table td.dropdown-open-cell,
.table td:has(.dropdown-menu.show),
.table td:has([aria-expanded="true"]) {
    position: relative !important;
    z-index: 100 !important;
}

tr.dropdown-open-tr,
tr:has(.dropdown-menu.show),
tr:has([aria-expanded="true"]) {
    position: relative !important;
    z-index: 100 !important;
    transform: none !important;
}

tr.dropdown-open-tr td,
tr:has(.dropdown-menu.show) td,
td:has(.dropdown-menu.show) {
    position: relative !important;
    z-index: 100 !important;
}

.table .dropdown.show,
.table .dropdown:has(.dropdown-menu.show),
.table .dropdown-open-parent {
    position: relative !important;
    z-index: 110 !important;
}

/* Cegah clipping pada table-responsive saat dropdown tabel terbuka */
@media (min-width: 992px) {
    .table-responsive:not(.dashboard-table-scroll) {
        overflow: visible !important;
    }
}

.table-responsive:has(.dropdown-menu.show),
.table-responsive.has-open-dropdown {
    overflow: visible !important;
}

/* Matikan transform tabel dan tab-content card agar tidak membuat rogue stacking context */
.table tbody tr,
.table-fluid tbody tr,
#table-global-timeline tbody tr,
.tab-content.card-custom,
.tab-content.card-custom:hover {
    transform: none !important;
}

/* Notification Bell Dropdown Desktop & Mobile: Prioritas tertinggi di atas semua header tabel */
.notif-dropdown-menu {
    width: 340px;
    z-index: 1200 !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22) !important;
}

/* CSS Tambahan agar baris terlihat dapat diklik */
#table-global-timeline tbody tr {
    cursor: pointer;
}
#table-global-timeline tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
}

/* Metric Strip (Kreasi Karisma Pattern) */
.kti-metric-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.kti-metric-cell {
    background-color: var(--kti-surface);
    border: 1px solid var(--kti-border);
    border-radius: var(--kti-radius-md);
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.kti-metric-cell:hover {
    transform: translateY(-2px);
    border-color: var(--kti-accent);
    box-shadow: var(--kti-shadow-hover);
}

.kti-metric-cell.is-active {
    border-color: var(--kti-accent);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.kti-metric-cell-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--kti-text-muted);
    margin-bottom: 0.25rem;
}

.kti-metric-cell-value {
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--kti-text);
}

.kti-metric-cell.kti-metric-progress { border-left: 3px solid var(--text-blue); }
.kti-metric-cell.kti-metric-pending  { border-left: 3px solid var(--text-yellow); }
.kti-metric-cell.kti-metric-overdue  { border-left: 3px solid var(--text-red); }
.kti-metric-cell.kti-metric-finished { border-left: 3px solid var(--text-green); }

@media (max-width: 1024px) {
    .kti-metric-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 639.98px) {
    .kti-metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================
   LEGACY STAT CARDS (Toned Down, No Generic Glow/Orbs)
   ========================================== */
.card-stat {
    border-radius: var(--kti-radius-md);
    border: 1px solid var(--kti-border);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    overflow: hidden;
    position: relative;
    box-shadow: var(--card-shadow);
}

.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--kti-shadow-hover);
}

.card-stat-total {
    background: var(--kti-surface);
    border: 1px solid var(--kti-border);
}

.card-stat-progress { background: var(--soft-blue); }
.card-stat-progress h6, .card-stat-progress h2 { color: var(--text-blue) !important; }

.card-stat-pending { background: var(--soft-yellow); }
.card-stat-pending h6, .card-stat-pending h2 { color: var(--text-yellow) !important; }

.card-stat-overdue { background: var(--soft-red); }
.card-stat-overdue h6, .card-stat-overdue h2 { color: var(--text-red) !important; }

.card-stat-finished { background: var(--soft-green); }
.card-stat-finished h6, .card-stat-finished h2 { color: var(--text-green) !important; }

/* Fluid Effects & Soft UI Adjustments Khusus Halaman Timeline */
.filter-dropdown-btn {
    background-color: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Sudut lebih membulat */
    transition: all 0.3s ease;
}
.filter-dropdown-btn:hover {
    background-color: var(--soft-blue);
    color: var(--text-blue);
    border-color: rgba(2, 132, 199, 0.3);
}
.filter-input-group {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.filter-input-group:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--soft-blue);
}

/* Tabel Fluid Hover Effect */
.table-fluid {
    border-collapse: separate;
    border-spacing: 0 6px; /* Memberi jarak antar baris lebih ramping */
    margin-top: -6px;
    font-size: 0.8rem;
}
.table-fluid thead th {
    border: none;
    background: transparent;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    padding-top: 8px;
}
.table-fluid tbody tr {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}
.table-fluid tbody tr td {
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    vertical-align: middle;
    padding: 8px 10px !important; /* Padding lebih ramping untuk kerapatan kolom */
}
.table-fluid tbody tr td:first-child {
    border-left: 1px solid transparent;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.table-fluid tbody tr td:last-child {
    border-right: 1px solid transparent;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
.table-fluid tbody tr:hover {
    transform: none !important;
    background-color: var(--bg-light);
}

/* Hilangkan panah caret default untuk tombol aksi titik tiga */
.dropdown-toggle-no-caret::after {
    display: none !important;
}

/* Kustomisasi Search DataTables agar lebih membaur */
.dataTables_filter input {
    border-radius: 20px !important;
    padding: 5px 15px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}
.dataTables_filter input:focus {
    border-color: var(--color-primary) !important;
}

/* --- Filter Card Soft UI --- */
.card-filter-soft {
    background: var(--soft-blue-card);
    border: 1px solid #ffffff; /* Efek glass/bevel tipis */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.03) !important;
}

.filter-icon-wrapper {
    background-color: #dbeafe; /* Soft blue terang untuk icon */
    color: #2563eb;
    border-radius: 10px;
    padding: 8px 10px;
}

/* --- Dropdown & Input Filter Fluid --- */
.filter-dropdown-btn {
    background-color: #ffffff;
    color: var(--text-primary-dark);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.filter-dropdown-btn:hover, .filter-dropdown-btn[aria-expanded="true"] {
    background-color: var(--soft-blue-hover);
    color: #0d6efd;
    border-color: #b6cdec;
    transform: translateY(-1px);
}

.filter-input-group {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.filter-input-group:focus-within {
    border-color: #8bb4e5;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* --- Tombol Reset Soft Red --- */
.btn-soft-reset {
    background-color: #fdf2f2;
    color: #dc3545;
    border: 1px solid #f8d7da;
    transition: all 0.3s ease;
}
.btn-soft-reset:hover {
    background-color: #f8d7da;
    transform: translateY(-1px);
}

/* --- Tabel Fluid & Soft Header --- */
.table-fluid {
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}
.table-fluid thead th {
    border: none;
    background-color: #f1f5f9; /* Background soft pastel gray-blue untuk header */
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 12px 15px;
}
.table-fluid thead th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table-fluid thead th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.table-fluid tbody tr {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}
.table-fluid tbody tr td {
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    vertical-align: middle;
}
.table-fluid tbody tr td:first-child { border-left: 1px solid transparent; border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table-fluid tbody tr td:last-child { border-right: 1px solid transparent; border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.table-fluid tbody tr:hover {
    transform: none !important;
    background-color: #fafcff; /* Highlight soft blue saat hover */
}

.dataTables_filter input {
    border-radius: 20px !important;
    padding: 6px 16px !important;
    border: 1px solid var(--border-soft) !important;
    background-color: #ffffff;
}

/* ==========================================
   TOMBOL SOFT UI (DETAIL CHECKPOINT)
   ========================================== */
.btn-soft-primary {
    background-color: var(--soft-blue);
    color: var(--text-blue);
    border: 1px solid rgba(2, 132, 199, 0.2);
    transition: all 0.3s ease;
}
.btn-soft-primary:hover { 
    background-color: #bae6fd;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10); 
}
.btn-soft-primary:hover::after {
    transform: scale(2);
}

.btn-soft-warning {
    background-color: var(--soft-yellow);
    color: var(--text-yellow);
    border: 1px solid rgba(217, 119, 6, 0.2);
    transition: all 0.3s ease;
}
.btn-soft-warning:hover { 
    background-color: #fde68a; 
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10); 
}
.btn-soft-warning:hover::after {
    transform: scale(2);
}

.btn-soft-info {
    background-color: #e0e7ff; /* Soft indigo */
    color: #4338ca;
    border: 1px solid rgba(67, 56, 202, 0.2);
    transition: all 0.3s ease;
}
.btn-soft-info:hover { 
    background-color: #c7d2fe; 
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10); 
}
.btn-soft-info:hover::after {
    transform: scale(2);
}

/* ==========================================
   GLOBAL SOFT UI OVERRIDES
   ========================================== */
.form-control {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}
.form-select {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 10px 38px 10px 16px !important;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}
.form-control-sm {
    padding: 6px 12px !important;
}
.form-select-sm {
    padding: 6px 32px 6px 12px !important;
}
.dataTables_length select {
    min-width: 70px;
    padding-right: 32px !important;
    padding-left: 8px !important;
}
.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn-primary {
    background-color: #0ea5e9;
    border: none;
}
.btn-primary:hover {
    background-color: #0284c7;
}

.table {
    border-collapse: separate;
    border-spacing: 0 4px;
}
.table thead th {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}
.table thead th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table thead th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.table tbody tr {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}
.table tbody tr:hover {
    transform: none !important;
    background-color: #fafcff;
}
.table tbody tr td {
    border: none;
    padding: 14px 16px;
    vertical-align: middle;
}
.table tbody tr td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table tbody tr td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.table-flat-header {
    border-spacing: 0 !important;
}

.dashboard-table-scroll {
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.dashboard-table-scroll thead.sticky-top,
.dashboard-table-scroll thead.sticky-top th {
    position: sticky;
    top: 0;
    z-index: 10 !important;
}

.table-flat-header thead th:first-child,
.table-flat-header thead th:last-child {
    border-radius: 0 !important;
}

/* ==========================================
   NAV TABS (PERSISTENT OUTLINE & FULL WIDTH)
   ========================================== */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    gap: 0px;
    width: 100%;
}
.nav-tabs.nav-justified .nav-item,
.nav-tabs .nav-item.flex-fill {
    flex: 1 1 0;
    min-width: 0;
}
.nav-tabs.nav-justified .nav-link,
.nav-tabs .nav-item.flex-fill .nav-link {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-tabs .nav-item {
    margin-bottom: -2px;
}
.nav-tabs .nav-link {
    border: 1px solid #e2e8f0 !important;
    border-bottom: none !important;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    color: #64748b;
    background-color: #f8fafc;
    padding: 10px 14px;
    transition: all 0.2s ease-in-out;
}
.nav-tabs .nav-link:hover {
    color: #0ea5e9;
    background-color: #f1f5f9;
    border-color: #cbd5e1 !important;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: #0ea5e9 !important;
    background-color: #ffffff !important;
    border-color: #cbd5e1 #cbd5e1 #ffffff !important;
    border-top: 2px solid #0ea5e9 !important;
    font-weight: 700 !important;
}

/* Compact Action Buttons for Tables (e.g., Approval) */
.btn-action-compact {
    font-size: 0.75rem !important;
    padding: 0.22rem 0.5rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.25 !important;
}
.btn-action-compact i {
    font-size: 0.8rem;
}
.btn-action-compact.btn-icon-only {
    padding: 0.22rem 0.45rem !important;
}

/* ==========================================================================
   RESPONSIVE ARCHITECTURE & MEDIA QUERIES (SOP BLUEPRINT REFACTORING)
   ========================================================================== */

/* --------------------------------------------------------------------------
   LANGKAH 4: FILTER RESPONSIVE TOOLBAR (BASE & DESKTOP STYLES)
   -------------------------------------------------------------------------- */
.filter-responsive-item {
    min-width: 180px;
}
.filter-responsive-item .filter-dropdown-btn {
    width: 200px;
}
.filter-responsive-item.filter-input-group {
    width: 240px;
}

/* --------------------------------------------------------------------------
   TABLE RESPONSIVE TOUCH SCROLL ENHANCEMENT
   -------------------------------------------------------------------------- */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Default Desktop Backdrop */
.sidebar-backdrop {
    display: none;
}

/* --------------------------------------------------------------------------
   BREAKPOINT: HANDHELD & TABLET (< 992px)
   LANGKAH 1: OFFCANVAS DRAWER SIDEBAR & BACKDROP
   LANGKAH 2: HORIZONTAL SWIPEABLE NAV-TABS
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* 1. Sidebar Offcanvas Drawer */
    #sidebar {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 280px !important;
        max-width: 85vw !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1050 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
        background: var(--bg-sidebar) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .kti-sidebar-mobile-footer {
        margin-top: auto;
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--kti-border);
        background: var(--bg-sidebar);
        flex-shrink: 0;
    }
    .kti-sidebar-mobile-footer[hidden] {
        display: none !important;
    }
    #sidebar.show {
        transform: translateX(0) !important;
    }
    #content {
        margin-left: 0 !important; /* Hilangkan offset */
        width: 100% !important;
        min-width: 0 !important;
    }
    .main-header {
        padding: 0.5rem 0.9rem;
    }
    .kti-main {
        padding: 1rem;
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }
    .kti-footer {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    /* Backdrop Overlay dengan Blur Lembut */
    .sidebar-backdrop {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(15, 23, 42, 0.5) !important;
        backdrop-filter: blur(3px) !important;
        -webkit-backdrop-filter: blur(3px) !important;
        z-index: 1049 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease, visibility 0.3s ease !important;
    }
    .sidebar-backdrop.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    body.sidebar-open {
        overflow: hidden !important; /* Mencegah background ikut scroll */
    }

    /* 2. Horizontal Swipeable Nav-Tabs */
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        padding-bottom: 4px;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none; /* Chrome / Safari */
    }
    .nav-tabs .nav-item {
        flex: 0 0 auto !important; /* Cegah tab mengecil/menyusut */
        white-space: nowrap;
    }
}

/* --------------------------------------------------------------------------
   BREAKPOINT: TABLET KECIL & PHONES (< 768px)
   LANGKAH 5: OPTIMALISASI DATATABLES
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .dataTables_wrapper .row {
        flex-direction: column;
        gap: 0.5rem;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        justify-content: center !important;
        display: flex;
        width: 100%;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }
    .dataTables_wrapper .dataTables_paginate .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Default Desktop Notification Bell Dropdown */
.notif-dropdown-menu {
    width: 330px;
}

/* --------------------------------------------------------------------------
   BREAKPOINT: MOBILE / SMARTPHONE (< 576px)
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    /* Reset zoom font pada mobile agar tidak overflow */
    html {
        font-size: 100% !important;
    }

    /* 3. Card Stat Typography */
    .card-stat h2 { 
        font-size: 1.8rem !important; 
    }
    .card-stat h6 { 
        font-size: 0.7rem !important; 
    }
    .card-stat .card-body { 
        padding: 1rem !important; 
    }

    /* 4. Filter Toolbar Full-Width */
    .filter-responsive-item {
        width: 100% !important;
        min-width: 100% !important;
    }
    .filter-responsive-item .filter-dropdown-btn {
        width: 100% !important;
    }
    .filter-responsive-item.filter-input-group {
        width: 100% !important;
    }

    /* 6. Roadmap & Milestone Scaling (Padding Ramping, Garis Lebih Lebar) */
    .checkpoint-container { 
        min-height: 285px !important; 
        padding: 90px 4px !important; 
    }
    .checkpoint-node { 
        width: 112px !important; 
    }
    .checkpoint-line-main {
        left: 52px !important;
        right: 52px !important;
    }
    .node-circle { 
        width: 38px !important; 
        height: 38px !important; 
        font-size: 0.75rem !important; 
    }
    .node-connector {
        height: 16px !important;
    }
    .node-content { 
        width: 112px !important; 
        font-size: 0.72rem !important; 
    }

    /* 7. Dropdown Right-Aligned */
    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
        max-width: calc(100vw - 20px) !important;
    }

    /* Notification Bell Dropdown Mobile: Tepat di Tengah Layar (Tidak Terpotong di Kiri) */
    .dropdown-menu.notif-dropdown-menu {
        position: fixed !important;
        top: 65px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        width: min(340px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 80vh !important;
        margin: 0 !important;
        border-radius: 16px !important;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25) !important;
        z-index: 1200 !important;
    }

    /* Optimasi Kerapatan Font dan Padding Tabel di Mobile */
    .table-fluid {
        font-size: 0.74rem !important;
        border-spacing: 0 4px !important;
    }
    .table-fluid thead th {
        font-size: 0.68rem !important;
        padding: 6px 4px !important;
    }
    .table-fluid tbody tr td {
        padding: 6px 4px !important;
    }

    /* Touch Target Min Size */
    .btn, .form-control, .form-select {
        min-height: 38px;
    }
    .btn.btn-sm, .btn-group-sm > .btn {
        min-height: unset !important;
    }
}

/* Status Badge Button: Normal on Desktop (PC), Compact on Handheld / Mobile */
.status-badge-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
}
@media (max-width: 767.98px) {
    .status-badge-btn {
        padding: 0.2rem 0.45rem !important;
        font-size: 0.68rem !important;
        font-weight: 500 !important;
    }
}

/* Approval Tab Mobile Dropdown Styling */
.approval-tab-item {
    color: var(--text-primary-dark, #334155);
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 6px;
}
.approval-tab-item.active {
    background-color: var(--soft-blue, #e0f2fe) !important;
    color: var(--text-blue, #0369a1) !important;
    font-weight: 600;
}
.approval-tab-item:hover {
    background-color: #f1f5f9;
}

/* ==========================================
   MODUL KALENDER KEGIATAN
   ========================================== */
.cal-stat-pill {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background: var(--kti-surface);
    color: var(--kti-text);
    user-select: none;
}
.cal-stat-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}
.cal-stat-pill.active {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
    border-color: var(--color-primary) !important;
}

.cal-grid-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cal-board {
    min-width: 960px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.cal-weekday-cell {
    padding: 12px 10px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    border-right: 1px solid var(--border-color);
}
.cal-weekday-cell:last-child {
    border-right: none;
}
.cal-weekday-cell.is-weekend {
    color: #dc2626;
    background: #fef2f2;
}

.cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-day-cell {
    min-height: 150px;
    padding: 8px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    transition: background-color 0.15s ease;
    cursor: pointer;
    position: relative;
}
.cal-day-cell:nth-child(7n) {
    border-right: none;
}
.cal-day-cell:hover {
    background-color: #f8fafc;
}
.cal-day-cell.cal-cell-weekend {
    background-color: #fcfcfd;
}
.cal-day-cell.cal-cell-weekend:hover {
    background-color: #f8fafc;
}
.cal-day-cell.cal-cell-outside {
    background-color: #f8fafc;
    opacity: 0.58;
}
.cal-day-cell.cal-cell-today {
    background-color: #f0f9ff;
    box-shadow: inset 0 0 0 2px #0ea5e9;
}

.cal-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cal-day-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
}
.cal-cell-weekend .cal-day-number {
    color: #dc2626;
}
.cal-cell-today .cal-day-number {
    background-color: #0ea5e9;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.35);
}

.cal-day-count {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}
.cal-cell-today .cal-day-count {
    background: #bae6fd;
    color: #0369a1;
}

.cal-events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.cal-event-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 0.74rem;
    line-height: 1.25;
    border-left: 3px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
    overflow: hidden;
}
.cal-event-item:hover {
    transform: translateX(1px);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}

/* Status Colors */
.cal-ev-progress {
    background-color: #e0f2fe;
    color: #0369a1;
    border-left-color: #0284c7;
}
.cal-ev-pending {
    background-color: #fef3c7;
    color: #b45309;
    border-left-color: #d97706;
}
.cal-ev-late {
    background-color: #fee2e2;
    color: #b91c1c;
    border-left-color: #dc2626;
}
.cal-ev-finished {
    background-color: #dcfce7;
    color: #15803d;
    border-left-color: #16a34a;
}

.cal-ev-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
.cal-ev-badge-cp {
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
}
.cal-ev-badge-tl {
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
}
.cal-ev-badge-kb {
    background: #6366f1;
    color: #ffffff;
}
.cal-ev-badge-maint {
    background: #0d9488;
    color: #ffffff;
}

/* Gantt Spanning Ribbons (Mode Pita Harian) */
.cal-weeks-container {
    display: flex;
    flex-direction: column;
}
.cal-week-row {
    position: relative;
    min-height: 132px;
    border-bottom: 1px solid var(--border-color);
}
.cal-week-row:last-child {
    border-bottom: none;
}
.cal-week-bg-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    z-index: 1;
}
.cal-week-bg-cell {
    border-right: 1px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.cal-week-bg-cell:last-child {
    border-right: none;
}
.cal-week-bg-cell:hover {
    background-color: #f8fafc;
}
.cal-week-bg-cell.cal-cell-weekend {
    background-color: #fcfcfd;
}
.cal-week-bg-cell.cal-cell-weekend:hover {
    background-color: #fef2f2;
}
.cal-week-bg-cell.cal-cell-outside {
    background-color: #f8fafc;
    opacity: 0.62;
}
.cal-week-bg-cell.cal-cell-today {
    background-color: #f0f9ff;
    box-shadow: inset 0 0 0 2px #0ea5e9;
}
.cal-week-fg-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: max-content;
    row-gap: 4px;
    padding-bottom: 8px;
    pointer-events: none;
}
.cal-week-day-hdr {
    pointer-events: auto;
    cursor: pointer;
    padding: 7px 8px 3px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cal-week-day-hdr.cal-cell-outside {
    opacity: 0.58;
}
.cal-week-day-hdr.cal-cell-weekend .cal-day-number {
    color: #dc2626;
}
.cal-week-day-hdr.cal-cell-today .cal-day-number {
    background-color: #0ea5e9;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.35);
}
.cal-week-day-hdr.cal-cell-today .cal-day-count {
    background: #bae6fd;
    color: #0369a1;
}
.cal-span-bar {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 7px;
    margin: 0 5px;
    border-radius: 6px;
    border-left: 3px solid transparent;
    font-size: 0.73rem;
    line-height: 1.25;
    overflow: hidden;
    white-space: nowrap;
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.cal-span-bar:hover {
    filter: brightness(0.97);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.cal-span-bar.is-cont-left {
    margin-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left-width: 0;
    padding-left: 6px;
}
.cal-span-bar.is-cont-right {
    margin-right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding-right: 6px;
}
.cal-ev-pic-tag {
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.78;
    flex-shrink: 0;
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-week-more {
    pointer-events: auto;
    cursor: pointer;
    margin: 1px 5px 0 5px;
}

.cal-ev-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    flex: 1;
}

.cal-ev-marker {
    font-size: 0.68rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.cal-more-btn {
    margin-top: 2px;
    padding: 3px 6px;
    font-size: 0.71rem;
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px dashed #7dd3fc;
    border-radius: 6px;
    text-align: center;
    transition: background-color 0.15s ease;
}
.cal-more-btn:hover {
    background: #e0f2fe;
    color: #0369a1;
}

/* Week View Specific */
.cal-week-grid .cal-day-cell {
    min-height: 440px;
}
.cal-week-card {
    padding: 7px 8px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cal-week-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

/* ==========================================
   GLOBAL CONTROL & DARK THEME CONSISTENCY
   ========================================== */
.btn {
    border-radius: var(--kti-radius-sm);
    font-weight: 600;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn-primary {
    background-color: var(--kti-primary);
    border-color: var(--kti-primary);
}
.btn-primary:hover {
    background-color: var(--kti-primary-dark);
    border-color: var(--kti-primary-dark);
}
.form-control,
.form-select {
    background-color: var(--kti-surface);
    color: var(--kti-text);
    border-color: var(--kti-border);
    border-radius: var(--kti-radius-sm);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--kti-surface);
    color: var(--kti-text);
    border-color: var(--kti-accent);
    box-shadow: 0 0 0 0.2rem rgba(2, 132, 199, 0.2);
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item {
    background-color: var(--kti-surface) !important;
    color: var(--kti-text) !important;
    border-color: var(--kti-border) !important;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .card-header,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white {
    background-color: var(--kti-surface-muted) !important;
    color: var(--kti-text) !important;
    border-color: var(--kti-border) !important;
}
[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-secondary {
    color: var(--kti-text) !important;
}
[data-theme="dark"] .text-muted {
    color: var(--kti-text-muted) !important;
}
[data-theme="dark"] .dropdown-item {
    color: var(--kti-text);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--kti-surface-muted);
    color: var(--kti-primary);
}
[data-theme="dark"] .table,
[data-theme="dark"] .table-fluid tbody tr {
    color: var(--kti-text);
    background-color: var(--kti-surface);
}
[data-theme="dark"] .table thead th,
[data-theme="dark"] .table-fluid thead th {
    background-color: var(--kti-surface-muted);
    color: var(--kti-text-muted);
    border-color: var(--kti-border);
}
[data-theme="dark"] .table tbody td {
    background-color: var(--kti-surface);
    color: var(--kti-text);
    border-color: var(--kti-border);
}
[data-theme="dark"] .cal-board,
[data-theme="dark"] .cal-day-cell,
[data-theme="dark"] .cal-week-bg-cell {
    background-color: var(--kti-surface);
    border-color: var(--kti-border);
}
[data-theme="dark"] .cal-weekdays,
[data-theme="dark"] .cal-day-cell.cal-cell-outside,
[data-theme="dark"] .cal-week-bg-cell.cal-cell-outside {
    background-color: var(--kti-surface-muted);
    border-color: var(--kti-border);
}
[data-theme="dark"] .cal-weekday-cell,
[data-theme="dark"] .cal-day-number {
    color: var(--kti-text);
    border-color: var(--kti-border);
}
[data-theme="dark"] .cal-day-count {
    background-color: var(--kti-surface-muted);
    color: var(--kti-text);
}
[data-theme="dark"] .cal-day-cell.cal-cell-today,
[data-theme="dark"] .cal-week-bg-cell.cal-cell-today {
    background-color: #0C2D48;
}
[data-theme="dark"] .cal-stat-pill {
    background-color: var(--kti-surface);
    color: var(--kti-text);
    border-color: var(--kti-border);
}
[data-theme="dark"] .cal-more-btn {
    background-color: var(--kti-surface-muted);
    color: var(--kti-primary);
    border-color: var(--kti-accent);
}
[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-close {
    background-color: var(--kti-surface-muted);
    color: var(--kti-text);
    border-color: var(--kti-border);
}
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.mgr-cal-loading-overlay {
    background: rgba(255, 255, 255, 0.75);
}
[data-theme="dark"] .mgr-cal-loading-overlay {
    background: rgba(15, 23, 42, 0.72);
}
[data-theme="dark"] .cal-weekday-cell.is-weekend {
    background-color: #291820;
    color: #FCA5A5;
}
[data-theme="dark"] .cal-day-cell.cal-cell-weekend,
[data-theme="dark"] .cal-week-bg-cell.cal-cell-weekend {
    background-color: #161B2B;
}
[data-theme="dark"] .cal-day-cell:hover,
[data-theme="dark"] .cal-day-cell.cal-cell-weekend:hover,
[data-theme="dark"] .cal-week-bg-cell:hover,
[data-theme="dark"] .cal-week-bg-cell.cal-cell-weekend:hover {
    background-color: #1E293B;
}
[data-theme="dark"] .cal-ev-progress {
    background-color: #0C2D48;
    color: #BAE6FD;
    border-left-color: #38BDF8;
}
[data-theme="dark"] .cal-ev-pending {
    background-color: #3B270C;
    color: #FDE68A;
    border-left-color: #F59E0B;
}
[data-theme="dark"] .cal-ev-late {
    background-color: #3D1418;
    color: #FECACA;
    border-left-color: #F87171;
}
[data-theme="dark"] .cal-ev-finished {
    background-color: #0F2E1E;
    color: #BBF7D0;
    border-left-color: #4ADE80;
}
[data-theme="dark"] .cal-ev-progress .text-dark,
[data-theme="dark"] .cal-ev-pending .text-dark,
[data-theme="dark"] .cal-ev-late .text-dark,
[data-theme="dark"] .cal-ev-finished .text-dark {
    color: inherit !important;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--kti-surface) !important;
    color: var(--kti-primary) !important;
    border-color: var(--kti-border) var(--kti-border) transparent !important;
}
[data-theme="dark"] .card-filter-soft {
    background: var(--kti-surface);
    border-color: var(--kti-border);
}

/* Mobile WebView Shortcut Ribbon Notification */
.kti-pwa-ribbon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--kti-accent-soft);
    border-bottom: 1px solid var(--kti-border);
    color: var(--kti-text);
}
.kti-pwa-ribbon[hidden] {
    display: none !important;
}
.kti-pwa-ribbon-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.kti-pwa-ribbon-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
    background: var(--kti-surface);
    border: 1px solid var(--kti-border);
    flex-shrink: 0;
}
.kti-pwa-ribbon-title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--kti-text);
}
.kti-pwa-ribbon-sub {
    font-size: 0.72rem;
    color: var(--kti-text-muted);
    line-height: 1.25;
}
.kti-pwa-ribbon-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
#ktiPwaInstallBtn {
    font-size: 0.75rem;
    padding: 0.32rem 0.75rem !important;
    white-space: nowrap;
}
.kti-pwa-ribbon-close {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--kti-text-muted);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.kti-pwa-ribbon-close:hover,
.kti-pwa-ribbon-close:focus-visible {
    background: rgba(15, 23, 42, 0.08);
    color: var(--kti-text);
}
[data-theme="dark"] .kti-pwa-ribbon-close:hover,
[data-theme="dark"] .kti-pwa-ribbon-close:focus-visible {
    background: rgba(241, 245, 249, 0.12);
}

/* ==========================================
   MOBILE UI POLISH, KANBAN & MINI-CALENDAR
   ========================================== */
.min-w-0 {
    min-width: 0 !important;
}
.kb-card-header-tags {
    min-width: 0 !important;
    flex: 1 1 0%;
    overflow: hidden;
}
.kb-card-header-tags .badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.kb-chip-scroll,
.cal-chip-scroll {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.kb-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}
.kb-stat-cell {
    background: var(--kti-surface-muted);
    border: 1px solid var(--kti-border);
    border-radius: 10px;
    padding: 6px 8px;
    text-align: center;
    min-width: 0;
}
.kb-stat-cell-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--kti-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kb-stat-cell-val {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--kti-text);
}
.kb-stat-cell.is-prog {
    background: var(--soft-blue);
    border-color: rgba(2, 132, 199, 0.25);
}
.kb-stat-cell.is-prog .kb-stat-cell-val { color: var(--text-blue); }
.kb-stat-cell.is-done {
    background: var(--soft-green);
    border-color: rgba(22, 163, 74, 0.25);
}
.kb-stat-cell.is-done .kb-stat-cell-val { color: var(--text-green); }
.kb-stat-cell.is-issue {
    background: var(--soft-red);
    border-color: rgba(220, 38, 38, 0.25);
}
.kb-stat-cell.is-issue .kb-stat-cell-val { color: var(--text-red); }

@media (min-width: 768px) {
    .kb-stat-strip {
        width: auto;
        display: inline-grid;
    }
    .kb-stat-cell {
        min-width: 76px;
        padding: 5px 10px;
    }
}

@media (max-width: 991.98px) {
    .kb-col-box {
        min-height: auto !important;
        padding: 12px !important;
    }
    .kb-sortable-list {
        min-height: 60px !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    .kb-quick-add-btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .kb-chip-scroll,
    .cal-chip-scroll {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        max-width: 100%;
    }
    .kb-chip-scroll::-webkit-scrollbar,
    .cal-chip-scroll::-webkit-scrollbar {
        display: none;
    }
    .kb-chip-scroll > *,
    .cal-chip-scroll > * {
        flex: 0 0 auto !important;
        white-space: nowrap;
    }

    .kb-header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    .kb-header-actions > .btn,
    .kb-header-actions > a.btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    .kb-header-actions .kb-btn-primary-full {
        grid-column: 1 / -1;
        min-height: 44px;
    }
    .kb-issue-header {
        padding: 12px 14px !important;
    }
}

@media (max-width: 575.98px) {
    .kti-main {
        padding: 0.75rem !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }
    .main-header h1,
    .main-header .h5,
    .main-header .page-title-text {
        font-size: 0.95rem !important;
    }
    .kb-issue-add-btn {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }
    .tl-header-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
        width: 100% !important;
    }
    .tl-header-actions > .btn,
    .tl-header-actions > a.btn {
        min-height: 40px;
        width: 100%;
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        font-size: 0.82rem;
    }
    .tl-header-actions .tl-btn-primary-full {
        grid-column: 1 / -1;
        min-height: 44px;
    }
}

/* Mobile Mini-Calendar & Selected Day Panel */
.cal-m-board {
    width: 100%;
    min-width: 0;
    background: var(--kti-surface);
    border: 1px solid var(--kti-border);
    border-radius: 14px;
    overflow: hidden;
}
.cal-m-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--kti-surface-muted);
    border-bottom: 1px solid var(--kti-border);
}
.cal-m-weekday {
    padding: 8px 2px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--kti-text-muted);
    text-transform: uppercase;
}
.cal-m-weekday.is-weekend {
    color: #dc2626;
}
.cal-m-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-m-cell {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-right: 1px solid var(--kti-border);
    border-bottom: 1px solid var(--kti-border);
    background: var(--kti-surface);
    color: var(--kti-text);
    min-height: 50px;
    padding: 5px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    cursor: pointer;
    transition: background-color 0.14s ease, box-shadow 0.14s ease;
    position: relative;
}
.cal-m-cell:nth-child(7n) {
    border-right: none;
}
.cal-m-cell.is-outside {
    opacity: 0.42;
}
.cal-m-cell.is-weekend .cal-m-num {
    color: #dc2626;
}
.cal-m-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}
.cal-m-cell.is-today .cal-m-num {
    background: var(--kti-primary);
    color: #ffffff !important;
}
.cal-m-cell.is-selected {
    background: var(--kti-accent-soft);
    box-shadow: inset 0 0 0 2px var(--kti-primary);
}
.cal-m-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 7px;
}
.cal-m-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.cal-m-dot-progress { background-color: #0284c7; }
.cal-m-dot-pending  { background-color: #d97706; }
.cal-m-dot-late     { background-color: #dc2626; }
.cal-m-dot-finished { background-color: #16a34a; }

.cal-m-selected-panel {
    margin-top: 12px;
    border: 1px solid var(--kti-border);
    border-radius: 14px;
    background: var(--kti-surface);
    overflow: hidden;
}
.cal-m-selected-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: var(--kti-surface-muted);
    border-bottom: 1px solid var(--kti-border);
}
.cal-m-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
}
.cal-m-event-card {
    width: 100%;
    text-align: left;
    border: 1px solid var(--kti-border);
    border-left-width: 4px;
    border-radius: 10px;
    background: var(--kti-surface);
    color: var(--kti-text);
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease;
}
.cal-m-event-card:active {
    transform: scale(0.99);
}
.cal-m-event-card.cal-ev-progress { border-left-color: #0284c7; background: var(--kti-surface); }
.cal-m-event-card.cal-ev-pending  { border-left-color: #d97706; background: var(--kti-surface); }
.cal-m-event-card.cal-ev-late     { border-left-color: #dc2626; background: var(--kti-surface); }
.cal-m-event-card.cal-ev-finished { border-left-color: #16a34a; background: var(--kti-surface); }

.cal-m-week-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cal-m-week-card {
    border: 1px solid var(--kti-border);
    border-radius: 12px;
    background: var(--kti-surface);
    overflow: hidden;
}
.cal-m-week-card.is-today {
    border-color: var(--kti-primary);
}
.cal-m-week-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--kti-surface-muted);
    border-bottom: 1px solid var(--kti-border);
    font-size: 0.82rem;
    font-weight: 700;
}
.cal-m-week-card.is-today .cal-m-week-hdr {
    background: var(--kti-accent-soft);
    color: var(--kti-primary);
}

[data-theme="dark"] .cal-m-cell.is-weekend .cal-m-num,
[data-theme="dark"] .cal-m-weekday.is-weekend {
    color: #f87171;
}
[data-theme="dark"] .cal-m-cell.is-selected {
    background: rgba(56, 189, 248, 0.14);
}
[data-theme="dark"] .cal-m-event-card .text-dark {
    color: var(--kti-text) !important;
}

/* Rekap Module: Equal-width Month Button Grid */
.rekap-month-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
@media (min-width: 576px) {
    .rekap-month-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (min-width: 768px) {
    .rekap-month-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (min-width: 1200px) {
    .rekap-month-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}
.rekap-month-btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--kti-border);
    background: var(--kti-surface);
    color: var(--kti-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rekap-month-btn:hover:not(.is-active),
.rekap-month-btn:focus-visible:not(.is-active) {
    border-color: var(--kti-accent);
    background: var(--kti-accent-soft);
    color: var(--kti-primary);
}
.rekap-month-btn.is-active {
    background: var(--kti-primary);
    border-color: var(--kti-primary);
    color: #ffffff;
}
[data-theme="dark"] .rekap-month-btn.is-active {
    color: #0B1120;
}

/* Rekap Module: Status Summary Cards & Sortable Table Headers */
.rekap-status-card {
    width: 100%;
    text-align: left;
    border: 1px solid var(--kti-border);
    border-radius: 14px;
    background: var(--kti-surface);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.rekap-status-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--kti-shadow-hover);
}
.rekap-status-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--kti-text-muted);
    margin-bottom: 2px;
}
.rekap-status-card-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--kti-text);
}
.rekap-status-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.rekap-status-card.is-finished .rekap-status-card-icon { background: var(--soft-green); color: var(--text-green); }
.rekap-status-card.is-progress .rekap-status-card-icon { background: var(--soft-blue); color: var(--text-blue); }
.rekap-status-card.is-pending  .rekap-status-card-icon { background: var(--soft-yellow); color: var(--text-yellow); }
.rekap-status-card.is-overdue  .rekap-status-card-icon { background: var(--soft-red); color: var(--text-red); }
.rekap-status-card.is-finished.is-active { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25); }
.rekap-status-card.is-progress.is-active { border-color: #0284c7; box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25); }
.rekap-status-card.is-pending.is-active  { border-color: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25); }
.rekap-status-card.is-overdue.is-active  { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25); }

.rekap-sort-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    padding: 4px 0;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.rekap-sort-btn:hover,
.rekap-sort-btn.is-sorted {
    color: var(--kti-primary);
}
.rekap-sort-icon {
    font-size: 0.78rem;
    opacity: 0.55;
    flex-shrink: 0;
}
.rekap-sort-btn.is-sorted .rekap-sort-icon {
    opacity: 1;
}

/* Reduced Motion Support (R-39) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}



