/* ============================================
   YAKESPEN — Premium Theme
   Inspired by MYU brand identity
   Color palette: Teal + Gold accent + Dark sidebar
   ============================================ */

/* === CSS Variables === */
:root {
    --yk-primary: #0d8a72;
    --yk-primary-dark: #0a6e5b;
    --yk-primary-light: #e8f5f1;
    --yk-accent: #e8a838;
    --yk-accent-dark: #c48a1e;
    --yk-accent-light: #fef7e8;
    --yk-sidebar-bg: #1a2332;
    --yk-sidebar-hover: rgba(255, 255, 255, 0.06);
    --yk-sidebar-active: rgba(13, 138, 114, 0.25);
    --yk-text-dark: #1e293b;
    --yk-text-muted: #64748b;
    --yk-bg-main: #f1f5f9;
    --yk-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --yk-card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --yk-radius: 12px;
    --yk-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--yk-text-dark);
    background: var(--yk-bg-main);
}

/* === Sidebar === */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--yk-sidebar-bg);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Chip putih di belakang logo agar warna brand (hijau/oranye) kontras di surface gelap/berwarna */
.logo-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.logo-chip img {
    width: 28px;
    height: 28px;
    display: block;
}

/* === Brand header (logo + tagline) ============================
   Horizontal mode: chip + (title / subtitle) — dipakai untuk varian Icon
   Vertical mode  : panel putih berisi logo penuh, subtitle di bawah
                    — dipakai untuk varian Full / Stacked yang teksnya
                      sudah ke-bake di SVG (jadi tidak ada title HTML)
   ============================================================ */
.brand-header { display: block; }

/* Horizontal */
.brand-header-h {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.brand-header-h .brand-text { line-height: 1.15; }
.brand-header-h .brand-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.2px;
}
.brand-header-h .brand-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
}

/* Vertical */
.brand-header-v {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.brand-panel {
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.brand-panel-logo {
    display: block;
    max-width: 100%;
    height: auto;
    /* ketinggian default disesuaikan via overrides di bawah */
}
/* Tinggi logo yang enak di sidebar 260px (usable ~228px) */
.brand-header-v .brand-panel-logo { max-height: 56px; }

.brand-subtitle-block {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    font-weight: 500;
}

#sidebar .nav-link {
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    margin: 2px 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    transition: var(--yk-transition);
    position: relative;
}

#sidebar .nav-link:hover {
    background: var(--yk-sidebar-hover);
    color: #fff;
    transform: translateX(3px);
}

#sidebar .nav-link.active {
    background: var(--yk-sidebar-active);
    color: #fff;
    font-weight: 500;
    border-left: 3px solid var(--yk-primary);
    margin-left: 5px;
}

#sidebar .nav-link i {
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

#sidebar .nav-link:hover i,
#sidebar .nav-link.active i {
    opacity: 1;
}

/* Page content offset */
#page-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#wrapper.toggled #sidebar {
    transform: translateX(-260px);
}

#wrapper.toggled #page-content {
    margin-left: 0;
}

/* === Top Navbar === */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* === Dropdown menu (admin topbar) === */
.navbar .dropdown-menu {
    z-index: 1080;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 0.4rem;
    min-width: 240px;
    margin-top: 0.5rem !important;
    overflow: hidden;
}

.navbar .dropdown-menu .dropdown-item {
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    color: var(--yk-text-dark);
    transition: var(--yk-transition);
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
    background: var(--yk-primary-light);
    color: var(--yk-primary-dark);
}

.navbar .dropdown-menu .dropdown-item.text-danger:hover,
.navbar .dropdown-menu .dropdown-item.text-danger:focus {
    background: #fef2f2;
    color: #dc2626 !important;
}

.navbar .dropdown-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--yk-text-muted);
}

.navbar .dropdown-menu .dropdown-item:hover i {
    color: var(--yk-primary);
}

.navbar .dropdown-menu .dropdown-item.text-danger i {
    color: #ef4444;
}

.navbar .dropdown-menu .dropdown-divider {
    margin: 0.35rem 0.25rem;
    border-color: #eef2f7;
}

/* Header info user di dalam dropdown */
.dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 0.35rem;
}

.dropdown-user-header .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yk-primary), var(--yk-primary-dark));
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-user-header .user-meta {
    min-width: 0; /* supaya text-truncate jalan */
    line-height: 1.2;
}

