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

:root {
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    
    /* Light Theme Variables */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-accent: #f1f5f9;
    --border-color: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.1);
    --primary-hover: #4338ca;
    
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-glow: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.1);
    
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 16px;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-accent: #1f2937;
    --border-color: #2d3748;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --primary-hover: #818cf8;
    
    --success: #34d399;
    --success-glow: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-glow: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-glow: rgba(248, 113, 113, 0.15);
    
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Custom Typography & UI elements */
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    color: var(--primary-hover);
}

/* Glassmorphism layouts & styling */
.glass-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* Main Dashboard App Grid Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.sidebar-logo-img {
    max-height: 40px;
    max-width: 140px;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .sidebar-logo-img {
        max-height: 32px;
        max-width: 100px;
    }
    .sidebar-logo {
        padding: 0 1rem;
        font-size: 1rem;
    }
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px; /* space for mobile bottom nav if active */
}

.main-header {
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* Main inner content window */
.main-content {
    padding: 2rem;
    flex-grow: 1;
}

/* Theme Toggle Button */
.theme-btn, .action-btn-circle {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-btn:hover, .action-btn-circle:hover {
    color: var(--primary);
    background: var(--primary-glow);
}

/* Notification Badge */
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* Notification Dropdown */
.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    margin-top: 8px;
}
.notif-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9rem;
}
.notif-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}
.notif-dropdown-body .notification-item {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}
.notif-dropdown-body .notification-item:hover {
    background: var(--bg-accent);
}
.notif-dropdown-body .notification-item h4 {
    font-size: 0.8rem;
    margin-bottom: 2px;
}
.notif-dropdown-body .notification-item p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.notif-dropdown-body .notification-item small {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.notif-dropdown-body .notification-item.unread {
    border-left: 3px solid var(--primary);
}

/* Interactive elements buttons */
.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-accent);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Badge Status Styles */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.badge-active, .badge-verified, .badge-paid, .badge-present {
    background-color: var(--success-glow);
    color: var(--success);
}
.badge-pending, .badge-unpaid, .badge-late {
    background-color: var(--warning-glow);
    color: var(--warning);
}
.badge-suspended, .badge-rejected, .badge-overdue, .badge-absent {
    background-color: var(--danger-glow);
    color: var(--danger);
}

/* Metrics Dashboard Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-info h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-info p {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.metric-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Charts and layout components */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}

