/* assets/css/style.css */
/* Sistem MUK Digital LSP - Modern & Sleek Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    --primary: #4338ca;
    --primary-hover: #3730a3;
    --primary-light: #e0e7ff;
    --secondary: #0ea5e9;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --dark: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --border-color: #e2e8f0;
    --sidebar-width: 235px;
    --topbar-height: 56px;
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --hover-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f4f6fb;
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Layout */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

#sidebar .sidebar-brand {
    min-height: var(--topbar-height);
    height: auto;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

#sidebar .sidebar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    margin-right: 0.65rem;
}

#sidebar .sidebar-menu {
    padding: 0.5rem 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-header {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.4rem 0.6rem 0.15rem;
    margin-top: 0.3rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.15rem;
    font-weight: 500;
    font-size: 0.84rem;
    transition: var(--transition);
}

.nav-link-custom i {
    font-size: 1.05rem;
    margin-right: 0.6rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: var(--transition);
}

.nav-link-custom:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(3px);
}

.nav-link-custom:hover i {
    color: #818cf8;
}

.nav-link-custom.active {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    font-weight: 600;
}

.nav-link-custom.active i {
    color: #fff;
}

/* User Card in Sidebar */
.sidebar-user-card {
    padding: 1rem;
    margin: 1rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
}

.sidebar-user-card .avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 0.75rem;
}

/* Sidebar Collapsed Mode (Desktop / Laptop) */
@media (min-width: 992px) {
    #sidebar.collapsed,
    #wrapper.sidebar-collapsed #sidebar,
    html.sidebar-is-collapsed #sidebar {
        width: 76px !important;
        min-width: 76px !important;
        max-width: 76px !important;
        overflow-x: hidden !important;
    }

    #sidebar.collapsed .sidebar-brand,
    #wrapper.sidebar-collapsed #sidebar .sidebar-brand,
    html.sidebar-is-collapsed #sidebar .sidebar-brand {
        padding: 0.85rem 0.5rem !important;
        justify-content: center !important;
    }

    #sidebar.collapsed .sidebar-brand-text,
    #wrapper.sidebar-collapsed #sidebar .sidebar-brand-text,
    html.sidebar-is-collapsed #sidebar .sidebar-brand-text,
    #sidebar.collapsed .sidebar-brand > div:not(:first-child),
    #wrapper.sidebar-collapsed #sidebar .sidebar-brand > div:not(:first-child),
    html.sidebar-is-collapsed #sidebar .sidebar-brand > div:not(:first-child) {
        display: none !important;
    }

    #sidebar.collapsed .sidebar-filter-box,
    #wrapper.sidebar-collapsed #sidebar .sidebar-filter-box,
    html.sidebar-is-collapsed #sidebar .sidebar-filter-box {
        display: none !important;
    }

    #sidebar.collapsed .menu-header,
    #wrapper.sidebar-collapsed #sidebar .menu-header,
    html.sidebar-is-collapsed #sidebar .menu-header {
        height: 1px;
        margin: 0.75rem 0.5rem;
        padding: 0;
        background: rgba(255, 255, 255, 0.08);
        overflow: hidden;
        font-size: 0;
        color: transparent;
    }

    #sidebar.collapsed .nav-link-custom,
    #wrapper.sidebar-collapsed #sidebar .nav-link-custom,
    html.sidebar-is-collapsed #sidebar .nav-link-custom {
        justify-content: center !important;
        padding: 0.75rem 0 !important;
        margin-left: 0.4rem;
        margin-right: 0.4rem;
        text-align: center;
    }

    #sidebar.collapsed .nav-link-custom i,
    #wrapper.sidebar-collapsed #sidebar .nav-link-custom i,
    html.sidebar-is-collapsed #sidebar .nav-link-custom i {
        margin-right: 0 !important;
        font-size: 1.35rem;
    }

    #sidebar.collapsed .nav-link-custom span,
    #wrapper.sidebar-collapsed #sidebar .nav-link-custom span,
    html.sidebar-is-collapsed #sidebar .nav-link-custom span {
        display: none !important;
    }

    #sidebar.collapsed .sidebar-user-card,
    #wrapper.sidebar-collapsed #sidebar .sidebar-user-card,
    html.sidebar-is-collapsed #sidebar .sidebar-user-card {
        padding: 0.6rem 0.4rem !important;
        justify-content: center !important;
        margin: 0.75rem 0.4rem !important;
    }

    #sidebar.collapsed .sidebar-user-card .avatar,
    #wrapper.sidebar-collapsed #sidebar .sidebar-user-card .avatar,
    html.sidebar-is-collapsed #sidebar .sidebar-user-card .avatar {
        margin-right: 0 !important;
    }

    #sidebar.collapsed .sidebar-user-card > div:not(.avatar),
    #wrapper.sidebar-collapsed #sidebar .sidebar-user-card > div:not(.avatar),
    html.sidebar-is-collapsed #sidebar .sidebar-user-card > div:not(.avatar) {
        display: none !important;
    }
}

#sidebar-toggle * {
    pointer-events: none;
}

/* Main Content Area */
#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 990;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.page-wrapper {
    padding: 1.25rem;
    flex-grow: 1;
}

