/* =====================================================
   Avatar Upload Styles
===================================================== */

.avatar-upload-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    position: relative;
    cursor: pointer;
    border: 3px solid var(--slate-200);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.avatar-upload-preview:hover {
    border-color: var(--primary);
}

.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: var(--transition-fast);
}

.avatar-upload-preview:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay span {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

/* =====================================================
   Announcement System - Banner & Popup
===================================================== */

/* ---- 1. ANNOUNCEMENT BANNER (Running Text / Ticker) ---- */
.announcement-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    overflow: hidden;
    position: relative;
    z-index: 999;
    flex-shrink: 0;
    border-bottom: 2px solid #b45309;
}

/* Desktop Full Width Fix */
@media (min-width: 769px) {
    .announcement-banner {
        /* Fix for full-width inside main-content */
        margin-left: calc(var(--space-3) * -1);
        margin-right: calc(var(--space-3) * -1);
        width: calc(100% + var(--space-3) * 2);
        margin-top: calc(var(--space-3) * -1);
        margin-bottom: var(--space-3);
        border-radius: 0;
    }
}

.announcement-banner.hidden {
    display: none !important;
}

.announcement-banner-inner {
    display: flex;
    align-items: center;
    height: 38px;
    position: relative;
}

.announcement-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    color: #d97706;
    padding: 4px 12px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.announcement-marquee-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.announcement-marquee-track {
    display: flex;
    animation: announcementMarquee 25s linear infinite;
    white-space: nowrap;
}

.announcement-marquee-text {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0 2rem;
    flex-shrink: 0;
}

.announcement-marquee-text strong {
    font-weight: 700;
}

.announcement-info-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

@keyframes announcementMarquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.announcement-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(0, 0, 0, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.announcement-close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ---- 2. ANNOUNCEMENT POPUP OVERLAY ---- */
.announcement-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(6px);
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---- 3. ANNOUNCEMENT POPUP CARD ---- */
.announcement-popup-card {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 4px solid #fbbf24;
    animation: popupSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

/* Close button (X) top-right of card */
.announcement-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.announcement-popup-close:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Popup Header (Amber/Gold background) */
.announcement-popup-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
}

.announcement-popup-icon-bg {
    position: relative;
    margin-bottom: 1rem;
}

.announcement-popup-icon {
    background: white;
    color: #f59e0b;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.announcement-popup-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.9;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.announcement-popup-title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Popup Body */
.announcement-popup-body {
    padding: 2rem;
    text-align: center;
}

.announcement-popup-message {
    font-size: 1rem;
    color: var(--slate-600);
    line-height: 1.7;
    font-weight: 500;
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

.announcement-popup-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 14px -4px var(--primary);
    transition: all 0.2s;
}

.announcement-popup-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--primary);
}

.announcement-popup-btn:active {
    transform: scale(0.98);
}

.announcement-popup-meta {
    font-size: 0.75rem;
    color: var(--slate-400);
    font-style: italic;
    margin-top: 0.75rem;
}

/* ---- 4. PING ANIMATION ---- */
@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ---- 5. RESPONSIVE ADJUSTMENTS ---- */
@media (max-width: 768px) {
    .announcement-popup-card {
        max-width: 95%;
        border-radius: 20px;
    }

    .announcement-popup-header {
        padding: 2rem 1rem 1.5rem;
    }

    .announcement-popup-icon {
        width: 64px;
        height: 64px;
    }

    .announcement-popup-icon svg {
        width: 28px !important;
        height: 28px !important;
    }

    .announcement-popup-title {
        font-size: 1.25rem;
    }

    .announcement-popup-body {
        padding: 1.5rem;
    }

    .announcement-marquee-text {
        font-size: 0.75rem;
    }

    .announcement-badge span {
        display: none;
    }
}

/* =====================================================
   ANNOUNCEMENT HISTORY LOG STYLES
===================================================== */

.ann-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.ann-history-list {
    display: flex;
    flex-direction: column;
}

.ann-history-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-100);
    transition: background 0.15s ease;
}

.ann-history-item:hover {
    background: var(--slate-50);
}

.ann-history-item:last-child {
    border-bottom: none;
}

.ann-history-item.active {
    border-left: 3px solid #f59e0b;
}