.custom-table th {
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tbody tr:hover {
    background-color: var(--bg-accent);
}

/* Bottom Navigation (Mobile View) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.75rem 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-decoration: none;
    gap: 0.25rem;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--primary);
}

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

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-wrapper {
        margin-left: 0;
        padding-bottom: 70px;
    }
    .mobile-nav {
        display: flex;
    }
    .main-header {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    .header-title h1 {
        font-size: 1rem;
    }
    .header-search {
        display: none;
    }
    .header-actions {
        gap: 0.5rem;
    }
    .header-actions .btn-secondary {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem;
    }
    .header-actions .btn-secondary span {
        display: none;
    }
    .main-content {
        padding: 0.75rem;
    }
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .metric-info p {
        font-size: 1.25rem;
    }
    .metric-info h3 {
        font-size: 0.75rem;
    }
    .metric-icon-box {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .glass-card {
        padding: 1rem;
    }
    .app-section-header h2 {
        font-size: 0.9rem;
    }
    .charts-grid {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .custom-table {
        font-size: 0.75rem;
    }
    .custom-table th,
    .custom-table td {
        padding: 0.5rem 0.6rem;
    }
    .quick-actions {
        gap: 0.5rem;
        justify-content: center;
    }
    .quick-action-btn {
        padding: 0.5rem 0.75rem;
        min-width: 60px;
    }
    .quick-action-btn i {
        font-size: 1.1rem;
    }
    .quick-action-btn span {
        font-size: 0.65rem;
    }

    /* Course card mobile */
    .course-card-top {
        padding: 1rem 1rem 0.75rem;
    }
    .course-card-body {
        padding: 0 1rem 0.75rem;
    }
    .course-card-footer {
        padding: 0.5rem 1rem;
    }

    /* Installment card mobile */
    .instal-card {
        padding: 0.75rem;
        gap: 8px;
    }
    .instal-step {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    /* Rank card mobile */
    .rank-card {
        padding: 1rem 0.75rem;
    }
    .rank-card .rank-number {
        font-size: 1.5rem;
    }
    .rank-medal {
        font-size: 1.3rem;
    }

    /* Performance section mobile */
    #studPerformanceChart {
        height: 180px !important;
    }

    /* Performance section mobile */
    .rank-card {
        padding: 0.75rem 0.6rem !important;
    }
    .rank-card .rank-number {
        font-size: 1.4rem !important;
    }
    .rank-card .rank-number span {
        font-size: 0.75rem !important;
    }
    .rank-card p[style*="font-size:0.8rem"] {
        font-size: 0.65rem !important;
    }
    .rank-card div[style*="font-size:0.75rem"] {
        font-size: 0.65rem !important;
    }
    .rank-medal {
        font-size: 1.3rem !important;
    }

    /* Performance chart */
    #studPerformanceChart {
        height: 160px !important;
    }
    .glass-card div[style*="height:260px"] {
        height: 160px !important;
    }

    /* Performance matrix text */
    .glass-card p[style*="line-height:1.6"] {
        font-size: 0.75rem !important;
    }

    /* Exam & attendance tables - hide Course column on mobile */
    .table-responsive table.custom-table th:nth-child(2),
    .table-responsive table.custom-table td:nth-child(2) {
        display: none;
    }

    /* Profile section mobile */
    .glass-card div[style*="padding:2rem 1.5rem"] {
        padding: 1.25rem 1rem !important;
    }
    .glass-card div[style*="padding:2rem 1.5rem"] div[style*="width:72px"] {
        width: 52px !important;
        height: 52px !important;
        font-size: 1.4rem !important;
    }
    .glass-card div[style*="padding:2rem 1.5rem"] h3 {
        font-size: 1rem !important;
    }
    .glass-card div[style*="padding:2rem 1.5rem"] p {
        font-size: 0.75rem !important;
    }
    #stud-profile-form {
        padding: 1rem !important;
    }
    #stud-profile-form div[style*="gap:1rem"] {
        gap: 0.5rem !important;
    }
    #stud-profile-form hr {
        margin: 1rem 0 !important;
    }
    #stud-profile-form h4 {
        font-size: 0.85rem !important;
    }
    #stud-profile-form div[style*="margin-top:1.5rem"] {
        margin-top: 1rem !important;
    }

    /* Payment section mobile */
    .instal-card > div[style*="gap:14px"] {
        gap: 8px !important;
    }
    .instal-card > div[style*="gap:12px"] {
        gap: 6px !important;
    }
    .instal-card > div[style*="gap:12px"] .btn-primary {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
    .instal-card > div[style*="gap:12px"] div[style*="font-size:1rem"] {
        font-size: 0.85rem !important;
    }
    .instal-card > div[style*="gap:12px"] span[style*="font-size:0.75rem"] {
        font-size: 0.65rem !important;
    }
    .instal-card > div[style*="gap:14px"] div[style*="font-size:0.85rem"] {
        font-size: 0.8rem !important;
    }
    .instal-card > div[style*="gap:14px"] div[style*="font-size:0.75rem"] {
        font-size: 0.65rem !important;
    }
    .instal-card > div[style*="gap:14px"] span[style*="font-size:0.8rem"] {
        font-size: 0.7rem !important;
    }

    /* Payment history table mobile - hide less important columns */
    .table-responsive table.custom-table th:nth-child(3),
    .table-responsive table.custom-table td:nth-child(3),
    .table-responsive table.custom-table th:nth-child(4),
    .table-responsive table.custom-table td:nth-child(4) {
        display: none;
    }

    /* Profile mobile */
    #stud-profile-form div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Fees installment table mobile - hide Due Date & Fine columns */
    #fees-installment-table th:nth-child(3),
    #fees-installment-table td:nth-child(3),
    #fees-installment-table th:nth-child(5),
    #fees-installment-table td:nth-child(5) {
        display: none;
    }
    #fees-installment-table th:nth-child(1),
    #fees-installment-table td:nth-child(1) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Fees metrics cards on mobile */
    #stud-fees-content .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    #stud-fees-content .metric-card {
        padding: 0.6rem !important;
    }
    #stud-fees-content .metric-info p {
        font-size: 0.95rem !important;
    }
    #stud-fees-content .metric-info h3 {
        font-size: 0.7rem !important;
    }

    /* Footer mobile */
    .app-footer {
        padding: 0.5rem 0.6rem;
        flex-direction: column;
        text-align: center;
        padding-bottom: calc(0.5rem + 60px);
        font-size: 0.65rem;
        gap: 0.3rem;
        line-height: 1.3;
    }
    .app-footer .footer-brand {
        font-size: 0.75rem;
    }
    .footer-links {
        gap: 0.75rem;
        font-size: 0.65rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer-links a {
        font-size: 0.65rem;
    }

    /* Notification card mobile */
    .glass-card div[style*="flex-direction:column"][style*="gap:4px"] {
        gap: 2px !important;
    }
    .notification-item {
        padding: 0.5rem !important;
        gap: 8px !important;
    }
    .notification-item .notif-item-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
    }
    .notification-item h4 {
        font-size: 0.78rem !important;
    }
    .notification-item h4 small {
        font-size: 0.6rem !important;
    }
    .notification-item p {
        font-size: 0.72rem !important;
        margin-top: 2px !important;
    }
    .notification-item.unread {
        background: var(--primary-glow) !important;
        border-radius: 8px !important;
        border-left: 3px solid var(--primary) !important;
    }

    /* Notification dropdown mobile */
    .notif-dropdown {
        width: 290px;
        right: -60px;
    }
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .metric-info p {
        font-size: 1.1rem;
    }
    .metric-info h3 {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    .metric-icon-box {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .glass-card {
        padding: 0.75rem;
    }
    .charts-grid {
        gap: 0.5rem;
    }
    .rank-card {
        padding: 0.75rem 0.5rem;
    }
    .rank-medal {
        font-size: 1.1rem;
    }
    .rank-card .rank-number {
        font-size: 1.2rem;
    }
    .app-section-header h2 {
        font-size: 0.8rem;
    }
    .instal-card {
        padding: 0.5rem;
        gap: 4px;
        border-left-width: 3px !important;
    }
    .instal-step {
        width: 24px;
        height: 24px;
        font-size: 0.55rem;
    }
    .instal-card div[style*="font-size:1rem"] {
        font-size: 0.8rem !important;
    }
    .instal-card div[style*="font-size:0.85rem"] {
        font-size: 0.75rem !important;
    }
    .instal-card span[style*="font-size:0.75rem"] {
        font-size: 0.6rem !important;
    }
    /* Payment history: hide Action column too on very small */
    .table-responsive table.custom-table th:nth-child(6),
    .table-responsive table.custom-table td:nth-child(6) {
        display: none;
    }

    /* Performance 480px - compact rank cards */
    .rank-card {
        padding: 0.5rem 0.4rem !important;
    }
    .rank-card .rank-number {
        font-size: 1.1rem !important;
    }
    .rank-medal {
        font-size: 1rem !important;
    }
    .rank-card .rank-number span {
        font-size: 0.65rem !important;
    }
    .rank-card p[style*="font-size:0.8rem"] {
        font-size: 0.6rem !important;
    }
    .rank-card div[style*="font-size:0.75rem"] {
        font-size: 0.6rem !important;
    }
    /* Hide attendance Logs grade column on very small */
    .table-responsive table.custom-table th:nth-child(5),
    .table-responsive table.custom-table td:nth-child(5) {
        display: none;
    }

    /* Profile 480px */
    .glass-card div[style*="padding:2rem 1.5rem"] {
        padding: 1rem 0.75rem !important;
    }
    .glass-card div[style*="padding:2rem 1.5rem"] div[style*="width:72px"] {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
        border-width: 2px !important;
    }
    .glass-card div[style*="padding:2rem 1.5rem"] h3 {
        font-size: 0.9rem !important;
    }

    /* Notification 480px - ultra compact + deep color */
    .notification-item {
        padding: 0.4rem 0.5rem !important;
        gap: 6px !important;
    }
    .notification-item .notif-item-avatar {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.6rem !important;
    }
    .notification-item h4 {
        font-size: 0.72rem !important;
    }
    .notification-item h4 small {
        font-size: 0.55rem !important;
    }
    .notification-item p {
        font-size: 0.65rem !important;
        margin-top: 1px !important;
    }
    .notification-item.unread {
        background: rgba(79, 70, 229, 0.18) !important;
        border-left: 3px solid #4f46e5 !important;
    }
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--card-shadow-hover);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Forms layout */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Unified login page styling */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    animation: loginFloat 8s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -5%;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    animation: loginFloat 10s ease-in-out infinite reverse;
}

