/* M.D. College of Education — Premium ERP Theme */
:root {
    --college-green-dark: #0B5D3B;
    --college-green: #16784D;
    --college-green-light: #E8F5EE;
    --college-gold: #D4A017;
    --college-text-dark: #1F2937;
    --college-text-light: #6B7280;
    --college-bg: #F8FAFC;
    --college-card: #FFFFFF;
    --college-border: #E5E7EB;
    --college-radius: 14px;
    --college-radius-lg: 18px;
    --college-shadow: 0 4px 20px rgba(11, 93, 59, 0.08);
    --college-shadow-hover: 0 12px 32px rgba(11, 93, 59, 0.14);
    --college-topbar-shadow: 0 4px 18px rgba(11, 93, 59, 0.18);
    --college-transition: 0.22s ease;
}

/* ---- Base ---- */
body.app-body,
body.login-body {
    background-color: var(--college-bg);
    color: var(--college-text-dark);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app-main {
    flex: 1 0 auto;
    animation: collegeFadeIn 0.35s ease;
}

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

.fade-in-card {
    animation: collegeFadeIn 0.4s ease backwards;
}

/* ---- Topbar / Header ---- */
.topbar-modern,
.app-navbar.topbar-modern {
    background: linear-gradient(135deg, var(--college-green-dark) 0%, var(--college-green) 55%, #1a6b47 100%) !important;
    box-shadow: var(--college-topbar-shadow);
    border-bottom: 2px solid rgba(212, 160, 23, 0.35);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.topbar-brand-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff !important;
}

.topbar-brand-block:hover { color: #fff !important; opacity: 0.95; }

.topbar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.topbar-subtitle {
    font-size: 0.68rem;
    opacity: 0.88;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.9);
}

.topbar-modern .nav-link {
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 500;
    font-size: 0.9rem;
}

.topbar-modern .nav-link:hover,
.topbar-modern .nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff !important;
}

.topbar-modern .dropdown-menu {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius);
    box-shadow: var(--college-shadow-hover);
    padding: 0.35rem;
}

.topbar-modern .dropdown-item {
    border-radius: 8px;
    font-size: 0.9rem;
}

.topbar-modern .dropdown-item:hover {
    background: var(--college-green-light);
    color: var(--college-green-dark);
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.role-badge-modern {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--college-green-dark) !important;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.35em 0.7em;
    border-radius: 999px;
    border: 1px solid rgba(212, 160, 23, 0.4);
}

/* ---- Notifications ---- */
.notification-bell-modern {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--college-transition);
}

.notification-bell-modern:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
    transform: translateY(-1px);
}

.notification-badge-count {
    font-size: 0.62rem;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    background: #dc3545 !important;
    border: 2px solid var(--college-green-dark);
}

.notification-drawer {
    min-width: 320px;
    max-width: 360px;
    border: 1px solid var(--college-border) !important;
    border-radius: var(--college-radius) !important;
    box-shadow: var(--college-shadow-hover) !important;
    padding: 0 !important;
    overflow: hidden;
}

.notification-drawer-header {
    background: var(--college-green-light);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--college-border);
    font-weight: 700;
    color: var(--college-green-dark);
}

.notification-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--college-border);
    transition: background var(--college-transition);
    text-align: left;
    width: 100%;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
}

.notification-item:hover { background: var(--college-green-light); }
.notification-item.unread { background: #f0faf4; }
.notification-item.unread .notification-item-title { color: var(--college-green-dark); }

.notification-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.notification-icon-fees { background: #dbeafe; }
.notification-icon-certificates { background: #fef3c7; }
.notification-icon-approvals { background: #ede9fe; }
.notification-icon-students { background: var(--college-green-light); }
.notification-icon-system { background: #f3f4f6; }

.notification-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--college-text-dark);
    margin-bottom: 0.15rem;
}

.notification-item-msg {
    font-size: 0.75rem;
    color: var(--college-text-light);
    line-height: 1.35;
}

/* ---- Footer ---- */
.erp-footer {
    background: var(--college-card);
    border-top: 1px solid var(--college-border);
    font-size: 0.78rem;
    color: var(--college-text-light);
    padding: 0.9rem 0;
    margin-top: auto;
}

.erp-footer a {
    color: var(--college-green);
    text-decoration: none;
    font-weight: 500;
}

.erp-footer a:hover { text-decoration: underline; color: var(--college-green-dark); }

.erp-footer-welcome {
    background: linear-gradient(135deg, var(--college-green-dark), #123d2a);
    color: rgba(255, 255, 255, 0.9);
    border-top: none;
}

.erp-footer-welcome a { color: rgba(255, 255, 255, 0.75); }

/* ---- Page header ---- */
.page-header,
.dashboard-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--college-border);
}

.page-header h1,
.dashboard-page-header h1 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--college-green-dark);
    margin-bottom: 0.25rem;
}

