/* =====================================================
   ZOOM CONTROLS — Refined
===================================================== */

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
}

.zoom-btn {
    appearance: none;
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--slate-500);
    transition: all 0.2s var(--ease-smooth);
}

.zoom-btn:hover {
    background: var(--slate-100);
    color: var(--slate-700);
}

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

.zoom-preset-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 5px 24px 5px 10px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--slate-600);
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 6px center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* =====================================================
   LOGIN PAGE — Enhanced
===================================================== */

.login-page {
    min-height: 100vh;
    background: var(--gradient-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.login-card {
    background: white;
    padding: 40px 36px;
    border-radius: 24px;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.03);
    width: 100%;
    max-width: 400px;
    border: none;
    animation: fadeInUp 0.5s var(--ease-smooth);
}

.login-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    box-shadow: var(--shadow-primary-lg);
}

.login-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* =====================================================
   MOBILE DRAWER — Enhanced
===================================================== */

@media (max-width: 768px) {
    .drawer-content {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        border-radius: 24px 24px 0 0;
        padding: 20px;
        transform: translateY(100%);
        transition: transform 0.35s var(--ease-smooth);
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    }

    /* Handle bar indicator */
    .drawer-content::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--slate-300);
        border-radius: 2px;
        margin: 0 auto 16px;
    }

    .mobile-bottom-nav {
        background: var(--glass-bg-heavy);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
        border-top: 1px solid rgba(226, 232, 240, 0.6);
    }

    .nav-btn-mobile {
        border-radius: 12px;
        transition: all 0.2s var(--ease-smooth);
    }

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

    .drawer-link {
        border-radius: 12px;
        transition: all 0.15s var(--ease-smooth);
    }

    .drawer-link:active {
        background: var(--primary-bg);
        color: var(--primary);
    }

    .user-card-drawer {
        background: var(--gradient-surface);
        border: 1px solid var(--slate-200);
        border-radius: 14px;
    }
}

/* =====================================================
   GLOBAL ANIMATION UTILITIES
===================================================== */

/* Fade In Up - for view transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* Animate In - for staggered list items */
@keyframes animateIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.animate-in {
    animation: animateIn 0.3s var(--ease-smooth) both;
}

/* View Enter/Exit transitions */
.view-enter {
    animation: fadeInUp 0.25s var(--ease-smooth) both;
}

.view-exit {
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.15s var(--ease-smooth);
}

/* Scroll-triggered visibility */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Button pressed state (JS driven) */
.pressed {
    transform: scale(0.96) !important;
    transition: transform 0.1s var(--ease-smooth) !important;
}

/* Modal active states for JS transition */
.modal.modal-entering {
    animation: modalIn 0.3s var(--ease-spring) both;
}

.modal-overlay.overlay-entering {
    animation: overlayFadeIn 0.25s var(--ease-smooth) both;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay.overlay-exiting {
    animation: overlayFadeOut 0.2s var(--ease-smooth) both;
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Spinner — Modern */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 0 var(--radius-xl);
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Skeleton Shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Note Visibility Toggle */
.note-visibility-toggle {
    display: flex;
    gap: 4px;
    background: var(--slate-100);
    padding: 4px;
    border-radius: 12px;
}

.vis-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.vis-btn.active {
    background: white;
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    font-weight: 700;
}

.vis-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
    color: var(--slate-700);
}

/* Note Department Grid */
.note-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 8px 0;
}

.note-dept-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.note-dept-check:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.note-dept-check:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

/* Note Detail Body */
.note-detail-body {
    padding: 20px 24px;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--slate-700);
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

/* Date Filter Dropdown */
.date-filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--slate-200);
    overflow: hidden;
    z-index: 1000;
    display: flex;
    min-width: 500px;
    animation: dropdownIn 0.2s var(--ease-smooth);
}

.filter-sidebar {
    width: 160px;
    padding: 12px;
    background: var(--slate-50);
    border-right: 1px solid var(--slate-200);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preset-btn {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--slate-600);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s var(--ease-smooth);
}

