body {
    overflow: auto;
    background-color: rgba(248, 247, 247, 1);
    position: relative;
}

/* Animated Background Gradient */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(248, 247, 247, 1) 0%,
            rgba(255, 255, 255, 1) 50%,
            rgba(248, 247, 247, 1) 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #fff;
    box-shadow: 0px 14px 10px rgba(8, 15, 52, 0.06);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 1040;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b7924f, #d4af37);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #b7924f);
}

.sidebar .logo {
    padding: 1rem;
}

.sidebar .logo img {
    max-width: 152px;
    height: auto;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 0.8rem;
}

.sidebar ul li a {
    color: rgba(39, 58, 65, 1);
    text-decoration: none;
    font-size: 16px;
    padding: .7rem;
    position: relative;
}

.sidebar ul li.active a {
    color: #b7924f !important;
    font-weight: bold;
}

.sidebar ul li a:hover {
    color: #b7924f;
}

.sidebar .nav-link.active {
    color: #b7924f;
}

.sidebar .icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease-in-out;
}

.sidebar ul li.active .icon,
.sidebar ul li:hover .icon {
    filter: brightness(0) saturate(100%) invert(64%) sepia(29%) saturate(343%) hue-rotate(8deg) brightness(95%) contrast(90%);
    transform: scale(1.05);
}

.sidebar .nav-item:hover {
    background-color: rgba(249, 248, 244, 1);
    border-radius: 8px;
}

.sidebar .nav-item.active {
    background-color: rgba(249, 248, 244, 1);
    border-radius: 8px;
}

/* Close Button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 2%;
    left: 0;
    font-size: 2rem;
    color: black;
}

/* custom container */

.custom-container {
    padding: 0 20rem 0 0;
}

/* navbar */
.search-bar {
    padding-right: 1rem;
    width: 100%;
}

.search-bar input {
    background-color: rgba(39, 58, 65, 0.05);
    border: none;
    padding: 0.7rem;
}

.search-bar input::placeholder {
    color: rgba(156, 156, 156, 1);
    font-size: 14px;
    padding: 0.5rem;
}

.search-bar input {
    background-color: #f7f7f7;
    border: none;
    padding-right: 2.5rem;
}

.search-bar input:focus {
    box-shadow: none;
    background-color: #f7f7f7;
}

.search-bar i {
    color: rgba(158, 158, 158, 1);
    font-size: 16px;
}

/* Content */
.content {
    margin-right: 270px;
    padding: 1rem 3rem;
    transition: margin-left 0.3s ease-in-out;
}

/* Table */
.user-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

/* Prevent tables from widening the whole page on mobile */
.programmes-table {
    max-width: 100%;
    overflow-x: auto;
}

.programmes-table table {
    width: 100%;
}

.active-status p {
    background-color: rgba(23, 89, 65, 0.2);
    color: rgba(23, 89, 65, 1);
    border-radius: 16px;
    padding: 0.5rem;
}

/* states conatiner */

.stat-card {
    border-radius: 20px;
    text-align: right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 96px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    height: 100%;
}

.stat-card .stat-content {
    min-width: 0;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(183, 146, 79, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.stat-card img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.stat-metric {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.stat-metric h4 {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.stat-change {
    font-size: 14px;
    white-space: nowrap;
    color: rgba(39, 58, 65, 0.8);
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

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

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

.stat-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(183, 146, 79, 0.1),
            transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.stat-card:hover::before {
    animation: shimmer 1.5s infinite;
    opacity: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
}

.stat-card:hover img {
    transform: scale(1.1) rotate(5deg);
}

.stat-card h4 {
    color: rgba(43, 54, 116, 1);
    font-size: 24px;
    transition: color 0.3s ease;
}

.stat-card:hover h4 {
    color: #b7924f;
}

.stat-card p {
    font-size: 16px;
    color: rgba(163, 174, 208, 1);
    transition: color 0.3s ease;
}

.chart-container {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0px 14px 10px rgba(8, 15, 52, 0.06);
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease 0.5s forwards;
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #b7924f, #d4af37, #b7924f);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0px 20px 30px rgba(8, 15, 52, 0.12);
}

.chart-container h5 {
    font-size: 18px;
    margin-bottom: 15px;
    color: rgba(137, 134, 141, 1);
    transition: color 0.3s ease;
}

.chart-container:hover h5 {
    color: rgba(39, 58, 65, 1);
}

.chart-container .total {
    text-align: right;
    font-weight: bold;
    color: rgba(39, 58, 65, 1);
    margin-top: 10px;
    transition: transform 0.3s ease;
}

.chart-container:hover .total {
    transform: scale(1.05);
}

@media (max-width: 767.98px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .programmes-table {
        font-size: 14px;
    }

    .pagination-controls select {
        width: 80px;
    }
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b7924f, #d4af37);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #b7924f);
}

/* Logout button special styling */
.sidebar .nav-item:last-child {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar .nav-item:last-child a {
    color: #dc3545 !important;
}

.sidebar .nav-item:last-child:hover a {
    background: linear-gradient(90deg,
            rgba(220, 53, 69, 0.1) 0%,
            rgba(220, 53, 69, 0.05) 100%);
    color: #dc3545 !important;
}

.sidebar .nav-item:last-child:hover .icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(1352%) hue-rotate(327deg) brightness(92%) contrast(89%);
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0%);
    }

    .sidebar-close {
        display: block;
    }

    .content {
        margin-right: 0 !important;
        padding: 0.5rem;
    }

    .custom-container {
        padding: 0;
    }

    .search-bar {
        width: 100%;
    }

    .stat-card {
        animation-duration: 0.4s;
    }

    .chart-container {
        animation-duration: 0.4s;
    }
}

/* Ensure table cells don't wrap unnecessarily */
.table th,
.table td {
    white-space: nowrap;
}

.table td,
.table th {
    padding: 1.2rem;
}

@media (max-width: 576px) {

    .table th,
    .table td {
        white-space: normal !important;
        word-break: break-word;
        /* min-width: 200px!important; */
    }

    .table td,
    .table th {
        padding: 0.75rem !important;
    }
}

.table th {
    color: rgba(63, 63, 63, 1);
    font-size: 15px;
    min-width: 200px !important;
}

table.table thead tr th {
    color: rgba(63, 63, 63, 1);
    font-size: 15px;
    min-width: 200px !important;
}

.table {
    border-radius: 12px !important;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.7s forwards;
}

.table:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(249, 248, 244, 1);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Search bar animations */
.search-bar {
    position: relative;
}

.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(183, 146, 79, 0.2);
}

/* Notification icon animation */
.notif-icon {
    /* transition: all 0.3s ease; */
    position: relative;
}

#notifDot {
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Content area animations */
.content {
    animation: contentFadeIn 0.8s ease;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

/* Header animations */
h1 {
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDown 0.6s ease 0.3s forwards;
}

/* Modal animations */
.shaj-modal {
    animation: modalFadeIn 0.3s ease;
}

.shaj-modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

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

/* Pagination animations */
.pagination-controls {
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.8s forwards;
}

.pagination-controls button {
    transition: all 0.3s ease;
}

.pagination-controls button:hover {
    transform: scale(1.2);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    width: 300px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-warning::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-warning:hover::before {
    width: 300px;
    height: 300px;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-warning:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Button ripple effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}