.page-header .text-muted,
.dashboard-page-header .text-muted {
    color: var(--college-text-light) !important;
}

/* ---- Cards ---- */
.card-modern,
.app-card,
.card.app-card {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    box-shadow: var(--college-shadow);
    background: var(--college-card);
    transition: box-shadow var(--college-transition), transform var(--college-transition);
}

.card-modern:hover,
.app-card:hover {
    box-shadow: var(--college-shadow-hover);
}

.card-modern .card-header,
.app-card .card-header {
    background: var(--college-card) !important;
    border-bottom: 1px solid var(--college-border);
    font-weight: 600;
    color: var(--college-green-dark);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

/* ---- Stat cards ---- */
.stat-card,
.stat-card-modern {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    box-shadow: var(--college-shadow);
    background: var(--college-card);
    transition: transform var(--college-transition), box-shadow var(--college-transition);
    height: 100%;
    overflow: hidden;
    position: relative;
}

.stat-card::before,
.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--college-green), var(--college-gold));
    opacity: 0;
    transition: opacity var(--college-transition);
}

.stat-card:hover,
.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--college-shadow-hover);
}

.stat-card:hover::before,
.stat-card-modern:hover::before { opacity: 1; }

.stat-card .stat-title,
.stat-card-modern .stat-title {
    color: var(--college-text-light);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-card .stat-value,
.stat-card-modern .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--college-green-dark);
    letter-spacing: -0.02em;
}

.stat-card .stat-link,
.stat-card-modern .stat-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--college-green);
    text-decoration: none;
}

.stat-card .stat-link:hover { color: var(--college-green-dark); }

.stat-icon--primary { background: var(--college-green-light); color: var(--college-green-dark); }
.stat-icon--success { background: #d1f4e0; color: #146c43; }
.stat-icon--danger { background: #fde8e8; color: #b02a37; }
.stat-icon--warning { background: #fef3c7; color: #92400e; }
.stat-icon--info { background: #e0f2fe; color: #0369a1; }
.stat-icon--purple { background: #ede9fe; color: #6d28d9; }
.stat-icon--secondary { background: #f3f4f6; color: var(--college-text-light); }

.stat-card .stat-icon,
.stat-card-modern .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ---- Buttons ---- */
.btn-primary {
    background: linear-gradient(135deg, var(--college-green-dark), var(--college-green)) !important;
    border-color: var(--college-green-dark) !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    transition: transform var(--college-transition), box-shadow var(--college-transition);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #094d31, var(--college-green-dark)) !important;
    border-color: #094d31 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(11, 93, 59, 0.3);
}

.btn-success {
    background: var(--college-green) !important;
    border-color: var(--college-green) !important;
    border-radius: 10px;
    font-weight: 600;
}

.btn-success:hover {
    background: var(--college-green-dark) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--college-green) !important;
    border-color: var(--college-green) !important;
    border-radius: 10px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--college-green-light) !important;
    color: var(--college-green-dark) !important;
    border-color: var(--college-green-dark) !important;
}

.btn-outline-success {
    color: var(--college-green) !important;
    border-color: var(--college-green) !important;
    border-radius: 10px;
}

.btn-danger {
    border-radius: 10px;
    font-weight: 600;
}

.btn-warning {
    border-radius: 10px;
    font-weight: 600;
    background: var(--college-gold) !important;
    border-color: #b8860b !important;
    color: #1f2937 !important;
}

.btn-outline-light {
    border-radius: 999px;
    font-weight: 600;
    border-color: rgba(255,255,255,0.5) !important;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.15) !important;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.btn-sm { border-radius: 8px; }

/* ---- Tables ---- */
.table-modern-wrap {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    box-shadow: var(--college-shadow);
    background: var(--college-card);
    overflow: hidden;
}

.app-main .table,
.table-modern {
    margin-bottom: 0;
}

.app-main .table thead th,
.table-modern thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--college-green-light) !important;
    color: var(--college-green-dark);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--college-border);
    white-space: nowrap;
    padding: 0.75rem 0.85rem;
}

.app-main .table tbody tr:nth-child(even),
.table-modern tbody tr:nth-child(even) {
    background: #fafbfc;
}

.app-main .table tbody tr:hover,
.table-modern tbody tr:hover {
    background: var(--college-green-light) !important;
}

.app-main .table td,
.table-modern td {
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
    border-color: var(--college-border);
    font-size: 0.88rem;
}

.student-table-card,
.table-responsive.card-modern,
.app-main .card .table-responsive,
.app-main .table-responsive {
    border-radius: var(--college-radius-lg);
    overflow: auto;
    border: 1px solid var(--college-border);
    box-shadow: var(--college-shadow);
    background: var(--college-card);
}

.app-main .shadow-sm {
    box-shadow: var(--college-shadow) !important;
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
}

/* ---- Forms ---- */
.form-modern .form-label,
.app-main .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--college-text-dark);
    margin-bottom: 0.35rem;
}

