/* ================================================
   Numpad keyboard-active flash (triggered by JS)
   ================================================ */
.numpad-btn.numpad-key-active {
    transform: scale(0.91);
    background: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    transition: background 0.05s, transform 0.05s;
}

.numpad-btn-ghost.numpad-key-active {
    background: #e0e0e0;
    color: var(--dark-grey-color);
    transform: scale(0.91);
}

/* ================================================
   File drop zone: drag-over body guard
   Prevents cursor flicker when dragging over child elements
   ================================================ */
.file-input-wrap.dragging * {
    pointer-events: none;
}

/* ================================================
   Keyboard hint inside PIN modals
   ================================================ */
.pin-keyboard-hint {
    text-align: center;
    font-size: 0.76rem;
    color: #bbb;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

/* ================================================
   Nav Icon Button
   ================================================ */
.btn-icon-nav {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-icon-nav:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.notification-bell-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    border: 2px solid var(--white-color);
}

/* ================================================
   Notification Drawer
   ================================================ */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1900;
    pointer-events: none;
    transition: background 0.3s ease;
}

.notif-overlay.open {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(400px, 100vw);
    height: 100dvh;
    background: var(--white-color);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.notif-drawer.open {
    transform: translateX(0);
}

.notif-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.notif-drawer-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notif-drawer-head-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-text-action {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Prompt', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 5px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-text-action:hover {
    background: var(--primary-light);
}

.btn-text-danger {
    color: var(--danger);
}

.btn-text-danger:hover {
    background: #fff0f0;
    color: var(--danger);
}

.notif-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notif-drawer-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 42px;
}

.notif-state-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 3rem 1.5rem;
    color: #bbb;
    font-size: 0.92rem;
    text-align: center;
}

.notif-state-wrap i {
    font-size: 2.2rem;
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 10px;
    cursor: default;
    transition: background 0.15s;
    position: relative;
}

.notif-item:hover {
    background: #f7f9f8;
}

.notif-item.unread {
    background: #f0f8f5;
}

.notif-item.unread:hover {
    background: #e6f4ef;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-top: 6px;
    transition: opacity 0.2s;
}

.notif-item.read .notif-item-dot {
    opacity: 0;
}

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

.notif-item-message {
    font-size: 0.88rem;
    color: var(--dark-grey-color);
    line-height: 1.55;
    word-break: break-word;
}

.notif-item.read .notif-item-message {
    color: #888;
}

.notif-item-time {
    font-size: 0.74rem;
    color: #bbb;
    margin-top: 3px;
}

.notif-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.notif-item:hover .notif-item-actions {
    opacity: 1;
}

.notif-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #bbb;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.15s, color 0.15s;
}

.notif-action-btn:hover {
    background: #eee;
    color: var(--dark-grey-color);
}

.notif-action-btn.dismiss:hover {
    background: #fff0f0;
    color: var(--danger);
}

