/* =============================================
   ADMIN DASHBOARD — #347deb theme
   ============================================= */

/* ---------- Keyframes ---------- */
@keyframes dashFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes dashCountUp {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes dashShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes dashPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 125, 235, 0.25); }
    50%       { box-shadow: 0 0 0 6px rgba(52, 125, 235, 0); }
}

/* ---------- Page Header ---------- */
.container-fluid > .row.mb-4 {
    animation: dashFadeUp 0.4s ease both;
}

.container-fluid > .row.mb-4 h1 {
    font-weight: 700;
    color: #1a3f80;
    letter-spacing: -0.5px;
}

.container-fluid > .row.mb-4 .text-muted {
    color: #6b84b0 !important;
    font-size: 0.95rem;
}

/* ---------- Stat Cards ---------- */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(52, 125, 235, 0.10);
    box-shadow: 0 2px 16px rgba(52, 125, 235, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    animation: dashFadeUp 0.45s ease both;
}

.col-md-3:nth-child(1) .stat-card { animation-delay: 0.05s; }
.col-md-3:nth-child(2) .stat-card { animation-delay: 0.10s; }
.col-md-3:nth-child(3) .stat-card { animation-delay: 0.15s; }
.col-md-3:nth-child(4) .stat-card { animation-delay: 0.20s; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(52, 125, 235, 0.16);
}

/* Accent stripe at top */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1a3f80, #347deb, #60aaff);
    background-size: 200% auto;
    animation: dashShimmer 3s linear infinite;
    border-radius: 16px 16px 0 0;
}

/* Decorative circle */
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -28px; right: -28px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(52, 125, 235, 0.07);
    pointer-events: none;
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(52, 125, 235, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    transition: background 0.2s, transform 0.2s;
}

.stat-card:hover .stat-icon {
    background: rgba(52, 125, 235, 0.18);
    transform: scale(1.08);
}

.stat-icon i {
    font-size: 1.4rem;
    color: #347deb;
}

/* Overdue tasks card — red accent */
.col-md-3:nth-child(4) .stat-card::before {
    background: linear-gradient(90deg, #991f1f, #e24b4a, #f09595);
}

.col-md-3:nth-child(4) .stat-icon {
    background: rgba(226, 75, 74, 0.10);
}

.col-md-3:nth-child(4) .stat-icon i {
    color: #e24b4a;
}

.col-md-3:nth-child(4) .stat-card:hover {
    box-shadow: 0 8px 32px rgba(226, 75, 74, 0.14);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a3f80;
    line-height: 1;
    letter-spacing: -0.5px;
    animation: dashCountUp 0.5s ease both;
}

.col-md-3:nth-child(4) .stat-value {
    color: #e24b4a;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b84b0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ---------- Section Cards ---------- */
.row.mt-4 .card {
    border: 1px solid rgba(52, 125, 235, 0.10);
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(52, 125, 235, 0.07);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
    animation: dashFadeUp 0.45s 0.25s ease both;
}

.row.mt-4 .card:hover {
    box-shadow: 0 6px 28px rgba(52, 125, 235, 0.13);
}

/* Card header */
.card-header.bg-white {
    background: #fff !important;
    border-bottom: 1px solid rgba(52, 125, 235, 0.10) !important;
    padding: 1rem 1.25rem;
    position: relative;
}

/* Subtle left accent on card header */
.card-header.bg-white::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: linear-gradient(to bottom, #1a3f80, #347deb);
    border-radius: 0 2px 2px 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a3f80;
    margin: 0;
}

/* ---------- User Management Table ---------- */
.table {
    margin-bottom: 0;
}

.table thead tr {
    background: linear-gradient(90deg, #1a3f80, #2360c8, #347deb);
}

.table thead th {
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 0.85rem 1rem;
}

.table tbody tr {
    transition: background 0.15s, transform 0.15s;
    border-bottom: 1px solid rgba(52, 125, 235, 0.06);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(52, 125, 235, 0.05);
    transform: scale(1.005);
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.88rem;
    color: #2d3a55;
    border: none;
}

/* Badges in table */
.badge.bg-success {
    background: #d4f4e3 !important;
    color: #0d6832 !important;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 20px;
}

.badge.bg-danger {
    background: #991f1f !important;
    color: #FFFFFF !important;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 20px;
}

/* ---------- Recent Projects List ---------- */
.list-group-flush {
    border-radius: 0;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(52, 125, 235, 0.07);
    padding: 1rem 1.25rem;
    transition: background 0.15s, border-left 0.2s;
    color: #2d3a55;
    position: relative;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: rgba(52, 125, 235, 0.05);
    color: #1a3f80;
    border-left: 3px solid #347deb;
    padding-left: calc(1.25rem - 3px);
    text-decoration: none;
}

.list-group-item h6 {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a3f80;
    margin-bottom: 0.25rem;
}

.list-group-item-action:hover h6 {
    color: #347deb;
}

.list-group-item p {
    font-size: 0.83rem;
    color: #6b84b0;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-group-item small.text-muted {
    font-size: 0.75rem;
    color: #96aac8 !important;
}

/* Project status inline badge */
.list-group-item small .badge,
.list-group-item small {
    font-size: 0.75rem;
}

/* ---------- Recent Tasks (full-width) ---------- */
.row.mt-4 .col-12 .card {
    animation-delay: 0.35s;
}

/* Priority / Status inline text */
.list-group-item small .text-primary {
    color: #347deb !important;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 768px) {
    .stat-card {
        padding: 1.1rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    /* Hide the thead on mobile — labels come from data-label */
    .table thead {
        display: none;
    }

    /* Each row becomes its own card */
    .table tbody tr {
        display: block;
        border: 1px solid rgba(52, 125, 235, 0.10);
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 0.25rem 0;
        transform: none !important; /* disable row hover scale on mobile */
        box-shadow: 0 1px 8px rgba(52, 125, 235, 0.06);
    }

    /* Each cell becomes a flex row: label on left, value on right */
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.6rem 1rem;
        border-bottom: 1px solid rgba(52, 125, 235, 0.06);
        font-size: 0.88rem;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }

    /* Label injected from data-label attribute */
    .table tbody td::before {
        content: attr(data-label);
        float: none;
        font-weight: 600;
        color: #6b84b0;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        text-align: left;
        flex-shrink: 0;
        margin-right: 1rem;
    }
}