/* =====================================
   NOTIFICATION MODERN DROPDOWN
   ===================================== */

.notif-wrap {
    position: relative;
    z-index: 60;
    display: flex;
    align-items: center;
}

/* Tombol Bell */
.notif-button {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    color: #1e293b;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.notif-button:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(51, 102, 255, 0.15);
    transform: translateY(-1px);
}

.notif-button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(51, 102, 255, 0.3);
}

/* Badge jumlah notifikasi */
.notif-button .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 50px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* Dropdown Container */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15), 0 4px 16px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    overflow: hidden;
    transform-origin: top right;
}

.notif-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Header */
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.notif-dropdown-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.notif-status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 50px;
}

/* List Notifikasi */
.notif-dropdown-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 12px;
}

.notif-dropdown-list::-webkit-scrollbar {
    width: 4px;
}

.notif-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.notif-dropdown-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Item Notifikasi */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 14px;
    margin-bottom: 4px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.notif-item:hover {
    background: #f8faff;
    border-color: #e8f0fe;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.15);
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 3px;
    line-height: 1.4;
}

.notif-item-content small {
    display: block;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 4px;
}

.notif-item-time {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* Notifikasi Kosong */
.notif-empty {
    padding: 32px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* Link Lihat Semua */
.notif-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid #f1f5f9;
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.notif-view-all:hover {
    background: #f8faff;
    gap: 12px;
}

.notif-view-all i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.notif-view-all:hover i {
    transform: translateX(4px);
}

/* =====================================
   RESPONSIVE
   ===================================== */

/* =====================================
   RIWAYAT NOTIFIKASI - FILTER & TABLE
   ===================================== */

.filter-bar {
    padding: 16px 22px;
    background: #fafbff;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid #eef2f6;
}

.filter-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.filter-form label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.filter-form select {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.1);
}

/* Search input group */
.search-input-group {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.1);
}

.search-input-group .search-input {
    border: none;
    outline: none;
    padding: 8px 16px;
    font-size: 13px;
    color: #1e293b;
    background: transparent;
    min-width: 430px;
}

.search-input-group .search-input::placeholder {
    color: #94a3b8;
}

.search-input-group .btn-search {
    border: none;
    border-radius: 0;
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.search-input-group .btn-search:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.search-input-group .btn-search:active {
    transform: translateY(0);
}

.notif-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 10px;
    transition: background 0.2s;
}

.select-all-label:hover {
    background: #f1f5f9;
}

.select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Aksi Pilih - tombol aksi modern */
.aksi-pilih {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aksi-pilih .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.aksi-pilih .btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.aksi-pilih .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.aksi-pilih .btn-danger:active {
    transform: translateY(0);
}

.aksi-pilih .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.aksi-pilih .btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.aksi-pilih .btn-secondary:active {
    transform: translateY(0);
}

/* Tombol Pilih utama */
#btn-pilih-notifikasi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    background: linear-gradient(135deg, #3366ff, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(51, 102, 255, 0.25);
}

#btn-pilih-notifikasi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 102, 255, 0.35);
}

#btn-pilih-notifikasi:active {
    transform: translateY(0);
}

/* Badge jenis notifikasi */
.badge-jenis {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-surat {
    background: #eef2ff;
    color: #3366ff;
}

.badge-pengajuan {
    background: #fef3c7;
    color: #d97706;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-dibaca {
    background: #f1f5f9;
    color: #64748b;
}

.status-belum {
    background: #dbeafe;
    color: #2563eb;
}

/* Highlight baris belum dibaca */
.arsip-table tbody tr.is-unread {
    background: #f8faff;
}

.arsip-table tbody tr.is-unread td {
    font-weight: 500;
}

.arsip-table tbody tr.is-unread .badge-jenis {
    font-weight: 700;
}

/* Table layout fix: cegah kolom terpotong / overflow */
.arsip-table table {
    table-layout: auto;
    width: 100%;
}

.arsip-table td,
.arsip-table th {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    vertical-align: middle;
}

/* Batasi kolom pesan agar tidak terlalu lebar */
.arsip-table td:nth-child(4) {
    max-width: 280px;
    min-width: 160px;
}

/* Kolom judul */
.arsip-table td:nth-child(3) {
    max-width: 220px;
    min-width: 120px;
}

/* Kolom tanggal */
.arsip-table td:nth-child(5) {
    white-space: nowrap;
}

/* Kolom status */
.arsip-table td:nth-child(6) {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .notif-dropdown {
        width: calc(100% - 32px);
        max-width: 340px;
        min-width: 260px;
        right: 0;
        left: auto;
        top: calc(100% + 8px);
        z-index: 99999;
    }
    .notif-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
