@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

* { font-family: 'Montserrat', sans-serif; }

body { background: #dbe9f6; }

#wrapper { overflow-x: hidden; }

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -260px;
    width: 260px;
    background: #0b1f51;
    transition: margin 0.25s ease-out;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#sidebar-wrapper .sidebar-heading,
#sidebar-wrapper .sidebar-heading strong { color: #fff !important; }

#sidebar-wrapper .sidebar-heading i { color: #dbe9f6; }

.sidebar-nav { padding: 0.75rem 0; }

.sidebar-nav .nav-item { padding: 0 0.75rem; margin-bottom: 2px; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.2s;
}

.sidebar-nav .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: #4530b3;
    font-weight: 500;
}

.dropdown-toggle-master {
    cursor: pointer;
}
.dropdown-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.dropdown-toggle-master.active .dropdown-icon {
    transform: rotate(180deg);
}

.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 0.75rem;
}
.sub-menu.show {
    max-height: 300px;
}
.sub-menu .sub-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: all 0.2s;
}
.sub-menu .sub-link i { font-size: 0.9rem; width: 18px; text-align: center; }
.sub-menu .sub-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.sub-menu .sub-link.active {
    color: #fff;
    background: rgba(69,48,179,0.4);
    font-weight: 500;
}

.sidebar-nav .nav-link.text-danger { color: #f87171 !important; }
.sidebar-nav .nav-link.text-danger:hover { background: rgba(248,113,113,0.12); color: #fca5a5 !important; }

#page-content-wrapper { min-width: 100vw; flex: 1; }

#wrapper.toggled #sidebar-wrapper { margin-left: 0; }

@media (min-width: 992px) {
    #sidebar-wrapper { margin-left: 0; }
    #page-content-wrapper { min-width: 0; }
    #wrapper.toggled #sidebar-wrapper { margin-left: -260px; }
}

.top-navbar {
    background: #fff !important;
    padding: 0.6rem 1.5rem;
    box-shadow: 0 1px 3px rgba(11,31,81,0.06);
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.5rem;
    background: #dbe9f6;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0b1f51;
}

.top-navbar .user-info .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #4530b3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-toggle-sidebar {
    background: none; border: none; color: #0b1f51;
    font-size: 1.3rem; padding: 0.25rem 0.5rem;
    border-radius: 6px; transition: background 0.2s;
}

.btn-toggle-sidebar:hover { background: #dbe9f6; }

.content-wrapper { padding: 1.5rem; }

@media (max-width: 575.98px) {
    .content-wrapper { padding: 1rem; }
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b1f51;
    margin-bottom: 1.25rem;
}

.card-dashboard {
    border-radius: 12px;
    border: none;
    background: #fff;
    box-shadow: 0 1px 4px rgba(11,31,81,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11,31,81,0.1);
}

.stat-card { position: relative; overflow: hidden; }

.stat-card .stat-icon {
    width: 48px; height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.4rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0b1f51;
    line-height: 1.2;
}

.stat-card .stat-bg-icon {
    position: absolute;
    right: -5px; bottom: -5px;
    font-size: 4rem;
    opacity: 0.04;
    color: #0b1f51;
}

.table > thead {
    background: #dbe9f6;
    color: #0b1f51;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table > thead th { border-bottom: none; padding: 0.7rem 0.75rem; }

.table > tbody td { padding: 0.65rem 0.75rem; vertical-align: middle; font-size: 0.85rem; }

.btn-action {
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-actions .btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary { background: #4530b3; border-color: #4530b3; }
.btn-primary:hover { background: #3628a0; border-color: #3628a0; }
.btn-primary:focus { box-shadow: 0 0 0 0.2rem rgba(69,48,179,0.25); }

.btn-whatsapp { background: #25D366; border-color: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; border-color: #1da851; color: #fff; }
.btn-whatsapp:focus { box-shadow: 0 0 0 0.2rem rgba(37,211,102,0.25); }

.btn-outline-primary { color: #4530b3; border-color: #4530b3; }
.btn-outline-primary:hover { background: #4530b3; border-color: #4530b3; }

.bg-primary { background-color: #4530b3 !important; }
.text-primary { color: #4530b3 !important; }

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.6em;
}

.card-header { background: #fff; border-bottom: 1px solid #dbe9f6; }
.card-header h5 { color: #0b1f51; font-weight: 600; font-size: 0.95rem; }

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbe9f6;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(11,31,81,0.08);
}

.login-card .card-body { padding: 2.5rem; }

.login-logo { text-align: center; margin-bottom: 2rem; }

.login-logo .logo-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.login-logo .logo-circle i { font-size: 1.75rem; color: #4530b3; }

.login-logo h5 { color: #0b1f51; font-weight: 700; margin-top: 1rem; }

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dbe9f6;
}

.login-divider span {
    padding: 0 0.75rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

.toggle-password {
    cursor: pointer;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.form-control:focus { border-color: #4530b3; box-shadow: 0 0 0 3px rgba(69,48,179,0.1); }
.form-check-input:checked { background-color: #4530b3; border-color: #4530b3; }

.input-group-text { background: #f8fafc; border-right: none; color: #64748b; }
.input-group .form-control { border-left: none; }
.input-group .form-control:focus { border-left: none; box-shadow: none; }

/* Form styling */
.form-label { color: #475569; font-weight: 500; font-size: 0.85rem; }
.form-control, .form-select { border-radius: 8px; border-color: #dbe9f6; font-size: 0.875rem; }
.form-control:focus, .form-select:focus { border-color: #4530b3; box-shadow: 0 0 0 3px rgba(69,48,179,0.1); }

/* Select2 inside input-group (sejajar dengan tombol +) */
.input-group .select2-container {
    width: auto !important;
    flex: 1 1 0%;
    min-width: 0;
    margin-left: 0 !important;
}
.input-group .select2-container .select2-selection--single {
    height: 38px;
    border: 1px solid #dbe9f6;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-right: none;
    background: #fff;
}
.input-group .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    font-size: 0.875rem;
    color: #212529;
}
.input-group .select2-container .select2-selection--single .select2-selection__arrow {
    height: 36px;
}
.input-group .select2-container.select2-container--focus .select2-selection--single,
.input-group .select2-container--open .select2-selection--single {
    border-color: #4530b3;
    box-shadow: 0 0 0 3px rgba(69,48,179,0.1);
}
.input-group .select2-container--open .select2-selection--single {
    border-bottom-left-radius: 0;
}

/* Status indicators */
.status-indicator { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* Print */
.print-area { background: #fff; padding: 2rem; }

@media print {
    #sidebar-wrapper, .top-navbar, .btn, .no-print { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; }
    .print-area { padding: 0; }
}

/* Alert */
.alert { border-radius: 10px; border: none; font-size: 0.85rem; }

/* Pagination / DataTable */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #4530b3 !important;
    border-color: #4530b3 !important;
    color: #fff !important;
    border-radius: 6px !important;
}

/* Modal */
.modal-content { border: none; border-radius: 14px; }
.modal-header { border-bottom: 1px solid #dbe9f6; }

/* List Group (sidebar mobile) */
.list-group-item {
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

/* Spacing utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #dbe9f6; }
::-webkit-scrollbar-thumb { background: #b0c4de; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
