@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --primary-color: #7c3aed;
    /* Vibrant Purple */
    --secondary-color: #f3f4f6;
    --success-color: #10b981;
    /* Emerald Green */
    --success-bg: #ecfdf5;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-bg: #fef2f2;
    --bg-color: #f8fafc;
    /* Very light cool gray */
    --card-bg: #ffffff;
    --card-border: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 30px rgba(124, 58, 237, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 40px;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
.stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    /* Cleaner for this style */
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Header Overhaul */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container h1 a {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dashboard Layout */
.dashboard {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    animation: fadeIn 0.4s ease-out;
}

.welcome-section {
    margin-bottom: 3rem;
}

.welcome-title {
    font-size: 2.75rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.welcome-name {
    color: var(--primary-color);
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Navigation Links (ExamPortal Style) */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-links a.active {
    background: #eef2ff;
    color: var(--primary-color);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
    margin-left: 1rem;
}

.user-names {
    text-align: right;
}

.user-display-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
}

.user-role-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.logout-icon-btn:hover {
    background: #ffe4e6;
    color: #e11d48;
}

/* Section Dividers */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 3rem 0 2rem;
}

.section-tag {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
}

.section-tag.urgent {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

.section-tag.morning {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

.section-tag.daily {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.section-line {
    height: 1px;
    background: #e2e8f0;
    flex: 1;
}

/* Stats Cards */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    color: #0f172a;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Task Cards */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.widget {
    background: #ffffff;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.widget:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.task-item {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1.5rem;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.task-item.pending .task-icon-circle {
    background: #fefce8;
    color: #eab308;
}

.task-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-top: 0.75rem;
}

.task-meta {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f8fafc;
}

.score-area {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
}

.score-value {
    display: block;
    font-size: 1.1rem;
    color: #475569;
    margin-top: 0.25rem;
}

.percentage-badge {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.percentage-badge.low {
    color: var(--danger-color);
}

.percentage-badge.mid {
    color: var(--warning-color);
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Form Elements (Classical/Refined) */
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #334155;
}

input,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    background: #ffffff;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Responsive */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .header-container {
        padding: 0 1rem;
    }
}

/* Success Card Overlay */
#success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.success-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.success-title {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.nav-links a.btn-primary {
    color: white;
}

.nav-links a.btn-primary {
    padding: 0.5rem 1.25rem;
}

/* Finance Specifics */
.finance-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.finance-card {
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.finance-card.income {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.finance-card.outgoing {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.finance-card.balance {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

/* Staff Management UI */
.staff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
}

.staff-info h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.staff-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Helper Classes */
.hidden {
    display: none !important;
}