/* ============================================================
   custom.css — Monev IKI Global Styles
   ============================================================ */

:root {
    --primary: #1570EF;
    --primary-dark: #0c4fc4;
    --primary-gradient: linear-gradient(135deg, #1570EF 0%, #0c4fc4 100%);
    --bg-light: #f8fafc;
    --surface: #ffffff;

    /* Global Status Colors - Fixed */
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;

    --card-radius: 12px;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    /* Dashboard Premium Colors */
    --premium-blue: #1570EF;
    --premium-green: #10b981;
    --premium-orange: #f59e0b;
    --premium-red: #ef4444;
}

/* ---- SELECT2 GLOBAL FIX ---- */
/* Dropdown muncul di atas card/content normal (z-index < modal 1040) */
.select2-dropdown {
    z-index: 1000 !important;
}

/* Saat Bootstrap modal terbuka, sembunyikan Select2 halaman di belakang modal overlay */
body.modal-open .select2-container {
    z-index: 0 !important;
}

body.modal-open .select2-dropdown {
    z-index: 0 !important;
}

/* Select2 DI DALAM modal → harus di atas konten modal (z-index > 1050) */
.modal .select2-container {
    z-index: 1055 !important;
}

.modal .select2-dropdown {
    z-index: 1060 !important;
}

/* Tinggi standar select2 sesuai Bootstrap 4 form-control */
.select2-container--bootstrap4 .select2-selection--single {
    height: 38px !important;
    padding: 0 !important;
    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    background-color: #fff;
    overflow: hidden;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    height: 36px;
    line-height: 36px !important;
    padding-left: 12px !important;
    padding-right: 28px !important;
    color: #495057;
    font-size: 0.875rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    width: 20px;
    top: 0 !important;
    right: 4px !important;
    position: absolute;
    bottom: 0;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

.select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent;
    border-width: 0 4px 5px 4px;
}

.select2-container--bootstrap4 .select2-selection--single:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection--single {
    border-color: #1570EF !important;
    box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.15) !important;
    outline: 0;
}

/* ---- TYPOGRAPHY ---- */
body,
.content-wrapper,
.nav,
p,
label,
input,
select,
textarea,
button {
    font-family: 'Inter', 'Nunito', sans-serif;
}

/* ---- SIDEBAR BRANDING ---- */
.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 16px;
}