.ann-history-item.expired {
    border-left: 3px solid var(--slate-200);
    opacity: 0.75;
}

.ann-history-item-left {
    flex-shrink: 0;
    padding-top: 2px;
}

.ann-history-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ann-history-icon.live {
    background: #fffbeb;
    color: #d97706;
}

.ann-history-icon.past {
    background: var(--slate-100);
    color: var(--slate-400);
}

.ann-history-item-body {
    flex: 1;
    min-width: 0;
}

.ann-history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.ann-history-item-top h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--slate-800);
    line-height: 1.3;
}

.ann-history-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ann-badge-live,
.ann-badge-expired,
.ann-badge-read,
.ann-badge-unread {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.ann-badge-live {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.ann-badge-expired {
    background: var(--slate-100);
    color: var(--slate-500);
    border: 1px solid var(--slate-200);
}

.ann-badge-read {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.ann-badge-unread {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.ann-history-message {
    font-size: 0.825rem;
    color: var(--slate-600);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ann-history-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ann-history-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--slate-400);
}

.ann-history-relative {
    font-style: italic;
}

.ann-history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--slate-100);
    background: var(--slate-50);
}

.ann-history-page-info {
    font-size: 0.75rem;
    color: var(--slate-500);
    font-weight: 500;
}

/* =====================================================
   APP VIEW TOGGLE (Timeline | Notepad)
===================================================== */

.app-view-toggle {
    display: flex;
    background: var(--slate-100);
    padding: 3px;
    border-radius: 10px;
    gap: 2px;
}

.app-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--slate-500);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.app-view-btn:hover {
    color: var(--slate-700);
}

.app-view-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   NOTEPAD VIEW STYLES
===================================================== */

.notepad-view {
    animation: fadeInUp 0.3s ease;
    overflow-y: auto;
    flex: 1;
}

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

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

.notepad-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.notepad-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--slate-800);
    margin: 0;
    letter-spacing: -0.02em;
}

.notepad-header p {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin: 4px 0 0;
}

.notepad-filters {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(241, 245, 249, 0.7);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.notepad-filter-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--slate-500);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notepad-filter-btn:hover {
    color: var(--slate-700);
    background: rgba(255, 255, 255, 0.5);
}

.notepad-filter-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Notes Grid */
.notepad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .notepad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .notepad-grid {
        grid-template-columns: 1fr;
    }

    .notepad-filters {
        gap: 2px;
        padding: 3px;
    }

    .notepad-filter-btn {
        padding: 6px 12px;
        font-size: 0.72rem;
    }
}

/* Note Card */
.note-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--slate-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.note-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--slate-300);
}

.note-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.note-vis-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 6px;
}

.note-vis-badge.private {
    color: var(--slate-500);
    background: var(--slate-100);
}

.note-vis-badge.public {
    color: #059669;
    background: #ecfdf5;
}

.note-vis-badge.shared {
    color: #2563eb;
    background: #eff6ff;
}

.note-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    position: relative;
    z-index: 5;
}

.note-card:hover .note-card-actions {
    opacity: 1;
}

.note-card-actions button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 6;
}

.note-action-edit {
    background: var(--slate-100);
    color: var(--slate-500);
    border: 1px solid var(--slate-200);
}

.note-action-edit:hover {
    background: #eef2ff;
    color: var(--primary);
    border-color: var(--primary-light);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.note-action-delete {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.note-action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.note-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 8px;
    line-height: 1.3;
}

.note-card-content {
    font-size: 0.85rem;
    color: var(--slate-500);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
    flex: 1;
    min-height: 80px;
}

.note-card-footer {
    padding: 14px 20px;
    background: var(--slate-50);
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--slate-500);
    overflow: hidden;
}

.note-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-card-author-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-600);
}

.note-card-time {
    font-size: 0.68rem;
    color: var(--slate-400);
}

.note-card-shared-depts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    max-width: 140px;
}

.note-dept-tag {
    font-size: 0.55rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 50px;
    background: #dbeafe;
    color: #2563eb;
    white-space: nowrap;
}

/* Notepad Empty State */
.notepad-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.notepad-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.notepad-empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--slate-300);
}

.notepad-empty p {
    font-size: 0.9rem;
    color: var(--slate-400);
    font-style: italic;
    font-weight: 500;
}