@keyframes loginFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.login-card {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-logo i {
    animation: loginFloat 3s ease-in-out infinite;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Role Selector Grid */
.role-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.role-option {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.role-option i {
    font-size: 1.3rem;
    display: block;
}

.role-option.active {
    border-color: var(--primary);
    background-color: var(--primary-glow);
    color: var(--primary);
}

.role-option:hover {
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .login-page { padding: 1rem; }
    .login-card { padding: 1.5rem; }
    .role-option { padding: 0.6rem 0.3rem; font-size: 0.8rem; }
    .role-option i { font-size: 1.1rem; }
    .login-logo { font-size: 1.6rem; }
}

/* Notification item styling */
.notification-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item.unread {
    background-color: var(--primary-glow);
    border-radius: 8px;
    padding: 0.75rem;
}
.notification-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
}
.notification-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Receipt template for downloading */
.receipt-wrapper {
    background: #ffffff;
    color: #111111;
    padding: 2.5rem;
    border: 1px solid #dddddd;
    border-radius: 12px;
    max-width: 650px;
    margin: 1.5rem auto;
    font-family: 'Courier New', Courier, monospace;
}
.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #333;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.receipt-total {
    border-top: 2px dashed #333;
    padding-top: 1rem;
    margin-top: 1rem;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ========== APP-LIKE AESTHETICS ========== */

/* App Footer */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}
.app-footer a {
    color: var(--text-secondary);
    transition: color 0.2s;
}
.app-footer a:hover {
    color: var(--primary);
}
.footer-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}
.footer-brand {
    font-weight: 700;
    color: var(--primary);
}