.preset-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.preset-btn.active {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
}

.filter-custom {
    flex: 1;
    padding: 16px;
}

.custom-header {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.selected-range-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--slate-50);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--slate-200);
}

.range-item label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--slate-400);
    text-transform: uppercase;
}

.range-item span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-700);
}

.range-arrow {
    color: var(--slate-400);
    font-size: 1.1rem;
}

.filter-actions-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

/* Avatar Upload Preview */
.avatar-upload-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s var(--ease-smooth);
}

.avatar-upload-preview:hover {
    transform: scale(1.05);
}

.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;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 0.7rem;
    gap: 4px;
}

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

.avatar-overlay svg {
    width: 20px;
    height: 20px;
}

/* Avatar Circle drawer */
.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

/* =====================================================
   TASK DETAIL MODAL — Modern Design
===================================================== */

.td-header {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--slate-100);
    margin-bottom: 20px;
}

.td-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.td-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Category variants */
.td-category.Jobdesk {
    background: #eef2ff;
    color: #4f46e5;
}

.td-category.Tugas-Tambahan {
    background: #fffbeb;
    color: #b45309;
}

.td-category.Inisiatif {
    background: #ecfdf5;
    color: #047857;
}

.td-category.Request {
    background: #fff1f2;
    color: #be123c;
}

.td-routine {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.td-status-wrapper {
    margin-left: auto;
    position: relative;
}

.td-status-dropdown {
    position: relative;
}

.td-status-trigger {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 10px;
    border: 1.5px solid;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    font-family: inherit;
    outline: none;
    white-space: nowrap;
}

.td-status-trigger:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.td-status-trigger svg {
    transition: transform 0.2s var(--ease-smooth);
}

.td-status-dropdown.open .td-status-trigger svg {
    transform: rotate(180deg);
}

.td-status-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.03);
    padding: 6px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transition: all 0.2s var(--ease-smooth);
}

.td-status-dropdown.open .td-status-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.td-status-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease-smooth);
}

.td-status-option:hover {
    background: var(--slate-50);
}

.td-status-option.active {
    background: var(--slate-100);
    font-weight: 700;
}

.td-status-option span {
    color: inherit;
}

.td-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--slate-800);
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.td-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.td-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--slate-500);
    font-weight: 500;
}

.td-meta-item svg {
    color: var(--slate-400);
}

.td-request-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 0.78rem;
    color: #92400e;
    font-weight: 600;
}

.td-request-badge svg {
    color: #d97706;
}

/* Section containers */
.td-section {
    margin-bottom: 20px;
}

.td-section>h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.td-section>h4 svg {
    color: var(--slate-400);
}

.td-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.td-section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-700);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.td-section-header h4 svg {
    color: var(--slate-400);
}

.td-progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 2px 10px;
    border-radius: 20px;
}

/* Progress bar */
.td-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--slate-100);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.td-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s var(--ease-smooth);
}

/* Checklist */
.td-checklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.td-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    border: 1.5px solid transparent;
}

.td-check-item:hover:not(.td-disabled) {
    background: var(--slate-50);
    border-color: var(--slate-200);
}

.td-check-item.checked {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.td-check-item.td-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.td-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid var(--slate-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s var(--ease-smooth);
    background: white;
}

.td-checkbox.checked {
    background: var(--gradient-success);
    border-color: #10b981;
    color: white;
}

.td-check-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--slate-700);
    line-height: 1.4;
}

.td-check-item.checked .td-check-text {
    text-decoration: line-through;
    color: var(--slate-400);
}

.td-check-time {
    font-size: 0.68rem;
    color: var(--slate-400);
    font-weight: 500;
    white-space: nowrap;
}

/* Attachments */
.td-attachments {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.td-att-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-att-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--slate-50);
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s var(--ease-smooth);
    flex: 1;
    min-width: 0;
}

