/* Dashboard Main Wrapper */
#dashboard-content {
    padding: 25px;
    color: #1e293b;
    min-height: 100%;    /* It will now only take up the remaining space of the parent */
    display: block;
    box-sizing: border-box;
}

/* Ensure the top header of the dashboard has its own margin */
.dashboard-head {
    margin-bottom: 25px;
    display: block;
}

/* Topbar Typography */
.dashboard-head h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
}
.dashboard-head p { color: #64748b; }

.actions {
    display: flex;       /* The magic wand for rows */
    flex-direction: row; /* Force them to stay side-by-side */
    align-items: center; /* Vertical center alignment */
    gap: 12px;           /* Space between the select, input, and button */
    flex-wrap: wrap;     /* Allows it to stack nicely on small mobile screens */
}

/* Ensure the div around the input doesn't break the layout */
.actions div {
    display: inline-block;
}

/* Filter Actions */
.actions input, .actions select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.actions input:focus {
    outline: none;
    border-color: #3b82f6; /* Blue highlight */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* KPI Grid - Clean Cards */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.kpi span {
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.kpi h2 { font-size: 32px; font-weight: 800; margin: 8px 0; color: #1e293b; }

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from {
        bottom: -10px;
        opacity: 0.5;
    }
    to {
        bottom: 0;
        opacity: 1;
    }
}
.kpi > small {
    position: relative;
    animation: slideUp 380ms ease-in forwards;
}

#performanceRadar{
    animation: fadeIn 380ms ease-in forwards;
}

/* Color Highlights for KPIs */
/* .kpi { border-top: 2px solid #00588f;} */
.kpi:nth-child(3) { grid-row: span 2; }


/* Update .grid to handle row heights better */
.grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: minmax(350px, auto); /* Gives cards a baseline height */
    gap: 20px;
    margin-bottom: 30px;
}

/* Update the card to allow charts to fill the space better */
.card {
    background: #ffffff;
    padding: 20px; /* Reduced from 24px */
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 350px; /* Ensure a consistent minimum height */
    max-height: 400px;
}

/* Let the container grow into the available card space */
.card > div[style*="position: relative"] {
    flex-grow: 1;
    width: 100%;
    margin-top: 10px; /* Space between title and chart */
}

/* Remove the strict max-height that was squashing them */
.card canvas {
    display: block;
    width: 100% !important;
    height: 100%;
}

.card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #334155;
}

.chart-container {
    position: relative;
    flex: 1;
    min-height: 250px;
}

/* Table Design */
.table-card th {
    text-align: left;
    padding: 14px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.table-card td {
    padding: 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 0.9rem;
}

/*Student Initials Default */
.initials{
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;"
}

/* Status Labels */
.status-labels {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.distinction {
    background-color: #dcfce7;
    color: #15803d;
}
.pass {
    background-color: #dcfce7;
    color: #50c10d;
}
.poor{
    background-color: #fee2e2;
    color: #f3bc00;
}
.fail {
    background-color: #fee2e2;;
    color: #b91c1c;
}

/* Activity Icons */
.activity li i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f5f9;
}

/* Restoring the Bottom Layout */
.bottom {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Table gets more space than Activity */
    gap: 20px;
    align-items: start; /* Prevents small cards from stretching to match tall ones */
}

/* Specific override for the Table Card - it shouldn't have a fixed height if data is short */
.table-card.card {
    min-height: auto;
    padding: 0; /* Remove padding so header/table looks integrated */
}

.table-card h3 {
    padding: 24px 24px 10px 24px;
}

/* Activity Feed Overhaul */
.activity.card {
    min-height: auto; /* Let content dictate height */
}

.activity ul {
    list-style: none;
    padding: 0;
}

.activity li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 0.9rem;
}

.activity li:last-child {
    border-bottom: none;
}

/* Table */
.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.table-card td {
    padding: 16px 24px;
}