/* Cards & Glassmorphism */
.card-custom {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.card-custom:hover {
    box-shadow: var(--hover-shadow);
}

.card-header-custom {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body-custom {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-right: 1.25rem;
    flex-shrink: 0;
}

/* Color Accents */
.stat-primary .stat-icon { background: #e0e7ff; color: #4338ca; }
.stat-success .stat-icon { background: #d1fae5; color: #059669; }
.stat-warning .stat-icon { background: #fef3c7; color: #d97706; }
.stat-info .stat-icon    { background: #e0f2fe; color: #0284c7; }
.stat-purple .stat-icon  { background: #f3e8ff; color: #7e22ce; }

/* Compact Stat Card */
.stat-card-sm {
    padding: 0.85rem 1rem;
    border-radius: 12px;
}
.stat-card-sm .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
    border-radius: 10px;
    margin-right: 0.85rem;
}

/* Buttons */
.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    border: none;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    text-decoration: none;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-success-custom {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    text-decoration: none;
}

.btn-success-custom:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    transform: translateY(-2px);
}

.btn-primary-custom.btn-sm, .btn-success-custom.btn-sm {
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    gap: 0.35rem;
}

.btn-primary-custom.btn-xs, .btn-success-custom.btn-xs {
    padding: 0.25rem 0.65rem;
    font-size: 0.76rem;
    gap: 0.25rem;
}

/* Signature Pad Canvas */
.signature-box {
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.signature-box.active {
    border-color: #4f46e5;
    background: #faf5ff;
}

.signature-canvas {
    width: 100%;
    height: 180px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #2563eb !important; /* Garis tepi biru */
    touch-action: none;
    cursor: crosshair;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.signature-preview-img {
    max-height: 120px;
    max-width: 100%;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* Checklist Component Styling */
.checklist-group {
    display: flex;
    gap: 0.5rem;
}

.btn-check-k, .btn-check-bk, .btn-check-ya, .btn-check-tidak {
    display: none;
}

.check-pill {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    background: #fff;
    color: #64748b;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    user-select: none;
}

.btn-check-k:checked + .check-pill {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-check-bk:checked + .check-pill {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-check-ya:checked + .check-pill {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.btn-check-tidak:checked + .check-pill {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.9rem 1.1rem;
    border-bottom: 2px solid var(--border-color);
}

.table-custom td {
    padding: 1rem 1.1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Progress Tracker Step */
.step-tracker {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 2rem;
}

.step-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 0.5rem;
    color: #64748b;
    transition: var(--transition);
}

.step-item.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.step-item.active .step-circle {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.2);
}

.step-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}

.step-item.active .step-title {
    color: #4f46e5;
    font-weight: 700;
}

/* ==========================================================================
   SIDEBAR BACKDROP OVERLAY & RESPONSIVE MOBILE STYLES
   ========================================================================== */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

#sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    #sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
        z-index: 1050 !important;
        box-shadow: 6px 0 25px rgba(0, 0, 0, 0.35) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    #sidebar.show {
        left: 0 !important;
    }

    #main-content {
        width: 100% !important;
        min-width: 0 !important;
    }

    .topbar {
        padding: 0 0.85rem !important;
        height: 52px !important;
    }

    .page-wrapper {
        padding: 0.85rem !important;
    }

    /* Optimasi Table Mobile agar tidak overflow layar */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    /* Modal dialog responsif pada layar sempit */
    .modal-dialog {
        margin: 0.75rem auto;
    }
}

/* ==========================================================================
   FORM CONTROLS & LABEL CONTRAST DIFFERENTIATION
   Distinguishes form labels from input text for optimal readability
   ========================================================================== */

/* 1. Label Styling: Clear, Distinct Primary Blue */
.form-label {
    color: #1d4ed8 !important; /* Vibrant Primary Blue */
    font-weight: 700 !important;
    font-size: 0.86rem !important;
    margin-bottom: 0.4rem !important;
    display: inline-block;
    letter-spacing: 0.2px;
}

.form-label .text-danger {
    color: #dc2626 !important;
    font-weight: bold;
    font-size: 1.1em;
}

/* 2. Input Fields Styling: Rich Dark Text on Clean White Input Field */
.form-control, 
.form-select, 
textarea.form-control {
    color: #0f172a !important; /* Rich Dark Text */
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 0.95rem;
    line-height: 1.5;
    transition: all 0.2s ease-in-out;
}

.form-control-sm, 
.form-select-sm {
    font-size: 0.82rem !important;
    font-weight: 500;
    padding: 0.38rem 0.65rem !important;
    line-height: 1.4 !important;
    border-radius: 8px !important;
    min-height: 34px !important;
}

.form-select-sm {
    padding-right: 2rem !important;
}

/* Focus State Accent */
.form-control:focus, 
.form-select:focus,
textarea.form-control:focus {
    color: #020617 !important;
    background-color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
    outline: none;
}

/* Filled Active Input Text Distinction */
.form-control:not(:placeholder-shown):not([readonly]) {
    color: #0f172a !important;
    font-weight: 600 !important;
    background-color: #ffffff !important;
    border-color: #94a3b8;
}

/* Readonly / Disabled Input distinction */
.form-control[readonly], 
.form-control[disabled],
.form-select[disabled] {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
    font-weight: 500;
}

/* Placeholder Styling */
.form-control::placeholder {
    color: #94a3b8 !important;
    font-weight: 400;
    font-style: italic;
    font-size: 0.88rem;
}