.td-att-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-att-link:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
}

.td-att-delete {
    appearance: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--slate-100);
    border-radius: 8px;
    color: var(--slate-400);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    flex-shrink: 0;
}

.td-att-delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

.td-att-add {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1.5px dashed var(--slate-300);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    margin-top: 4px;
}

.td-att-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

/* Comments */
.td-comments {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.td-comment {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.td-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.td-comment-body {
    flex: 1;
    background: var(--slate-50);
    border-radius: 0 12px 12px 12px;
    padding: 10px 14px;
    min-width: 0;
}

.td-comment-name {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: 2px;
}

.td-comment-text {
    font-size: 0.82rem;
    color: var(--slate-600);
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
}

/* Comment input */
.td-comment-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.td-comment-field {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid var(--slate-200);
    border-radius: 24px;
    font-size: 0.82rem;
    color: var(--slate-800);
    background: var(--slate-50);
    transition: all 0.25s var(--ease-smooth);
    font-family: inherit;
    outline: none;
}

.td-comment-field::placeholder {
    color: var(--slate-400);
}

.td-comment-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: white;
}

.td-comment-send {
    appearance: none;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    flex-shrink: 0;
    box-shadow: var(--shadow-primary);
}

.td-comment-send:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-primary-lg);
}

.td-comment-send:active {
    transform: scale(0.95);
}

/* Actions footer */
.td-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =====================================================
   DATE INPUT — Modern Styling
===================================================== */

input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    padding: 9px 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-700);
    background: white;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    font-family: 'Inter', sans-serif;
    outline: none;
}

input[type="date"]:hover {
    border-color: var(--slate-300);
}

input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    padding: 9px 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-700);
    background: white;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    font-family: 'Inter', sans-serif;
    outline: none;
}

input[type="time"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* =====================================================
   LOADING SCREEN — Modern
===================================================== */

.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--gradient-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-screen p {
    font-size: 0.88rem;
    color: var(--slate-500);
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* =====================================================
   LOGIN CARD — Title Styling
===================================================== */

.login-card h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--slate-800);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--slate-500);
    margin-bottom: var(--space-6);
    font-weight: 500;
}

/* =====================================================
   MODERNIZATION — Replacement for Inline Styles
===================================================== */

/* --- Modal Header Variants --- */
.modal-header-warning {
    background: #fffbeb;
    border-bottom: 1px solid #fcd34d;
}

.modal-header-warning h3 {
    color: #b45309;
}

.modal-header-primary {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-bottom: 1px solid #c7d2fe;
}

.modal-header-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-bottom: 1px solid #bbf7d0;
}

.modal-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.modal-header-icon.bg-primary {
    background: var(--primary);
}

.modal-header-icon.bg-success {
    background: var(--success);
}

.modal-header-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-group h3 {
    color: var(--slate-800);
    font-size: 1rem;
    font-weight: 700;
}

.modal-header-group p {
    font-size: 0.7rem;
    color: var(--slate-500);
    margin-top: -2px;
}

/* --- Action Buttons: Amber & Indigo Light --- */
.btn-amber-light {
    color: #d97706;
    background: #fffbeb;
    border: none;
    transition: all 0.25s var(--ease-smooth);
}

.btn-amber-light:hover {
    background: #fef3c7;
    box-shadow: 0 4px 12px -4px rgba(217, 119, 6, 0.25);
    transform: translateY(-1px);
}

.btn-indigo-light {
    color: #6366f1;
    background: #eef2ff;
    border: none;
    margin-right: 8px;
    transition: all 0.25s var(--ease-smooth);
}

.btn-indigo-light:hover {
    background: #e0e7ff;
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

/* --- Checkbox Card (Wajib Lampiran) --- */
.checkbox-card-danger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff1f2 0%, #fce7f3 100%);
    border: 1px solid #fecdd3;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.checkbox-card-danger:hover {
    background: linear-gradient(135deg, #ffe4e6 0%, #fbcfe8 100%);
    box-shadow: 0 4px 12px -4px rgba(225, 29, 72, 0.15);
}

.checkbox-card-danger input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e11d48;
    cursor: pointer;
}