/* Notepad Loading */
.notepad-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 12px;
}

.notepad-loading p {
    font-size: 0.85rem;
    color: var(--slate-400);
    font-weight: 500;
}

/* =====================================================
   NOTE MODAL FORM STYLES
===================================================== */

.note-visibility-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--slate-100);
    border-radius: 10px;
}

.vis-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--slate-400);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vis-btn:hover {
    color: var(--slate-600);
}

.vis-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Modern Department Chip Selector */
.note-dept-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1.5px solid var(--slate-200);
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.dept-chip {
    cursor: pointer;
    position: relative;
}

.dept-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dept-chip-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-500);
    background: white;
    border: 1.5px solid var(--slate-200);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}

.dept-chip-inner svg,
.dept-chip-inner i {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
}

.dept-chip:hover .dept-chip-inner {
    border-color: var(--primary-light);
    color: var(--primary);
    background: #eef2ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

/* Checked state */
.dept-chip:has(input:checked) .dept-chip-inner {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.15);
    font-weight: 700;
}

/* Fallback for browsers without :has() support */
.dept-chip input:checked + .dept-chip-inner {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.15);
    font-weight: 700;
}

/* =====================================================
   NOTE DETAIL MODAL
===================================================== */

.note-card {
    cursor: pointer;
}

.note-detail-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--slate-700);
    font-family: 'Inter', -apple-system, sans-serif;
}

.note-detail-body::-webkit-scrollbar {
    width: 6px;
}

.note-detail-body::-webkit-scrollbar-track {
    background: transparent;
}

.note-detail-body::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 3px;
}

.note-detail-body::-webkit-scrollbar-thumb:hover {
    background: var(--slate-300);
}

.note-detail-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--slate-200);
    background: linear-gradient(to bottom, var(--slate-50), #f1f5f9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.note-detail-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.note-detail-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
    overflow: hidden;
}

.note-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-detail-author-info {
    display: flex;
    flex-direction: column;
}

.note-detail-author-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-700);
}

.note-detail-author-time {
    font-size: 0.68rem;
    color: var(--slate-400);
}

.note-detail-actions {
    display: flex;
    gap: 8px;
}

.note-detail-actions .btn {
    padding: 8px 16px;
    font-size: 0.78rem;
}

.note-detail-shared-depts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 12px 24px 0;
}

.note-detail-shared-depts .note-dept-tag {
    font-size: 0.65rem;
    padding: 3px 8px;
}

/* Notepad Modal Size */
#modal-note {
    max-width: 1100px;
    width: 95%;
    max-height: 92vh;
}

#modal-note-detail {
    max-width: 1100px;
    width: 100%;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

#modal-note-detail .modal-header {
    flex-shrink: 0;
}

#modal-note-detail .modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    max-height: none;
    overflow: hidden;
}

.routine-badge {
    background: #fdf2f8;
    /* pink-50 */
    color: #db2777;
    /* pink-600 */
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    border: 1px solid #fbcfe8;
    margin-left: 4px;
}

/* =====================================================
   Zoom Controls
   ===================================================== */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 3px 6px;
    margin-right: 12px;
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--slate-600);
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.zoom-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
    text-align: center;
    user-select: none;
}

.zoom-preset-select {
    font-size: 0.75rem;
    padding: 4px 6px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: white;
    color: var(--slate-700);
    cursor: pointer;
    outline: none;
    font-weight: 600;
}

.zoom-preset-select:focus {
    border-color: var(--primary);
}

/* =====================================================
   Hover Popover for Task Cards
   ===================================================== */
.task-hover-popover {
    position: fixed;
    z-index: 9999;
    width: 260px;
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--slate-200);
    pointer-events: none;
    animation: popoverFadeIn 0.15s ease;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.task-hover-popover .pop-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.task-hover-popover .pop-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 8px;
    line-height: 1.3;
    word-wrap: break-word;
}

.task-hover-popover .pop-row {
    font-size: 0.8rem;
    color: var(--slate-600);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.task-hover-popover .pop-row span {
    flex-shrink: 0;
}

/* =====================================================
   Logged-in User Column Highlight (My Column)
   ===================================================== */
.calendar-staff-header.my-column {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.04));
    border-bottom: 3px solid var(--primary);
}