.form-modern .form-control,
.form-modern .form-select,
.app-main .form-control,
.app-main .form-select {
    border: 1px solid var(--college-border);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    transition: border-color var(--college-transition), box-shadow var(--college-transition);
}

.form-modern .form-control:focus,
.app-main .form-control:focus,
.app-main .form-select:focus {
    border-color: var(--college-green);
    box-shadow: 0 0 0 3px rgba(22, 120, 77, 0.15);
}

.form-modern .form-floating > .form-control:focus ~ label,
.form-modern .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--college-green);
}

.form-section-card {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    padding: 1.25rem;
    background: var(--college-card);
    margin-bottom: 1rem;
}

.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--college-green-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--college-green-light);
}

.invalid-feedback { font-size: 0.8rem; font-weight: 500; }

/* ---- Badges ---- */
.badge-modern,
.ui-status-badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.4em 0.7em;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.ui-status-success { background: var(--college-green-light); color: var(--college-green-dark); }
.ui-status-warning { background: #fef3c7; color: #92400e; }
.ui-status-danger { background: #fde8e8; color: #b02a37; }
.ui-status-info { background: #e0f2fe; color: #0369a1; }
.ui-status-secondary { background: #f3f4f6; color: var(--college-text-light); }
.ui-status-default { background: var(--college-green-light); color: var(--college-green-dark); }

/* ---- Section titles ---- */
.section-title-modern {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--college-green-dark);
}

.section-subtitle-modern {
    color: var(--college-text-light);
    font-size: 0.85rem;
}

/* ---- Action / Quick links ---- */
.action-card-modern {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    box-shadow: var(--college-shadow);
    transition: transform var(--college-transition), box-shadow var(--college-transition);
}

.action-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: var(--college-shadow-hover);
}

.quick-link-modern {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius);
    box-shadow: var(--college-shadow);
    color: var(--college-text-dark);
}

.quick-link-modern:hover {
    color: var(--college-green-dark);
    border-color: var(--college-green);
}

.quick-link-modern .ql-icon {
    background: var(--college-green-light);
    color: var(--college-green-dark);
}

/* ---- Student profile ---- */
.student-profile-header,
.profile-card-modern {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    box-shadow: var(--college-shadow);
    background: linear-gradient(135deg, #fff 0%, var(--college-green-light) 120%);
    overflow: hidden;
    position: relative;
}

.student-profile-header::before,
.profile-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--college-green-dark), var(--college-gold));
}

.profile-quick-links .btn { border-radius: 10px; }

/* ---- Certificates ---- */
.cert-preview-card {
    border: 1px solid var(--college-border);
    border-radius: var(--college-radius-lg);
    box-shadow: var(--college-shadow);
    background: var(--college-card);
    padding: 1.25rem;
}