/* ================================================
   Animation Keyframes
   ================================================ */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pop-in {
    0%   { opacity: 0; transform: scale(0.85); }
    70%  { transform: scale(1.04); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes badge-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    65%  { transform: scale(1.25); }
    100% { transform: scale(1);   opacity: 1; }
}

@keyframes progress-fill {
    from { width: 0%; }
}

@keyframes spin-once {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes status-pill-appear {
    from {
        opacity: 0;
        transform: scale(0.8) translateX(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes drawer-item-in {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================================
   Section Transitions
   Applied when showOnlySection() reveals a section
   ================================================ */
#approval-auth-section,
#approval-dashboard-section,
#approval-queue-section {
    animation: none;
}

#approval-auth-section:not(.hidden) {
    animation: fade-in-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#approval-dashboard-section:not(.hidden) {
    animation: fade-in-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#approval-queue-section:not(.hidden) {
    animation: slide-in-right 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Back-navigation gets slide-in-left feel */
#approval-dashboard-section.nav-back:not(.hidden) {
    animation: slide-in-left 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Main Card Entrance
   Stagger children inside a section
   ================================================ */
#approval-dashboard-section:not(.hidden) .main-card:nth-child(1) {
    animation: fade-in-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

#approval-dashboard-section:not(.hidden) .main-card:nth-child(2) {
    animation: fade-in-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.13s both;
}

#approval-auth-section:not(.hidden) .main-card {
    animation: scale-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

/* ================================================
   Ticket / Queue Cards
   ================================================ */

/* Dashboard ticket cards stagger in */
.ticket-card {
    transition:
        box-shadow 0.22s ease,
        transform  0.22s ease,
        border-color 0.22s ease;
}

.schedule-list-gap .ticket-card:nth-child(1) {
    animation: fade-in-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.schedule-list-gap .ticket-card:nth-child(2) {
    animation: fade-in-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both;
}

.schedule-list-gap .ticket-card:nth-child(3) {
    animation: fade-in-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

/* Queue card entrance - applied by JS with inline delay */
.queue-card-animate {
    animation: fade-in-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Queue card hover lift */
.queue-card {
    transition:
        box-shadow   0.2s ease,
        transform    0.2s ease,
        border-color 0.2s ease;
}

.queue-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

/* Review button pulse on hover */
.queue-review-btn {
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.queue-review-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.queue-review-btn:active {
    transform: scale(0.97);
}

/* ================================================
   Count Badge Pop Animation
   Triggered when badge text updates
   ================================================ */
.approval-count-badge.badge-updated {
    animation: badge-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Status pill appearance */
.status-pill {
    animation: status-pill-appear 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Section Back Row
   ================================================ */
.section-back-row {
    animation: fade-in-down 0.3s ease 0.05s both;
}

/* ================================================
   Modal Animations
   ================================================ */

/* Overlay */
.modal.show {
    animation: fade-in 0.25s ease both;
}

/* Modal card scale + slide up */
.modal.show .modal-card,
.modal.show .modal-card-lg,
.modal.show .modal-card-review {
    animation: pop-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Review modal — larger card uses gentler scale */
.modal.show .modal-card-review {
    animation: scale-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Modal sections stagger in */
.modal.show .modal-section:nth-child(1) {
    animation: fade-in-up 0.3s ease 0.08s both;
}

.modal.show .modal-section:nth-child(2) {
    animation: fade-in-up 0.3s ease 0.14s both;
}

.modal.show .modal-section:nth-child(3) {
    animation: fade-in-up 0.3s ease 0.2s both;
}

.modal.show .modal-actions {
    animation: fade-in-up 0.3s ease 0.22s both;
}

/* Review layout panels stagger */
.modal.show .review-preview-panel {
    animation: slide-in-left  0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.modal.show .review-detail-panel {
    animation: slide-in-right 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* ================================================
   Notification Drawer Items
   Applied per-item in JS with inline delay
   ================================================ */
.notif-item-animate {
    animation: drawer-item-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Approver Info Badge
   ================================================ */
.approver-info-badge:not(.hidden) {
    animation: pop-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ================================================
   Passcode Dots - Fill Animation
   ================================================ */
.passcode-dot.filled {
    animation: pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ================================================
   Refresh Button - Spin Icon on Click
   ================================================ */
.refresh-spinning .fa-rotate {
    animation: spin-once 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ================================================
   User Info Card - Avatar entrance
   ================================================ */
.user-avatar {
    transition: transform 0.3s ease;
}

.user-info-card:hover .user-avatar {
    transform: scale(1.08) rotate(-4deg);
}

/* ================================================
   Skeleton Fade-in on Content Replace
   ================================================ */
.skeleton-fade-in {
    animation: fade-in-up 0.3s ease both;
}

/* ================================================
   Status Message Appear
   ================================================ */
.status-message:not(:empty) {
    animation: fade-in-down 0.22s ease both;
}

/* ================================================
   Empty State Entrance
   ================================================ */
.empty-state:not(.hidden) {
    animation: scale-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.empty-state .empty-icon {
    animation: fade-in-up 0.35s ease 0.1s both;
}

.empty-state h3 {
    animation: fade-in-up 0.35s ease 0.18s both;
}

.empty-state p {
    animation: fade-in-up 0.35s ease 0.24s both;
}

/* ================================================
   Reduced Motion — respect user preference
   ================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration:        0.01ms !important;
        animation-iteration-count: 1      !important;
        transition-duration:       0.01ms !important;
    }
}