.calendar-staff-column.my-column {
    background: rgba(99, 102, 241, 0.02);
    border-left: 2px solid rgba(99, 102, 241, 0.15);
    border-right: 2px solid rgba(99, 102, 241, 0.15);
}

/* =====================================================
   Admin Column Resize Handle
   ===================================================== */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.2s ease;
}

.col-resize-handle:hover,
.col-resize-handle:active {
    background: var(--primary);
    opacity: 0.5;
}

.calendar-staff-header {
    position: relative;
}

/* =====================================================
   Bigger Notepad Textarea
   ===================================================== */
#note-content {
    min-height: 280px !important;
    max-height: 500px;
    resize: vertical;
    width: 100%;
    font-size: 0.9rem !important;
    line-height: 1.8 !important;
}

/* =====================================================
   UX & SCROLL FIXES (GLOBAL ARCHITECTURE)
   Fixes "Bug Tampilan pada Log" & "Bug Scroll"
   ===================================================== */

/* 1. Force App Wrapper to be Full Height Flex Column */
/* This ensures header stays top, and content fills rest */
body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent body scroll */
}

.main-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

/* 2. Main Content Area - Handles Views */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent global scroll, delegate to views */
    position: relative;
    height: auto !important;
    /* Override old calc() to use flex */
    margin: 0;
    max-height: 100vh;
}

/* Fix Mobile Bottom Padding since Nav is Fixed */
@media (max-width: 768px) {
    .main-content {
        padding-bottom: 90px !important;
        /* Space for Bottom Nav */
    }
}

/* 3. Page Header - Static (Don't Shrink) */
.page-header {
    flex: 0 0 auto;
    z-index: 50;
    margin-bottom: var(--space-2);
}

/* 4. View Containers - Full Height & Independent Scroll */

/* Timeline View */
.timeline-container {
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    /* Internal calendar-body-scroll handles scroll */
    display: flex;
    flex-direction: column;
}

/* Calendar Specifics */
.calendar-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-body-scroll {
    flex: 1;
    overflow: auto;
    /* Allow both X and Y scroll */
    padding-bottom: 20px;
}

/* List View */
.list-view-container {
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: white;
}

/* List Content Wrapper - ensure it scrolls */
#list-view-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    min-height: 0;
}

/* Log / History View */
.history-view-container {
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* History Content Wrapper - ensure it scrolls */
#history-view-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    min-height: 0;
}

/* Ensure Headers don't scroll away */
.list-view-filters,
.history-view-header {
    flex: 0 0 auto;
    z-index: 20;
    background: var(--slate-50);
    position: relative;
    /* Context for z-index */
}

/* Fix History Items form Squashing */
.history-date-group {
    flex-shrink: 0;
    width: 100%;
    margin-bottom: var(--space-4);
}

.history-task-card {
    flex-shrink: 0;
    width: 100%;
}

/* Fix List Items form Squashing */
.list-group {
    flex-shrink: 0;
    width: 100%;
}

.list-task-card {
    flex-shrink: 0;
    width: 100%;
}

/* =====================================================
   LAMPIRAN VIEW — Modern React-Inspired Design
===================================================== */

.lampiran-view {
    animation: fadeInUp 0.3s ease;
    overflow-y: auto;
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.lampiran-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.lampiran-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--slate-800);
    margin: 0;
    letter-spacing: -0.02em;
}

.lampiran-header p {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin: 4px 0 0;
}

/* ---- Filters — Glassmorphism Bar ---- */
.lampiran-filters {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.lampiran-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.lampiran-filter-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: auto;
    flex: 0 0 auto;
}

.lampiran-filter-item label {
    display: none;
}

.lampiran-filter-item select {
    padding: 8px 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-700);
    background: white;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    height: 38px;
    cursor: pointer;
}

.lampiran-filter-item select:hover {
    border-color: var(--slate-300);
}

.lampiran-filter-item select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.lampiran-filter-actions {
    flex: 0 0 auto;
    min-width: auto;
}

/* Uniform button height for lampiran filters */
.lampiran-filters .btn-sm {
    height: 38px;
    padding: 0 14px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
}

/* ---- Stats Bar ---- */
.lamp-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
    flex-shrink: 0;
}