.cert-preview-card .cert-doc-frame {
    border: 2px dashed var(--college-border);
    border-radius: var(--college-radius);
    background: #fafbfc;
    padding: 1.5rem;
    min-height: 120px;
}

.cert-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--college-green-light);
    border-radius: var(--college-radius);
    border: 1px solid rgba(22, 120, 77, 0.15);
}

/* ---- Alerts ---- */
.alert {
    border-radius: var(--college-radius);
    border: none;
    font-size: 0.9rem;
}

.alert-success { background: var(--college-green-light); color: var(--college-green-dark); }
.alert-danger { background: #fde8e8; color: #b02a37; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* ---- Login ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--college-green-dark) 0%, var(--college-green) 50%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card-modern {
    max-width: 440px;
    width: 100%;
    border: none;
    border-radius: var(--college-radius-lg);
    box-shadow:
        0 24px 56px rgba(11, 93, 59, 0.18),
        0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.login-page .form-control:focus,
.login-page .form-select:focus {
    border-color: var(--college-green);
    box-shadow: 0 0 0 3px rgba(22, 120, 77, 0.2);
    outline: none;
}

.login-page .auth-remember-check .form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.15em;
    border: 2px solid var(--college-border);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-page .auth-remember-check .form-check-input:checked {
    background-color: var(--college-green);
    border-color: var(--college-green);
}

.login-page .auth-remember-check .form-check-input:focus {
    border-color: var(--college-green);
    box-shadow: 0 0 0 3px rgba(22, 120, 77, 0.2);
}

.login-page .auth-remember-check .form-check-label {
    font-size: 0.875rem;
    color: var(--college-text-dark);
    cursor: pointer;
    padding-left: 0.15rem;
}

.auth-action-helper {
    font-size: 0.8125rem;
    color: var(--college-text-light);
    text-align: center;
    margin: 1.25rem 0 0.75rem;
}

.auth-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auth-action-link {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 0;
    background: #F0F9F4;
    border: 1px solid #16784D;
    color: #16784D;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    text-align: center;
    line-height: 1.3;
}

.auth-action-link:hover,
.auth-action-link:focus-visible {
    background: #16784D;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.auth-action-link:focus-visible {
    outline: 2px solid rgba(22, 120, 77, 0.35);
    outline-offset: 2px;
}

.auth-action-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .auth-action-bar {
        flex-direction: column;
    }

    .auth-action-link {
        flex: 1 1 100%;
        width: 100%;
    }
}

.login-card-modern .login-card-header {
    background: var(--college-green-light);
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--college-border);
}

.login-card-modern .login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.login-card-modern .login-institute-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--college-green-dark);
    margin-bottom: 0.25rem;
}

.login-card-modern .login-affiliation {
    font-size: 0.78rem;
    color: var(--college-text-light);
}

/* ---- Misc ---- */
.admission-code {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    background: var(--college-green-light);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--college-green-dark);
    font-weight: 600;
}

.empty-state-modern {
    border: 1px dashed var(--college-border);
    border-radius: var(--college-radius-lg);
    background: var(--college-card);
}

.ui-avatar-placeholder {
    background: linear-gradient(135deg, var(--college-green-light), #d1fae5);
    color: var(--college-green-dark);
}

.student-form-sticky-bar {
    border-top: 1px solid var(--college-border);
    background: rgba(255, 255, 255, 0.96);
}

.student-form-accordion .accordion-button:not(.collapsed) {
    background: var(--college-green-light);
    color: var(--college-green-dark);
}

.bg-primary-subtle { background: var(--college-green-light) !important; }
.text-primary { color: var(--college-green) !important; }

/* ---- Responsive ---- */
@media (max-width: 767.98px) {
    .topbar-title { font-size: 0.88rem; }
    .topbar-subtitle { display: none; }
    .stat-card .stat-value, .stat-card-modern .stat-value { font-size: 1.35rem; }
    .erp-footer .col-md-4 { text-align: center !important; margin-bottom: 0.35rem; }
    .app-main .table thead th { font-size: 0.68rem; }
}