/* Gradient Metric Cards */
.metric-gradient {
    position: relative;
    overflow: hidden;
    border: none;
    color: #fff;
}
.metric-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.4) 0%, transparent 70%);
    pointer-events: none;
}
.metric-gradient .metric-info h3 {
    color: rgba(255,255,255,0.8);
}
.metric-gradient .metric-info p {
    color: #fff;
}
.metric-gradient .metric-icon-box {
    background: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}
.metric-grad-1 { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.metric-grad-2 { background: linear-gradient(135deg, #d97706, #f59e0b); }
.metric-grad-3 { background: linear-gradient(135deg, #059669, #10b981); }
.metric-grad-4 { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* App Section Headers */
.app-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}
.app-section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.app-section-header .badge {
    font-size: 0.7rem;
}

/* Enhanced Course Cards */
.course-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
}
.course-card-top {
    padding: 1.5rem 1.5rem 1rem;
    position: relative;
}
.course-card-body {
    padding: 0 1.5rem 1.25rem;
}
.course-card-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-accent);
}
.course-color-bar {
    height: 4px;
    border-radius: 0 0 16px 16px;
    width: 100%;
}

/* Progress Bar */
.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--bg-accent);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* Installment Timeline App Card */
.instal-card {
    border: none;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.2s ease;
}
.instal-card:hover {
    transform: translateX(4px);
}
.instal-step {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Leaderboard / Rank Cards */
.rank-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border: none;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.rank-card .rank-number {
    font-size: 2.5rem;
    font-weight: 800;
}
.rank-medal {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

/* Search Bar in Header */
.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
    flex: 1;
    max-width: 320px;
}
.header-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    width: 100%;
}
.header-search input::placeholder {
    color: var(--text-muted);
}
.header-search i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* User Avatar in Header */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}
.user-avatar:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* Notification item in dropdown with avatar */
.notif-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--primary);
    flex-shrink: 0;
}

