/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1;
}

.modal-content {
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ===== Toast ===== */
.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
                0 4px 6px -4px rgba(0, 0, 0, 0.2);
    animation: toast-in 0.3s ease forwards;
    border: 1px solid;
}

.toast.toast-success {
    background-color: rgba(22, 101, 52, 0.9);
    border-color: #166534;
    color: #bbf7d0;
}

.toast.toast-error {
    background-color: rgba(153, 27, 27, 0.9);
    border-color: #991b1b;
    color: #fecaca;
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ===== Table ===== */
table tbody tr {
    transition: background-color 0.15s ease;
}

/* ===== Toggle Switch ===== */
.peer:checked ~ div {
    background-color: #2563eb;
}

/* ===== Selection ===== */
::selection {
    background-color: rgba(59, 130, 246, 0.4);
    color: white;
}

/* ===== Focus ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ===== Date/Time input icon color fix for dark theme ===== */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}