.dropdown-user-header .user-name {
    font-weight: 600;
    color: var(--yk-text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-header .user-sub {
    color: var(--yk-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Avatar topbar trigger */
.navbar .topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yk-primary), var(--yk-primary-dark));
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar .topbar-user-trigger {
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border-radius: 999px;
    transition: var(--yk-transition);
}

.navbar .topbar-user-trigger:hover {
    background: var(--yk-primary-light);
}

.navbar .topbar-user-trigger::after {
    color: var(--yk-text-muted);
}

/* === Cards === */
.card {
    border-radius: var(--yk-radius);
    border: none;
    box-shadow: var(--yk-card-shadow);
    transition: var(--yk-transition);
    /* Hindari card menutup dropdown navbar saat hover (translate buat stacking context) */
    position: relative;
    z-index: 1;
}

.card:hover {
    box-shadow: var(--yk-card-hover-shadow);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: none;
}

/* === Summary Cards (gradient accent) === */
.summary-card {
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--yk-radius) 0 0 var(--yk-radius);
}

.summary-card.card-peserta::before { background: linear-gradient(180deg, var(--yk-primary), #34d399); }
.summary-card.card-klaim::before { background: linear-gradient(180deg, #6366f1, #a78bfa); }
.summary-card.card-biaya::before { background: linear-gradient(180deg, var(--yk-accent), #fbbf24); }
.summary-card.card-pending::before { background: linear-gradient(180deg, #ef4444, #f97316); }

.summary-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.summary-card.card-peserta .card-icon { background: var(--yk-primary-light); color: var(--yk-primary); }
.summary-card.card-klaim .card-icon { background: #eef2ff; color: #6366f1; }
.summary-card.card-biaya .card-icon { background: var(--yk-accent-light); color: var(--yk-accent-dark); }
.summary-card.card-pending .card-icon { background: #fef2f2; color: #ef4444; }

/* Count-up animation */
.count-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--yk-text-dark);
    line-height: 1.2;
}

/* === Tables === */
.table th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--yk-text-muted);
    white-space: nowrap;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.85rem;
}

.table-hover tbody tr {
    transition: var(--yk-transition);
}

.table-hover tbody tr:hover {
    background: var(--yk-primary-light);
}

/* === Badges === */
.badge-paid {
    background: #dcfce7;
    color: #166534;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.badge-nonpaid {
    background: #fef3c7;
    color: #92400e;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.badge-icd {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.3em 0.5em;
    border-radius: 4px;
}

.badge-coverage {
    background: var(--yk-primary-light);
    color: var(--yk-primary-dark);
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0.3em 0.55em;
    border-radius: 5px;
}

/* === Greeting Banner === */
.greeting-banner {
    background: linear-gradient(135deg, var(--yk-primary) 0%, #0ea5e9 100%);
    border-radius: var(--yk-radius);
    padding: 1.5rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.greeting-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.greeting-banner h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.greeting-banner p {
    opacity: 0.85;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* === Quick Action Buttons === */
.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--yk-transition);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-action:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* === Buttons === */
.btn-primary {
    background: var(--yk-primary);
    border-color: var(--yk-primary);
    border-radius: 8px;
    font-weight: 500;
    transition: var(--yk-transition);
}

.btn-primary:hover {
    background: var(--yk-primary-dark);
    border-color: var(--yk-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 138, 114, 0.3);
}

/* === Scrollbar === */
#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* === Footer === */
footer {
    font-size: 0.8rem;
}

/* === Responsive === */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-260px);
    }

    #page-content {
        margin-left: 0;
    }

    #wrapper.toggled #sidebar {
        transform: translateX(0);
    }

    #wrapper.toggled #page-content {
        margin-left: 260px;
    }
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }


/* === Notification dropdown ============================
   Dipakai di topbar admin (.navbar) — list notifikasi unread
   ==================================================== */
.notif-dropdown-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: var(--yk-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--yk-transition);
}

.notif-dropdown-toggle:hover,
.notif-dropdown-toggle[aria-expanded="true"] {
    background: var(--yk-primary-light);
    color: var(--yk-primary-dark);
}

.notif-dropdown-toggle::after {
    display: none; /* hilangkan caret default */
}

.notif-dropdown-toggle .notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.notif-menu {
    width: 360px;
    max-width: calc(100vw - 1rem);
    padding: 0 !important;
    overflow: hidden;
}

.notif-menu .notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.notif-menu .notif-header-title {
    font-weight: 600;
    color: var(--yk-text-dark);
    font-size: 0.95rem;
}

.notif-menu .notif-header-action {
    color: var(--yk-primary);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    background: transparent;
    border: 0;
    padding: 0;
}

.notif-menu .notif-header-action:hover {
    text-decoration: underline;
}

.notif-menu .notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-menu .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: var(--yk-text-dark);
    transition: background 0.15s ease;
    position: relative;
}

.notif-menu .notif-item:last-child {
    border-bottom: 0;
}

.notif-menu .notif-item:hover {
    background: #f8fafc;
}

.notif-menu .notif-item.unread {
    background: rgba(13, 138, 114, 0.04);
}

.notif-menu .notif-item.unread::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yk-primary);
    transform: translateY(-50%);
}