.checkbox-card-danger span {
    font-weight: 600;
    color: #be123c;
    font-size: 0.85rem;
}

/* --- Mentions Container & Chips --- */
.mentions-input-container {
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 12px;
    background: var(--slate-50);
    min-height: 40px;
    transition: border-color 0.2s var(--ease-smooth);
}

.mentions-input-container:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.mentions-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.mentions-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: border-color 0.2s var(--ease-smooth);
}

.mentions-select:focus {
    outline: none;
    border-color: var(--primary);
}

.mention-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.mention-label svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.mention-label .hint {
    font-size: 0.75rem;
    color: var(--slate-500);
    font-weight: 400;
}

.mention-hint {
    font-size: 0.75rem;
    color: var(--slate-500);
    margin-top: 6px;
}

.mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    animation: chipIn 0.2s var(--ease-spring);
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

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

.mention-chip-close {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 10px;
    color: white;
    transition: background 0.15s ease;
}

.mention-chip-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* --- Confirm Modal --- */
.icon-danger-bg {
    background: #fee2e2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
}

.confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.confirm-msg {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions .btn {
    flex: 1;
}

.confirm-body {
    padding: 24px;
    text-align: center;
}

/* --- Notification Blocker Overlay --- */
.overlay-heavy {
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
}

.modal-prompt-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
}

.modal-prompt-card .prompt-icon {
    width: 60px;
    height: 60px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-prompt-card .prompt-icon svg {
    width: 32px;
    height: 32px;
}

.modal-prompt-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.modal-prompt-card p {
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-prompt-card .btn-block {
    width: 100%;
    justify-content: center;
}

.notif-denied-text {
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* --- Announcement Info Box --- */
.alert-info-amber {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    display: flex;
    gap: 8px;
    align-items: start;
}

.alert-info-amber svg {
    width: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* --- Broadcast Button --- */
.btn-broadcast {
    background: #f59e0b;
    color: white;
    border: none;
    transition: all 0.25s var(--ease-smooth);
}

.btn-broadcast:hover {
    background: #d97706;
    box-shadow: 0 4px 12px -4px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* --- User Form Avatar Section --- */
.user-avatar-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.user-avatar-section img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
}

.user-avatar-section .hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* --- Note Modal Body (no padding, scrollable) --- */
.modal-body-flush {
    padding: 0;
    max-height: 65vh;
    overflow-y: auto;
}

/* --- Note Save Button --- */
.btn-note-save {
    padding: 14px;
    font-size: 0.95rem;
    margin-top: 12px;
}

/* --- Mini Timeline Scroll --- */
.mini-timeline-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.confirm-modal-size {
    max-width: 320px;
}

/* =====================================================
   MODERN DATE PICKER
===================================================== */

.date-picker-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--slate-200);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.25s var(--ease-smooth);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.date-picker-wrapper:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.date-picker-wrapper:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-sm);
}

.date-picker-wrapper>svg:first-child {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.date-picker-wrapper:hover>svg:first-child {
    color: var(--primary-dark);
}

.date-picker-wrapper>#selected-date-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-700);
    white-space: nowrap;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.date-picker-wrapper:hover>#selected-date-label {
    color: var(--primary-dark);
}

.date-picker-chevron {
    width: 14px;
    height: 14px;
    color: var(--slate-400);
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-smooth), color 0.2s ease;
}

.date-picker-wrapper:hover .date-picker-chevron {
    color: var(--primary);
    transform: translateY(1px);
}

/* Hide native date input visually but keep it functional */
.date-picker-wrapper input[type="date"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    z-index: 1;
}

