/* --- INSTITUTIONAL DASHBOARD (Global Theme Integrated) --- */

.ins-section {
    position: relative;
    padding: var(--space-7) var(--space-4);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    overflow: hidden;
}

.ins-container {
    max-width: 900px; /* Adjusted slightly wider for modern feel */
    margin: 0 auto; 
    position: relative; 
    z-index: 2;
}

/* --- AMBIENT BACKDROP --- */
.ins-backdrop {
    position: absolute;
    inset: 0;
    /* Uses Brand color for the subtle glow effect */
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 60%);
    filter: blur(80px);
    pointer-events: none;
}


/* --- HEADER --- */
.ins-header {
    text-align: center; 
    margin-bottom: var(--space-5);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px;
}

.ins-meta-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 8px; border-radius: 100px;
    /* Uses Elev-1 mix for background, Stroke for border */
    background: color-mix(in srgb, var(--elev-1) 30%, transparent); 
    border: 1px solid var(--stroke);
    font-size: 0.7rem; font-weight: 600; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 0.04em;
    backdrop-filter: blur(10px);
}
.ins-icon-shield { 
    color: var(--brand); 
    display: flex; 
    width: 12px; 
}

.ins-header h2 {
    font-size: var(--size-5); 
    font-weight: 700; 
    margin: 0; 
    letter-spacing: -0.03em;
}
.ins-gradient-text {
    /* Updated gradient to use global text colors */
    background: linear-gradient(180deg, var(--text), var(--text-muted));
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

/* --- BENTO DASHBOARD --- */
.ins-dashboard {
    display: grid;
    /* Tighter gaps for the Bento effect */
    grid-template-columns: repeat(3, 1fr);
    gap: 16px; 
}

/* --- CARD SYSTEM --- */
.ins-card {
    background: color-mix(in srgb, var(--elev-2) 40%, transparent);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-m);
    /* Simplified shadow to use global variable */
    box-shadow: inset 0 1px 0 0 color-mix(in srgb, var(--text) 5%, transparent);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    position: relative; 
    overflow: hidden;
    transition: all 0.3s var(--ease);
    cursor: default;
    user-select: none;
}

/* Physics Interaction */
.ins-card:hover {
    background: color-mix(in srgb, var(--elev-3) 60%, transparent);
    transform: translateY(-2px);
    border-color: var(--stroke-2);
    box-shadow: var(--shadow-subtle);
}
.ins-card:active {
    transform: scale(0.98);
}

/* Layout Variants */
.ins-card.wide { grid-column: span 3; height: 100px; }
.ins-card.square { grid-column: span 1; height: 180px; }

.ins-card-body {
    padding: 20px; 
    height: 100%; 
    width: 100%; 
    box-sizing: border-box;
    display: flex; 
    position: relative; 
    z-index: 2;
}

/* Flex Utilities */
.row-center { align-items: center; justify-content: space-evenly; }
.col-start { flex-direction: column; align-items: flex-start; justify-content: space-between; }
.row-between { align-items: center; justify-content: space-between; }

/* --- METRIC WIDGET (Card 1) --- */
.ins-metric {
    display: flex; flex-direction: column; align-items: center;
    position: relative;
}
.ins-num {
    font-size: var(--size-4); 
    font-weight: 700; 
    color: var(--text);
    line-height: 1; 
    letter-spacing: -0.02em;
    font-feature-settings: "tnum";
}
.ins-lbl {
    font-size: 0.7rem; 
    font-weight: 500; 
    color: var(--text-muted);
    margin-top: 4px; 
    letter-spacing: 0.02em;
}
.ins-sep {
    width: 1px; 
    height: 32px; 
    background: var(--stroke);
}
.ins-indicator {
    width: 6px; height: 6px; 
    background: var(--ok); 
    border-radius: 50%;
    position: absolute; top: 0; right: -8px; 
    box-shadow: 0 0 8px var(--ok);
    animation: ins-pulse 2s infinite;
}

/* Shine Effect */
.ins-card-shine {
    position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 3%, transparent), transparent);
    transform: skewX(-20deg); transition: 0.5s; pointer-events: none;
}
.ins-card:hover .ins-card-shine { left: 150%; transition: 0.8s; }

/* --- TOPIC WIDGETS (Cards 2, 3, 4) --- */
.ins-icon-surface {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
}
.ins-icon-surface svg { width: 18px; height: 18px; stroke-width: 1.5; }

/* Icon Colors */
.ins-icon-surface.blue { 
    background: color-mix(in srgb, var(--info) 10%, transparent); 
    color: var(--info); 
}
.ins-icon-surface.cyan { 
    background: color-mix(in srgb, var(--brand) 10%, transparent); 
    color: var(--brand); 
}
.ins-icon-surface.orange { 
    background: color-mix(in srgb, var(--warn) 10%, transparent); 
    color: var(--warn); 
}

.ins-text-group h3 {
    margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--text);
}
.ins-text-group p {
    margin: 4px 0 0; font-size: 0.75rem; color: var(--text-muted);
}

.ins-tag {
    font-size: 0.65rem; padding: 3px 8px; border-radius: 6px;
    background: color-mix(in srgb, var(--elev-1) 30%, transparent); 
    color: var(--text-muted);
    border: 1px solid transparent; font-weight: 500;
}
.ins-tag.cyan {
    background: color-mix(in srgb, var(--brand) 10%, transparent); 
    color: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 15%, transparent);
}

/* Featured Card Styles */
.ins-card.featured {
    background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 3%, transparent), color-mix(in srgb, var(--elev-2) 40%, transparent));
    border-color: color-mix(in srgb, var(--brand) 15%, transparent);
}
.ins-card.featured:hover { border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

/* --- ACCREDITATION WIDGET (Card 5) --- */
.ins-status { display: flex; align-items: center; gap: 12px; }
.ins-check-circle {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand); 
    color: var(--bg); /* Dark text on bright circle */
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 10px var(--brand-glow);
}
.ins-check-circle svg { width: 14px; }

.ins-arrow {
    color: var(--stroke); font-size: 1.2rem; transition: 0.3s;
}
.ins-card:hover .ins-arrow { color: var(--text); transform: translateX(4px); }

/* --- ANIMATION STATES --- */
.ins-anim { opacity: 0; transform: translateY(20px); transition: 0.6s var(--ins-ease); }
.ins-anim.active { opacity: 1; transform: translateY(0); }

@keyframes ins-pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }


/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .ins-dashboard { grid-template-columns: 1fr; }
    .ins-card.wide, .ins-card.square { grid-column: span 1; height: auto; min-height: 100px; }
    .ins-card.square { flex-direction: row; align-items: center; padding: 16px; height: auto; }
    .ins-card-body.col-start { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; gap: 16px; }
    .ins-tag { margin-left: auto; }
    .ins-text-group p { display: none; } /* Hide detail text on mobile for compactness */
}