.brand-link .brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-user-panel {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.sidebar-user-panel .user-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-panel .user-role {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 10px;
}

/* ---- NAVBAR ---- */
.main-header.navbar {
    border-bottom: 1px solid #e8ecef;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #444;
}

.navbar-user-info .nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-user-info .nav-user-name {
    font-weight: 600;
    color: #333;
}

.navbar-user-info .nav-user-role {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
}

/* ---- CARD STYLE ---- */
.card {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: var(--card-radius);
}

.card-header {
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #1570EF, #0c4fc4) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

/* ---- PREMIUM UTILITIES ---- */
.bg-gradient-premium {
    background: linear-gradient(135deg, var(--premium-blue) 0%, #0c4fc4 100%) !important;
    color: white !important;
}

.bg-gradient-success-premium {
    background: linear-gradient(135deg, var(--premium-green) 0%, #059669 100%) !important;
    color: white !important;
}

.bg-gradient-warning-premium {
    background: linear-gradient(135deg, var(--premium-orange) 0%, #d97706 100%) !important;
    color: white !important;
}

.bg-gradient-danger-premium {
    background: linear-gradient(135deg, var(--premium-red) 0%, #dc2626 100%) !important;
    color: white !important;
}

.card-premium {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 16px !important;
    overflow: hidden;
    border: none;
    box-shadow: var(--card-shadow);
}

.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.page-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-section-title i {
    width: 36px;
    height: 36px;
    background: #eff6ff;
    color: var(--premium-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- MONTH PILL / TABS ---- */
.month-pill-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 6px 10px;
    width: fit-content;
    border: none !important;
    margin-bottom: 15px;
}

.month-pill-wrapper .nav-link.month-pill,
.month-pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b !important;
    cursor: pointer;
    border: none !important;
    background: transparent !important;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.month-pill:hover,
.month-pill-wrapper .nav-link.month-pill:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.month-pill.active,
.month-pill-wrapper .nav-link.month-pill.active {
    background: var(--premium-blue) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(21, 112, 239, 0.2);
}

.month-pill.locked,
.month-pill-wrapper .nav-link.month-pill.locked {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

.section-label-pill {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ---- MONTH PILL BUTTONS ---- */
.bulan-btn,
.bulan-btn-group .btn {
    border-radius: 50px !important;
    padding: 4px 14px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    transition: all 0.18s ease;
    border-width: 1.5px !important;
    margin-bottom: 4px;
}

.bulan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.25);
}

.bulan-btn-active,
.bulan-btn.bulan-btn-active {
    background: linear-gradient(135deg, #1570EF, #0c4fc4) !important;
    color: #fff !important;
    border-color: #0c4fc4 !important;
    box-shadow: 0 3px 10px rgba(21, 112, 239, 0.35);
}

/* ikiAtasan / iki_atasan month tabs */
.bulan.btn-primary {
    border-radius: 50px !important;
    padding: 4px 14px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
}

/* profil_iki nav-tabs → pill style */
#bulanTabs .nav-link {
    border-radius: 50px !important;
    padding: 5px 14px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #555;
    border: 1.5px solid #dee2e6;
    margin-right: 4px;
    transition: all 0.16s ease;
}

#bulanTabs .nav-link.active {
    background: linear-gradient(135deg, #1570EF, #0c4fc4) !important;
    color: #fff !important;
    border-color: #0c4fc4 !important;
}

#bulanTabs .nav-link.locked {
    background-color: #fff4f4 !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

/* ---- TABLE ---- */
.table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #555;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: #f0f5ff;
    transition: background 0.12s;
}

.table-sm td,
.table-sm th {
    padding: 0.45rem 0.6rem;
}

/* ---- BADGE ---- */
.badge {
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge.bg-success {
    background: #12b76a !important;
}

.badge.bg-warning {
    background: #f79009 !important;
    color: #fff !important;
}

.badge.bg-danger {
    background: #f04438 !important;
}

.badge.bg-secondary {
    background: #98a2b3 !important;
}

/* ---- SMALL BOXES (Dashboard stat) ---- */
.small-box {
    border-radius: 10px !important;
    overflow: hidden;
}

.small-box .inner h3 {
    font-size: 1.8rem;
    font-weight: 700;
}

.small-box .inner p {
    font-size: 0.8rem;
    font-weight: 500;
}

.small-box>.small-box-footer {
    font-size: 0.75rem;
}

/* ---- BUTTONS ---- */
.btn {
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-xs {
    padding: 2px 8px;
    font-size: 0.72rem;
    border-radius: 4px;
}

/* ---- SECTION LABEL ---- */
.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #98a2b3;
    margin-bottom: 6px;
}

/* ---- CONTENT HEADER ---- */
.content-header {
    padding: 12px 24px 0;
}

.content-wrapper {
    background-color: var(--bg-light);
}

/* ---- FORM ---- */
.form-control {
    border-radius: 6px;
    border: 1.5px solid #d0d5dd;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: #1570EF;
    box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.15);
}

/* ---- FILTER AREA ---- */
.filter-area {
    background: #f8faff;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

/* ---- PAGE TITLE ---- */
.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d2939;
    margin: 0;
}

/* ---- LOCK STATUS ---- */
.lock-badge-done {
    background: #dcfae6;
    color: #027a48;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lock-badge-wait {
    background: #fef3f2;
    color: #b42318;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lock-badge-opd {
    background: #fffaeb;
    color: #b54708;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---- ANIMATE ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.3s ease;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .bulan-btn {
        padding: 3px 10px !important;
        font-size: 0.72rem !important;
    }

    .small-box .inner h3 {
        font-size: 1.4rem;
    }
}