/* Ensure the calendar popup works on all browsers */
.date-picker-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
/* =====================================================
 * UI/UX AUDIT OVERRIDES — Accessibility, Responsiveness,
 * Interaction, Polish. Appended at the end so cascade
 * naturally overrides earlier rules. Grouped by finding.
 * See UIUX_REPORT.md for rationale.
 * ===================================================== */

/* ----- Finding #1: :focus-visible for all interactive elements ----- */
.icon-btn:focus-visible,
.btn:focus-visible,
.modal-close:focus-visible,
.zoom-btn:focus-visible,
.toggle-btn:focus-visible,
.app-view-btn:focus-visible,
.filter-chip:focus-visible,
.preset-btn:focus-visible,
.drawer-link:focus-visible,
.nav-btn-mobile:focus-visible,
.text-btn:focus-visible {
    outline: 2px solid var(--primary, #4f46e5);
    outline-offset: 2px;
    border-radius: 8px;
}
a:focus-visible {
    outline: 2px solid var(--primary, #4f46e5);
    outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary, #4f46e5);
    outline-offset: 1px;
}

/* ----- Finding #2: .text-muted contrast bumped to WCAG AA ----- */
.text-muted {
    color: var(--slate-600) !important; /* #475569 ~7.2:1 on white */
}

/* ----- Finding #5: icon-btn min 44x44 touch target (all viewports) ----- */
.icon-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
}

/* ----- Finding #6: intermediate tablet breakpoint ----- */
@media (min-width: 769px) and (max-width: 1024px) {
    .task-card { width: 220px; }
    .timeline-grid { gap: 8px; }
}

/* ----- Finding #7: task-card responsive width on small screens ----- */
@media (max-width: 480px) {
    .task-card {
        width: clamp(200px, 82vw, 256px);
    }
}
@media (max-width: 360px) {
    .task-card {
        width: calc(100vw - 48px);
    }
}

/* ----- Finding #8: Button loading state — real spinner ----- */
.btn.loading::after {
    /* Override earlier rule: center the spinner */
    top: 50%;
    left: 50%;
    margin-top: -7px;
    margin-left: -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-top-color: currentColor;
}

/* ----- Finding #9: :disabled visual state for form elements ----- */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: saturate(0.7);
}
input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--slate-100, #f1f5f9);
    color: var(--slate-500, #64748b);
}

/* ----- Finding #13: toast container responsive on tablet/mobile ----- */
@media (max-width: 768px) {
    .toast-container {
        top: 64px;
        left: 12px;
        right: 12px;
    }
    .toast {
        min-width: 0;
        max-width: 100%;
    }
}

/* ----- Finding #14: scroll-lock body when modal open ----- */
body.modal-open {
    overflow: hidden;
    touch-action: none;
}

/* ----- Finding #15: overlay click-to-close hint ----- */
.modal-overlay {
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

/* ----- Finding #16: focus-visible on custom toggle components ----- */
.day-btn:focus-visible,
.vis-btn:focus-visible,
.dept-chip input:focus-visible + .dept-chip-inner,
.checkbox-label input[type="checkbox"]:focus-visible + span,
.note-dept-cb:focus-visible + .dept-chip-inner {
    outline: 2px solid var(--primary, #4f46e5);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ----- Finding #18: safe-area padding-bottom for mobile bottom-nav ----- */
@media (max-width: 768px) {
    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* ----- Finding #19: hover state guarded by pointer capability ----- */
@media (hover: none) {
    .task-card:hover,
    .icon-btn:hover,
    .btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}
.task-card:active { transform: translateY(0); }

/* ----- Finding #20: stack form-row on small mobile ----- */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ----- Empty state helper (used by JS — Finding #12) ----- */
.empty-state-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--slate-600, #475569);
    text-align: center;
    font-size: 0.875rem;
}
.empty-state-panel svg {
    width: 32px;
    height: 32px;
    color: var(--slate-400, #94a3b8);
}

/* ----- Visually-hidden helper for Finding #11 (screen-reader-only text) ----- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