/* App Quick Action Buttons */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    text-align: center;
}
.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    transform: translateY(-2px);
}
.quick-action-btn i {
    font-size: 1.3rem;
    color: var(--primary);
}
.quick-action-btn span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Subtle Pulse Animation */
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* ===== ID CARD STYLES ===== */
/* ===== ID CARD STYLES (REDESIGNED - Credit Card Format) ===== */
.id-card-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
}
.id-card-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}
.id-card {
    width: 320px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: 'Segoe UI', Arial, sans-serif;
    break-inside: avoid;
    page-break-inside: avoid;
}
.id-card-front {
    background: linear-gradient(145deg, #1a237e 0%, #3949ab 50%, #283593 100%);
    color: #fff;
}
.id-card-front .card-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    padding: 12px 14px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.id-card-front .card-header .inst-name {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}
.id-card-front .card-header .inst-tagline {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 2px;
    letter-spacing: 0.5px;
}
.id-card-front .card-body {
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.id-card-front .card-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}
.id-card-front .card-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    opacity: 0.5;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}
.id-card-front .card-info {
    flex: 1;
    min-width: 0;
}
.id-card-front .student-name-card {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}
.id-card-front .student-roll-card {
    font-size: 0.7rem;
    opacity: 0.85;
    margin: 2px 0 4px;
}
.id-card-front .card-sub-info {
    font-size: 0.65rem;
    opacity: 0.75;
    line-height: 1.4;
}
.id-card-front .card-details {
    padding: 6px 14px 8px;
    font-size: 0.7rem;
    background: rgba(0,0,0,0.08);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.id-card-front .card-details-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    line-height: 1.5;
}
.id-card-front .card-details-row:last-child {
    border-bottom: none;
}
.id-card-front .card-details-row .label {
    opacity: 0.65;
    font-size: 0.65rem;
}
.id-card-front .card-details-row .value {
    font-weight: 600;
    text-align: right;
    font-size: 0.65rem;
}
.id-card-front .card-footer {
    padding: 6px;
    text-align: center;
    font-size: 0.5rem;
    opacity: 0.55;
    background: rgba(0,0,0,0.1);
    letter-spacing: 0.3px;
}

.id-card-back {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}
.id-card-back .back-header {
    background: #1a237e;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.id-card-back .back-body {
    padding: 10px 14px;
    font-size: 0.7rem;
}
.id-card-back .back-body .info-row {
    display: flex;
    padding: 2px 0;
    border-bottom: 1px solid #f0f0f0;
}
.id-card-back .back-body .info-row:last-child {
    border-bottom: none;
}
.id-card-back .back-body .info-row .ilabel {
    width: 75px;
    font-weight: 600;
    color: #666;
    font-size: 0.65rem;
}
.id-card-back .back-body .info-row .ivalue {
    flex: 1;
    color: #333;
    font-size: 0.65rem;
}
.id-card-back .back-qr-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    gap: 10px;
    border-top: 1px dashed #ddd;
}
.id-card-back .back-qr-section svg, 
.id-card-back .back-qr-section img {
    width: 70px;
    height: 70px;
}
.id-card-back .back-qr-section .back-qr-text {
    font-size: 0.5rem;
    color: #999;
    max-width: 140px;
    line-height: 1.3;
}
.id-card-back .back-footer {
    text-align: center;
    font-size: 0.5rem;
    color: #aaa;
    padding: 6px;
    border-top: 1px solid #f5f5f5;
}
.id-card-back .signature-area {
    text-align: center;
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
}
.id-card-back .signature-area img {
    max-height: 24px;
    max-width: 100px;
}
.id-card-back .signature-area .sig-label {
    font-size: 0.5rem;
    color: #999;
    margin-top: 2px;
}