.lamp-stats-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lamp-stats-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 10px;
    letter-spacing: -0.01em;
}

.lamp-stats-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-500);
}

.lamp-stats-range {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.lamp-stats-range strong {
    color: var(--slate-600);
    font-weight: 700;
}

/* Content area */
.lampiran-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.lampiran-pagination {
    flex-shrink: 0;
}

/* ---- Compact Table Layout ---- */
.lamp-table-wrap {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--slate-200);
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.lamp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.lamp-table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid var(--slate-200);
}

.lamp-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

@keyframes lampRowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

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

.lamp-row {
    animation: lampRowSlideIn 0.3s ease backwards;
    border-bottom: 1px solid var(--slate-100);
    transition: background 0.15s ease;
}

.lamp-row:last-child {
    border-bottom: none;
}

.lamp-row:hover {
    background: rgba(79, 70, 229, 0.02);
}

.lamp-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

/* File column */
.lamp-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    max-width: 200px;
}

.lamp-file-link:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--primary-dark);
}

.lamp-file-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.lamp-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

/* Task column */
.lamp-task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lamp-task-title {
    font-weight: 600;
    color: var(--slate-700);
    font-size: 0.8rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lamp-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    width: fit-content;
}

/* Staff column */
.lamp-staff-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--slate-700);
}

.lamp-mini-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
    overflow: hidden;
}

.lamp-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Department column */
.lamp-dept-badge {
    display: inline-flex;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--slate-100);
    color: var(--slate-600);
    white-space: nowrap;
}

/* Date column */
.lamp-td-date {
    font-size: 0.75rem;
    color: var(--slate-500);
    font-weight: 500;
    white-space: nowrap;
}

/* Status column */
.lamp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ---- Pagination — Modern ---- */
.lamp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 0 8px;
}

.lamp-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 4px;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    background: white;
    color: var(--slate-600);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
}

.lamp-page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
}

.lamp-page-btn.active {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.lamp-page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lamp-page-dots {
    font-size: 0.75rem;
    color: var(--slate-400);
    padding: 0 4px;
    font-weight: 600;
    letter-spacing: 0.15em;
}

/* ---- Empty State — Animated ---- */
@keyframes lampRingPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.1;
    }
}

.lamp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.lamp-empty-visual {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.lamp-empty-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.2;
    animation: lampRingPulse 3s ease-in-out infinite;
}

.lamp-empty-icon-wrap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.lamp-empty-state h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--slate-700);
    margin-bottom: 6px;
}

.lamp-empty-state p {
    font-size: 0.82rem;
    color: var(--slate-400);
    max-width: 320px;
    line-height: 1.6;
}

/* ---- Loading ---- */
.lampiran-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 12px;
}

.lampiran-loading p {
    font-size: 0.85rem;
    color: var(--slate-400);
    font-weight: 500;
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 768px) {
    .lampiran-filter-group {
        flex-direction: column;
        gap: 10px;
    }

    .lampiran-filter-item {
        min-width: auto;
    }

    .lampiran-filter-actions {
        align-self: stretch;
    }

    .lampiran-filter-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .lamp-table-wrap {
        overflow-x: auto;
    }

    .lamp-table {
        min-width: 700px;
    }

    .lamp-stats-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .lamp-pagination {
        flex-wrap: wrap;
    }
}

/* =====================================================
   FILTER CHIPS & LIST-VIEW FILTERS
===================================================== */

.list-view-filters {
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 6px;
}

.filter-chip {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    background: white;
    border: 1.5px solid var(--slate-200);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-bg);
}

.filter-chip.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

/* =====================================================
   NOTEPAD VIEW — Filter Buttons
===================================================== */

.notepad-view {
    animation: fadeInUp 0.3s var(--ease-smooth);
}

.notepad-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.notepad-filters {
    display: flex;
    gap: 6px;
    padding: 4px 0;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.notepad-filter-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    background: white;
    border: 1.5px solid var(--slate-200);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    white-space: nowrap;
}

.notepad-filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-bg);
}

.notepad-filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.notepad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.notepad-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 12px;
}

.notepad-loading p {
    font-size: 0.85rem;
    color: var(--slate-400);
    font-weight: 500;
}