.notif-menu .notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

/* Kategori warna */
.notif-icon.cat-klaim { background: #dbeafe; color: #1d4ed8; }
.notif-icon.cat-anomali { background: #fee2e2; color: #b91c1c; }
.notif-icon.cat-sistem { background: #fef3c7; color: #92400e; }
.notif-icon.cat-pengumuman { background: var(--yk-primary-light); color: var(--yk-primary-dark); }

.notif-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.notif-cat-badge.cat-klaim { background: #dbeafe; color: #1d4ed8; }
.notif-cat-badge.cat-anomali { background: #fee2e2; color: #b91c1c; }
.notif-cat-badge.cat-sistem { background: #fef3c7; color: #92400e; }
.notif-cat-badge.cat-pengumuman { background: var(--yk-primary-light); color: var(--yk-primary-dark); }

.notif-menu .notif-body {
    min-width: 0;
    flex: 1;
}

.notif-menu .notif-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--yk-text-dark);
    line-height: 1.3;
    margin-bottom: 2px;
}

.notif-menu .notif-snippet {
    font-size: 0.8rem;
    color: var(--yk-text-muted);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-menu .notif-time {
    font-size: 0.72rem;
    color: var(--yk-text-muted);
    margin-top: 4px;
}

.notif-menu .notif-footer {
    border-top: 1px solid #eef2f7;
    text-align: center;
    padding: 0.6rem;
}

.notif-menu .notif-footer a {
    color: var(--yk-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.notif-menu .notif-footer a:hover {
    color: var(--yk-primary-dark);
    text-decoration: underline;
}

.notif-menu .notif-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--yk-text-muted);
    font-size: 0.9rem;
}

/* === Form layout helpers (untuk page Tambah) ========== */
.form-section-card {
    background: #fff;
    border-radius: var(--yk-radius);
    box-shadow: var(--yk-card-shadow);
    margin-bottom: 1.25rem;
}

.form-section-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.form-section-header .form-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--yk-primary-light);
    color: var(--yk-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-section-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--yk-text-dark);
    font-size: 0.95rem;
}

.form-section-header small {
    color: var(--yk-text-muted);
    font-size: 0.78rem;
}

.form-section-body {
    padding: 1.25rem;
}

/* Two-column responsive: label di kiri (md+), input di kanan */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .form-row-2 {
        grid-template-columns: 220px 1fr;
        align-items: start;
    }

    .form-row-2 .form-row-label {
        padding-top: 0.55rem;
    }
}

.form-row-2 .form-row-label {
    font-weight: 500;
    color: var(--yk-text-dark);
    font-size: 0.9rem;
}

.form-row-2 .form-row-label .text-required {
    color: #ef4444;
    margin-left: 2px;
}

.form-row-2 .form-row-help {
    font-size: 0.78rem;
    color: var(--yk-text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* Sticky footer untuk action button (Batal | Simpan Draft | Simpan & Aktifkan) */
.form-action-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 1.25rem;
    margin: 1.5rem -1rem -1rem;
    border-radius: 0 0 var(--yk-radius) var(--yk-radius);
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    z-index: 5;
}

.form-action-footer .btn {
    min-width: 140px;
}

/* Page header untuk halaman form */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header .breadcrumb {
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}

.page-header .breadcrumb a {
    color: var(--yk-text-muted);
    text-decoration: none;
}

.page-header .breadcrumb a:hover {
    color: var(--yk-primary);
}

.page-header h4 {
    font-weight: 700;
    color: var(--yk-text-dark);
    margin-bottom: 0.25rem;
}

.page-header .page-subtitle {
    color: var(--yk-text-muted);
    font-size: 0.88rem;
    margin: 0;
}