/* ID Card actions bar */
.id-card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ===== BILL RECEIPT STYLES ===== */
.bill-receipt {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    color: #333;
    font-family: 'Courier New', monospace;
    padding: 30px;
    border: 1px solid #ddd;
}
.bill-receipt .bill-header {
    text-align: center;
    border-bottom: 2px dashed #333;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.bill-receipt .bill-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #111;
}
.bill-receipt .bill-header p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #555;
}
.bill-receipt .bill-copy-type {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e53935;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.bill-receipt .bill-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.8rem;
    border-bottom: 1px dotted #ddd;
}
.bill-receipt .bill-row .blabel {
    font-weight: 600;
    color: #555;
}
.bill-receipt .bill-row .bvalue {
    font-weight: 600;
    color: #111;
}
.bill-receipt .bill-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    margin-top: 10px;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    font-size: 1.1rem;
    font-weight: 800;
}
.bill-receipt .bill-footer-text {
    text-align: center;
    font-size: 0.65rem;
    color: #888;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

/* ===== CERTIFICATE STYLES ===== */
.certificate-preview {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    color: #333;
    padding: 40px;
    border: 3px double #1a237e;
    text-align: center;
    font-family: 'Georgia', serif;
}
.certificate-preview .cert-title {
    font-size: 1.5rem;
    color: #1a237e;
    font-weight: 800;
    margin-bottom: 20px;
    text-transform: uppercase;
}
.certificate-preview .cert-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}
.certificate-preview .cert-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
}
.certificate-preview .cert-footer .cert-signature {
    text-align: center;
}
.certificate-preview .cert-footer .cert-signature .line {
    width: 150px;
    border-top: 1px solid #333;
    margin-top: 40px;
    padding-top: 5px;
    font-size: 0.75rem;
    color: #555;
}

/* ===== STUDENT REGISTRATION FORM ===== */
.registration-form {
    max-width: 900px;
    margin: 0 auto;
}
.registration-form .form-section {
    margin-bottom: 1.5rem;
}
.registration-form .form-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}
.registration-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.registration-form .form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}
.registration-form .photo-upload-area {
    width: 150px;
    height: 180px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}
.registration-form .photo-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}
.registration-form .photo-upload-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.registration-form .photo-upload-area .upload-placeholder {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.registration-form .photo-upload-area .upload-placeholder i {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

/* ===== FEES & DUE MANAGEMENT ===== */
.fee-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.fee-summary-card {
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-align: center;
}
.fee-summary-card .fee-amount {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 5px;
}
.fee-summary-card .fee-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PRINT SPECIFIC STYLES ===== */
@media print {
    body * { visibility: hidden; }
    #printable-area, #printable-area *,
    #printable-student-id, #printable-student-id * { visibility: visible; }
    #printable-area, #printable-student-id { position: absolute; left: 0; top: 0; width: 100%; }
    .id-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; }
    .no-print { display: none !important; }
}

/* ===== BADGE VARIANTS ===== */
.badge-course {
    background: #e8eaf6;
    color: #283593;
}
.badge-fee {
    background: #e8f5e9;
    color: #2e7d32;
}
.badge-due {
    background: #fbe9e7;
    color: #c62828;
}

/* Student row in table with photo thumb */
.student-info-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.student-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-accent);
    border: 2px solid var(--border-color);
}
.student-thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
}

/* Two-column layout for content */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .two-col-layout { grid-template-columns: 1fr; }
    .registration-form .form-row { grid-template-columns: 1fr; }
    .registration-form .form-row.three-col { grid-template-columns: 1fr; }
}

