/* ===================================
   1. CSS VARIABLES & RESET
   =================================== */
:root {
    /* Brand Colors */
    --primary: #2e5c89;
    --primary-dark: #1e4d73;
    --primary-light: #3a6fa0;
    --secondary: #44c0b6;
    --secondary-dark: #3aa89e;
    --accent: #e64a2e;
    --accent-dark: #c73a24;
    
    /* Neutral Colors */
    --light: #f5f7fa;
    --dark: #2d3748;
    --gray-50: #fafbfc;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #e0e4e9;
    --gray-400: #c8d0d9;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;
    
    /* Status Colors */
    --success: #48bb78;
    --success-light: #68d391;
    --warning: #ed8936;
    --warning-light: #f6ad55;
    --danger: #f56565;
    --danger-light: #fc8181;
    --info: #4299e1;
    --info-light: #63b3ed;
    
    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px; /* Added for collapsed state */
    --header-height: 70px;
    
    /* Spacing - Optimized for space saving */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 14px; /* Reduced from 16px */
    --spacing-lg: 20px; /* Reduced from 24px */
    --spacing-xl: 28px; /* Reduced from 32px */
    --spacing-2xl: 40px; /* Reduced from 48px */
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

/* ===================================
   2. BASE STYLES
   =================================== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f8fafc 0%, #e9ecf1 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

.admin-container {
    min-height: 100vh;
}

/* ===================================
   3. LOGIN SECTION
   =================================== */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}

.login-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.login-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
}

.login-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem; /* Reduced from 3rem 2.5rem */
    max-width: 430px; /* Reduced from 450px */
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

.login-header img {
    width: 90px; /* Reduced from 100px */
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    transition: var(--transition);
}

.login-header img:hover {
    transform: scale(1.05) rotate(2deg);
}

.login-header h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem; /* Reduced from 2rem */
    font-weight: 700;
}

.login-header p {
    color: var(--gray-600);
    margin-bottom: 1.75rem; /* Reduced from 2rem */
    font-size: 0.9rem; /* Reduced from 0.95rem */
    line-height: 1.6;
}

.google-signin-btn {
    width: 100%;
    padding: 0.9rem 1.25rem; /* Reduced from 1rem 1.5rem */
    font-size: 1rem; /* Reduced from 1.05rem */
}

.login-footer {
    margin-top: 1.75rem; /* Reduced from 2rem */
    padding-top: 1.25rem; /* Reduced from 1.5rem */
    border-top: 1px solid var(--gray-200);
}

.login-footer p {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* ===================================
   4. BUTTON STYLES
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem; /* Reduced from 0.5rem */
    padding: 0.7rem 1.25rem; /* Reduced from 0.75rem 1.5rem */
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem; /* Reduced from 0.95rem */
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn > * {
    position: relative;
    z-index: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 92, 137, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 92, 137, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.btn-sm {
    padding: 0.45rem 0.9rem; /* Reduced from 0.5rem 1rem */
    font-size: 0.85rem; /* Reduced from 0.875rem */
}

.btn-lg {
    padding: 0.9rem 1.75rem; /* Reduced from 1rem 2rem */
    font-size: 1.05rem; /* Reduced from 1.1rem */
}

/* ===================================
   5. ADMIN HEADER
   =================================== */
.admin-header {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 0;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem; /* Reduced from 2rem */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem; /* Reduced from 0.75rem */
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.logo img {
    height: 40px; /* Reduced from 45px */
    transition: var(--transition);
}

.logo span {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem; /* Reduced from 1.2rem */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem; /* Reduced from 1.5rem */
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 0.6rem; /* Reduced from 0.75rem */
    padding: 0.4rem 0.9rem; /* Reduced from 0.5rem 1rem */
    background: var(--gray-50);
    border-radius: var(--radius-full);
    transition: var(--transition);
    cursor: pointer;
}

.admin-info:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}

.admin-avatar {
    width: 36px; /* Reduced from 40px */
    height: 36px; /* Reduced from 40px */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem; /* Reduced from 1rem */
    box-shadow: 0 2px 8px rgba(46, 92, 137, 0.3);
}

#adminName {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem; /* Added for consistency */
}

/* ===================================
   6. DASHBOARD LAYOUT
   =================================== */
.dashboard-section {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-content {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

/* ===================================
   7. ENHANCED SIDEBAR STYLES WITH COLLAPSE
   =================================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.75rem 0; /* Reduced from 2rem 0 */
    box-shadow: var(--shadow-md);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    will-change: width, transform;
    transform: translateX(0);
}

/* Enhanced collapsed state */
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    padding: 1.25rem 0; /* Reduced padding */
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 1.25rem; /* Reduced from 0 1rem 1.5rem */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
}

/* Enhanced sidebar toggle button */
.sidebar-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px; /* Smaller */
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    position: relative;
    overflow: hidden;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-toggle:hover::before {
    opacity: 1;
}

.sidebar-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem; /* Reduced from 0.5rem */
    padding: 0 1rem;
}

.menu-item {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.9rem 1.1rem; /* Reduced from 1rem 1.25rem */
    display: flex;
    align-items: center;
    gap: 0.9rem; /* Reduced from 1rem */
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    white-space: nowrap;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: white;
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(4px);
}

.menu-item.active::before {
    height: 100%;
}

.menu-item i {
    font-size: 1.15rem; /* Reduced from 1.2rem */
    width: 22px; /* Reduced from 24px */
    min-width: 22px;
    text-align: center;
}

.menu-item-text {
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem; /* Added for consistency */
}

.sidebar.collapsed .menu-item-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: translateX(-10px);
}

/* Enhanced menu item icons in collapsed state */
.sidebar.collapsed .menu-item i {
    font-size: 1.25rem; /* Larger icons when collapsed */
    margin: 0;
}

.sidebar.collapsed .menu-item {
    padding: 0.9rem; /* Reduced from 1rem */
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .menu-item:hover {
    transform: translateX(4px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

/* Enhanced tooltips for collapsed sidebar */
.sidebar.collapsed .menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px); /* Closer to sidebar */
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: var(--dark);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .menu-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Arrow for tooltips */
.sidebar.collapsed .menu-item::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-5px);
    border: 6px solid transparent;
    border-right-color: var(--dark);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.sidebar.collapsed .menu-item:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Active state indicator for collapsed sidebar */
.sidebar.collapsed .menu-item.active {
    background: rgba(255, 255, 255, 0.25);
    position: relative;
}

.sidebar.collapsed .menu-item.active::after {
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(230, 74, 46, 0.3);
}

/* Pulse animation for active item */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sidebar.collapsed .menu-item.active i {
    animation: pulse-glow 2s infinite;
}

/* ===================================
   8. MAIN CONTENT - ENHANCED FOR SPACE SAVING
   =================================== */
.main-content {
    flex: 1;
    padding: 1.75rem; /* Reduced from 2.5rem */
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
}

.sidebar.collapsed ~ .main-content {
    max-width: calc(100% - var(--sidebar-width-collapsed));
    margin-left: 0;
    padding: 1.75rem 2rem; /* Slightly more horizontal padding */
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

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

.content-section > h2 {
    color: var(--primary);
    font-size: 1.8rem; /* Reduced from 2rem */
    font-weight: 700;
    margin-bottom: 1.75rem; /* Reduced from 2rem */
}

/* ===================================
   9. COMPACT STATS GRID
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Reduced from 240px */
    gap: 1.25rem; /* Reduced from 1.5rem */
    margin-bottom: 2rem; /* Reduced from 2.5rem */
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem; /* Reduced from 1.75rem */
    display: flex;
    align-items: center;
    gap: 1.1rem; /* Reduced from 1.25rem */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

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

.stat-card:hover::before {
    transform: scaleY(1);
}

.stat-icon {
    width: 56px; /* Reduced from 64px */
    height: 56px;
    min-width: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem; /* Reduced from 1.75rem */
    box-shadow: 0 4px 12px rgba(46, 92, 137, 0.3);
}

.stat-icon.pending {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.stat-icon.approved {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.stat-icon.rejected {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 1.8rem; /* Reduced from 2rem */
    font-weight: 700;
    margin-bottom: 0.2rem; /* Reduced from 0.25rem */
    color: var(--dark);
}

.stat-info p {
    color: var(--gray-600);
    font-size: 0.85rem; /* Reduced from 0.9rem */
    font-weight: 500;
}

/* ===================================
   10. COMPACT SECTION HEADER & FILTERS
   =================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem; /* Reduced from 1.5rem */
    margin-bottom: 1.75rem; /* Reduced from 2rem */
}

.section-header h2 {
    color: var(--primary);
    font-size: 1.6rem; /* Reduced from 1.75rem */
    font-weight: 700;
    margin: 0;
}

.filters-wrapper,
.filters {
    display: flex;
    gap: 0.9rem; /* Reduced from 1rem */
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input {
    padding: 0.65rem 0.9rem; /* Reduced from 0.75rem 1rem */
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-300);
    font-size: 0.9rem; /* Reduced from 0.95rem */
    min-width: 140px; /* Reduced from 150px */
    transition: var(--transition);
    background: white;
    font-family: inherit;
}

.filters select:hover,
.filters input:hover {
    border-color: var(--gray-400);
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 92, 137, 0.1);
}

.filters input[type="text"] {
    min-width: 230px; /* Reduced from 250px */
}

/* ===================================
   11. COMPACT TABLE STYLES
   =================================== */
.applications-table-container {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.75rem; /* Reduced from 2rem */
}

.applications-table {
    width: 100%;
    border-collapse: collapse;
}

.applications-table th,
.applications-table td {
    padding: 0.85rem 1rem; /* Reduced from 1rem 1.25rem */
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.applications-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem; /* Reduced from 0.9rem */
    text-transform: uppercase;
    letter-spacing: 0.4px; /* Reduced from 0.5px */
}

.applications-table tbody tr {
    transition: var(--transition);
}

.applications-table tbody tr:hover {
    background: var(--gray-50);
}

.applications-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===================================
   12. STATUS BADGES
   =================================== */
.status-badge,
.payment-status {
    padding: 0.35rem 0.8rem; /* Reduced from 0.375rem 0.875rem */
    border-radius: var(--radius-full);
    font-size: 0.75rem; /* Reduced from 0.8rem */
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-submitted {
    background: linear-gradient(135deg, #ebf8ff 0%, #d1edff 100%);
    color: #3182ce;
}

.status-under-review {
    background: linear-gradient(135deg, #fefcbf 0%, #fef08a 100%);
    color: #d69e2e;
}

.status-approved {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #38a169;
}

.status-rejected {
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6b6 100%);
    color: #e53e3e;
}

.payment-status-pending {
    background: linear-gradient(135deg, #fefcbf 0%, #fef08a 100%);
    color: #d69e2e;
}

.payment-status-application_paid {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #3182ce;
}

.payment-status-fully_paid {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #38a169;
}

/* ===================================
   13. COMPACT DETAIL VIEW
   =================================== */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem; /* Reduced from 2rem */
    flex-wrap: wrap;
    gap: 1.25rem; /* Reduced from 1.5rem */
}

.detail-header h2 {
    color: var(--primary);
    font-size: 1.6rem; /* Reduced from 1.75rem */
    font-weight: 700;
    margin: 0;
}

.application-actions {
    display: flex;
    gap: 0.9rem; /* Reduced from 1rem */
    align-items: center;
    flex-wrap: wrap;
}

.detail-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.75rem; /* Reduced from 2rem */
    margin-bottom: 1.75rem; /* Reduced from 2rem */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    animation: slideUp 0.4s ease-out;
}

.detail-card h3 {
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    color: var(--primary);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.65rem; /* Reduced from 0.75rem */
    font-size: 1.2rem; /* Reduced from 1.3rem */
    font-weight: 700;
    position: relative;
}

.detail-card h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 55px; /* Reduced from 60px */
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Reduced from 280px */
    gap: 1.25rem; /* Reduced from 1.5rem */
}

.detail-item label {
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
    font-size: 0.85rem; /* Reduced from 0.9rem */
}

.detail-item p {
    color: var(--gray-700);
    font-size: 0.95rem; /* Reduced from 1rem */
}

/* ===================================
   14. COMPACT SUBJECTS & DOCUMENTS
   =================================== */
.subjects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem; /* Reduced from 0.75rem */
}

.subject-tag {
    background: linear-gradient(135deg, #ebf8ff 0%, #d1edff 100%);
    color: var(--primary);
    padding: 0.45rem 0.9rem; /* Reduced from 0.5rem 1rem */
    border-radius: var(--radius-full);
    font-size: 0.85rem; /* Reduced from 0.875rem */
    font-weight: 600;
    transition: var(--transition);
}

.subject-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Reduced from 280px */
    gap: 0.9rem; /* Reduced from 1rem */
}

.document-item {
    display: flex;
    align-items: center;
    gap: 0.9rem; /* Reduced from 1rem */
    padding: 1.1rem; /* Reduced from 1.25rem */
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.document-item:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.document-item i {
    font-size: 1.8rem; /* Reduced from 2rem */
    color: var(--primary);
}

.document-info p {
    font-weight: 600;
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
    color: var(--dark);
    font-size: 0.95rem; /* Added for consistency */
}

.document-info a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem; /* Reduced from 0.875rem */
    font-weight: 500;
}

.document-info a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ===================================
   15. COMPACT STATUS & PAYMENT HISTORY
   =================================== */
.status-history,
.payment-history-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem; /* Reduced from 1.25rem */
}

.status-item,
.payment-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem; /* Reduced from 1rem */
    padding: 1.1rem; /* Reduced from 1.25rem */
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.status-item:hover,
.payment-item:hover {
    background: white;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.payment-item {
    border-left-color: var(--success);
    justify-content: space-between;
}

.payment-item.pending {
    border-left-color: var(--warning);
}

.status-item i {
    font-size: 1.4rem; /* Reduced from 1.5rem */
    color: var(--primary);
    margin-top: 0.2rem; /* Reduced from 0.25rem */
}

.status-content p,
.payment-info p {
    margin-bottom: 0.2rem; /* Reduced from 0.25rem */
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem; /* Added for consistency */
}

.status-date,
.payment-date {
    color: var(--gray-600);
    font-size: 0.82rem; /* Reduced from 0.85rem */
}

.payment-amount {
    font-weight: 700;
    font-size: 1.05rem; /* Reduced from 1.1rem */
    color: var(--success);
}

/* ===================================
   16. COMPACT PAYMENT SUMMARY
   =================================== */
.payment-summary {
    margin-top: 2rem; /* Reduced from 2.5rem */
}

.summary-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.75rem; /* Reduced from 2rem */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.summary-card h4 {
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    color: var(--primary);
    font-size: 1.2rem; /* Reduced from 1.3rem */
    font-weight: 700;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.65rem; /* Reduced from 0.75rem */
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); /* Reduced from 250px */
    gap: 1.1rem; /* Reduced from 1.25rem */
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem; /* Reduced from 0.5rem */
    padding: 1.25rem; /* Reduced from 1.5rem */
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.summary-item span {
    color: var(--gray-600);
    font-size: 0.85rem; /* Reduced from 0.9rem */
    font-weight: 500;
}

.summary-item strong {
    font-size: 1.4rem; /* Reduced from 1.5rem */
    font-weight: 700;
}

/* ===================================
   17. COMPACT RECENT APPLICATIONS
   =================================== */
.recent-applications {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.75rem; /* Reduced from 2rem */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.recent-applications h3 {
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    color: var(--primary);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.65rem; /* Reduced from 0.75rem */
    font-size: 1.2rem; /* Reduced from 1.3rem */
    font-weight: 700;
    position: relative;
}

.recent-applications h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 55px; /* Reduced from 60px */
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

.applications-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem; /* Reduced from 1rem */
}

.application-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem; /* Reduced from 1.25rem */
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: pointer;
}

.application-item:hover {
    background: white;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.app-info h4 {
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem; /* Added for consistency */
}

.app-info p {
    color: var(--gray-600);
    font-size: 0.85rem; /* Reduced from 0.875rem */
}

/* ===================================
   18. COMPACT ANALYTICS SECTION
   =================================== */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); /* Reduced from 450px */
    gap: 1.75rem; /* Reduced from 2rem */
}

.analytics-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.75rem; /* Reduced from 2rem */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

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

.analytics-card h3 {
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    color: var(--primary);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.65rem; /* Reduced from 0.75rem */
    font-size: 1.15rem; /* Reduced from 1.2rem */
    font-weight: 700;
    position: relative;
}

.analytics-card h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 55px; /* Reduced from 60px */
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

.chart-container {
    position: relative;
    height: 280px; /* Reduced from 300px */
}

/* ===================================
   19. COMPACT PAGINATION
   =================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem; /* Reduced from 1.5rem */
    margin-top: 1.75rem; /* Reduced from 2rem */
    padding: 1.25rem; /* Reduced from 1.5rem */
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

#pageInfo {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem; /* Reduced from 0.95rem */
}

.pagination .btn {
    min-width: 110px; /* Reduced from 120px */
}

/* ===================================
   20. LOADING INDICATOR
   =================================== */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-indicator i {
    font-size: 2.8rem; /* Reduced from 3rem */
    color: var(--primary);
    margin-bottom: 0.9rem; /* Reduced from 1rem */
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    font-size: 1.1rem; /* Reduced from 1.2rem */
    color: var(--primary);
    font-weight: 600;
}

.no-data {
    text-align: center;
    padding: 2.5rem; /* Reduced from 3rem */
    color: var(--gray-500);
    font-style: italic;
    font-size: 1rem; /* Reduced from 1.1rem */
}

/* ===================================
   21. TOAST NOTIFICATIONS
   =================================== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px); /* Reduced from 20px */
    right: 16px; /* Reduced from 20px */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced from 12px */
}

.toast {
    background: white;
    padding: 0.9rem 1.25rem; /* Reduced from 1rem 1.5rem */
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced from 12px */
    min-width: 280px; /* Reduced from 300px */
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast i {
    font-size: 1.2rem; /* Reduced from 1.3rem */
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}

/* ===================================
   22. MODAL STYLES
   =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 550px; /* Reduced from 600px */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.25rem 1.75rem; /* Reduced from 1.5rem 2rem */
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.4rem; /* Reduced from 1.5rem */
    font-weight: 700;
}

.close {
    width: 30px; /* Reduced from 32px */
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--gray-600);
    font-size: 1.4rem; /* Reduced from 1.5rem */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close:hover {
    background: var(--gray-200);
    color: var(--dark);
}

.modal-body {
    padding: 1.75rem; /* Reduced from 2rem */
}

.modal-footer {
    padding: 1.25rem 1.75rem; /* Reduced from 1.5rem 2rem */
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.9rem; /* Reduced from 1rem */
    justify-content: flex-end;
}

/* ===================================
   23. SEARCH & FILTER ENHANCEMENTS
   =================================== */
.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 230px; /* Reduced from 250px */
}

.search-wrapper i {
    position: absolute;
    left: 0.9rem; /* Reduced from 1rem */
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.search-wrapper input {
    padding-left: 2.8rem; /* Reduced from 3rem */
}

/* ===================================
   24. ACTION BUTTONS GROUP
   =================================== */
.action-buttons {
    display: flex;
    gap: 0.45rem; /* Reduced from 0.5rem */
}

.action-btn {
    width: 34px; /* Reduced from 36px */
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--gray-50);
    color: var(--primary);
    border-color: var(--primary);
}

.action-btn.view {
    color: var(--info);
}

.action-btn.view:hover {
    background: #ebf8ff;
    border-color: var(--info);
}

.action-btn.edit {
    color: var(--warning);
}

.action-btn.edit:hover {
    background: #fefcbf;
    border-color: var(--warning);
}

.action-btn.delete {
    color: var(--danger);
}

.action-btn.delete:hover {
    background: #fed7d7;
    border-color: var(--danger);
}

/* ===================================
   25. EMPTY STATE
   =================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.75rem; /* Reduced from 4rem 2rem */
}

.empty-state i {
    font-size: 3.5rem; /* Reduced from 4rem */
    color: var(--gray-400);
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
    font-size: 1.4rem; /* Reduced from 1.5rem */
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    font-size: 0.95rem; /* Added for consistency */
}

/* ===================================
   26. SKELETON LOADING
   =================================== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-300) 50%, var(--gray-200) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 15px; /* Reduced from 16px */
    margin-bottom: 7px; /* Reduced from 8px */
}

.skeleton-title {
    height: 22px; /* Reduced from 24px */
    width: 60%;
    margin-bottom: 14px; /* Reduced from 16px */
}

.skeleton-card {
    height: 90px; /* Reduced from 100px */
}

/* ===================================
   27. PROGRESS INDICATORS
   =================================== */
.progress-bar {
    width: 100%;
    height: 7px; /* Reduced from 8px */
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.6s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===================================
   28. BADGE COUNTER
   =================================== */
.badge-counter {
    background: var(--danger);
    color: white;
    font-size: 0.65rem; /* Reduced from 0.7rem */
    font-weight: 700;
    padding: 0.15rem 0.4rem; /* Reduced from 0.2rem 0.5rem */
    border-radius: var(--radius-full);
    position: absolute;
    top: -7px; /* Reduced from -8px */
    right: -7px;
    min-width: 18px; /* Reduced from 20px */
    text-align: center;
}

/* ===================================
   29. TOOLTIPS
   =================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-7px); /* Reduced from -8px */
    padding: 7px 11px; /* Reduced from 8px 12px */
    background: var(--dark);
    color: white;
    font-size: 0.82rem; /* Reduced from 0.85rem */
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent; /* Reduced from 6px */
    border-top-color: var(--dark);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

/* ===================================
   30. MONTHLY PAYMENT SCHEDULE STYLES
   =================================== */

/* Monthly Payments Container */
.monthly-payments-container {
    margin-top: 1.75rem; /* Reduced from 2rem */
    padding: 1.75rem; /* Reduced from 2rem */
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.monthly-payments-container h4 {
    color: var(--primary);
    font-size: 1.2rem; /* Reduced from 1.3rem */
    font-weight: 700;
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
}

.monthly-payments-container > p {
    color: var(--gray-600);
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
}

/* Payment Plan Summary */
.payment-plan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Reduced from 200px */
    gap: 0.9rem; /* Reduced from 1rem */
    margin-bottom: 1.75rem; /* Reduced from 2rem */
    padding: 1.25rem; /* Reduced from 1.5rem */
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.summary-detail {
    display: flex;
    flex-direction: column;
    gap: 0.2rem; /* Reduced from 0.25rem */
}

.summary-detail label {
    font-size: 0.82rem; /* Reduced from 0.85rem */
    color: var(--gray-600);
    font-weight: 500;
}

.summary-detail span {
    font-size: 1.05rem; /* Reduced from 1.1rem */
    color: var(--dark);
    font-weight: 600;
}

.summary-detail.highlight span {
    color: var(--primary);
    font-size: 1.2rem; /* Reduced from 1.25rem */
    font-weight: 700;
}

/* Monthly Payments Grid */
.monthly-payments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Reduced from 280px */
    gap: 1.1rem; /* Reduced from 1.25rem */
}

/* Individual Payment Card */
.monthly-payment-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem; /* Reduced from 1.5rem */
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.monthly-payment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gray-300);
    transition: var(--transition);
}

.monthly-payment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.monthly-payment-card:hover::before {
    background: var(--primary);
}

/* Payment Card States */
.monthly-payment-card.paid {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: var(--success);
}

.monthly-payment-card.paid::before {
    background: var(--success);
}

.monthly-payment-card.overdue {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: var(--danger);
}

.monthly-payment-card.overdue::before {
    background: var(--danger);
}

.monthly-payment-card.upcoming {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: var(--warning);
}

.monthly-payment-card.upcoming::before {
    background: var(--warning);
}

/* Payment Card Header */
.payment-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem; /* Reduced from 1rem */
    padding-bottom: 0.9rem; /* Reduced from 1rem */
    border-bottom: 1px solid var(--gray-200);
}

.payment-month-header h5 {
    color: var(--dark);
    font-size: 1.05rem; /* Reduced from 1.1rem */
    font-weight: 700;
    margin: 0;
}

.payment-status-badge {
    padding: 0.35rem 0.7rem; /* Reduced from 0.375rem 0.75rem */
    border-radius: var(--radius-full);
    font-size: 0.7rem; /* Reduced from 0.75rem */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px; /* Reduced from 0.5px */
    display: inline-flex;
    align-items: center;
    gap: 0.3rem; /* Reduced from 0.375rem */
}

.payment-status-badge i {
    font-size: 0.8rem; /* Reduced from 0.85rem */
}

.payment-status-badge.paid {
    background: var(--success);
    color: white;
}

.payment-status-badge.pending {
    background: var(--warning);
    color: white;
}

.payment-status-badge.overdue {
    background: var(--danger);
    color: white;
}

/* Payment Details */
.payment-details {
    display: flex;
    flex-direction: column;
    gap: 0.65rem; /* Reduced from 0.75rem */
    margin-bottom: 1.1rem; /* Reduced from 1.25rem */
}

.payment-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem; /* Reduced from 0.95rem */
}

.payment-detail-row label {
    color: var(--gray-600);
    font-weight: 500;
}

.payment-detail-row span {
    color: var(--dark);
    font-weight: 600;
}

.payment-detail-row .payment-amount {
    font-size: 1.4rem; /* Reduced from 1.5rem */
    color: var(--primary);
    font-weight: 700;
}

/* Due Date Indicator */
.due-date-indicator {
    display: flex;
    align-items: center;
    gap: 0.45rem; /* Reduced from 0.5rem */
    padding: 0.45rem 0.65rem; /* Reduced from 0.5rem 0.75rem */
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 0.9rem; /* Reduced from 1rem */
    font-size: 0.85rem; /* Reduced from 0.875rem */
}

.due-date-indicator i {
    color: var(--gray-600);
}

.due-date-indicator.warning {
    background: #fef3c7;
    color: #92400e;
}

.due-date-indicator.warning i {
    color: var(--warning);
}

.due-date-indicator.danger {
    background: #fee2e2;
    color: #991b1b;
}

.due-date-indicator.danger i {
    color: var(--danger);
}

/* Payment Action Button */
.pay-monthly-btn {
    width: 100%;
    padding: 0.8rem; /* Reduced from 0.875rem */
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem; /* Reduced from 0.95rem */
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem; /* Reduced from 0.5rem */
}

.pay-monthly-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 92, 137, 0.4);
}

.pay-monthly-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pay-monthly-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--gray-400);
}

.pay-monthly-btn.paid {
    background: var(--success);
    cursor: default;
}

.pay-monthly-btn.paid:hover {
    transform: none;
    box-shadow: none;
}

/* Payment Progress Indicator */
.payment-progress {
    margin-top: 1.75rem; /* Reduced from 2rem */
    padding: 1.25rem; /* Reduced from 1.5rem */
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.payment-progress h5 {
    color: var(--primary);
    font-size: 0.95rem; /* Reduced from 1rem */
    font-weight: 700;
    margin-bottom: 0.9rem; /* Reduced from 1rem */
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Reduced from 150px */
    gap: 0.9rem; /* Reduced from 1rem */
    margin-bottom: 0.9rem; /* Reduced from 1rem */
}

.progress-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem; /* Reduced from 0.25rem */
}

.progress-stat label {
    font-size: 0.82rem; /* Reduced from 0.85rem */
    color: var(--gray-600);
}

.progress-stat span {
    font-size: 1.2rem; /* Reduced from 1.25rem */
    font-weight: 700;
    color: var(--primary);
}

.progress-bar-container {
    width: 100%;
    height: 11px; /* Reduced from 12px */
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.4rem; /* Reduced from 0.5rem */
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.6s ease-out;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

/* Payment History Summary */
.payment-history-summary {
    margin-top: 1.75rem; /* Reduced from 2rem */
    padding: 1.25rem; /* Reduced from 1.5rem */
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.payment-history-summary h5 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.9rem; /* Reduced from 1rem */
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem; /* Reduced from 0.875rem */
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--gray-50);
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem; /* Reduced from 0.25rem */
}

.history-item-info span {
    font-size: 0.85rem; /* Reduced from 0.9rem */
    color: var(--gray-600);
}

.history-item-amount {
    font-size: 1.05rem; /* Reduced from 1.1rem */
    font-weight: 700;
    color: var(--success);
}

/* Empty State for Payments */
.no-payments-message {
    text-align: center;
    padding: 2.5rem 1.75rem; /* Reduced from 3rem 2rem */
    color: var(--gray-500);
}

.no-payments-message i {
    font-size: 2.8rem; /* Reduced from 3rem */
    color: var(--gray-400);
    margin-bottom: 0.9rem; /* Reduced from 1rem */
}

.no-payments-message h4 {
    color: var(--gray-700);
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
}

/* ===================================
   31. RESPONSIVE DESIGN - TABLET
   =================================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .monthly-payments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   32. COLLAPSIBLE SECTIONS - FIXED
   =================================== */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    color: var(--primary);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.65rem; /* Reduced from 0.75rem */
    font-size: 1.2rem; /* from h3 */
    font-weight: 700;   /* from h3 */
    position: relative;
}

.collapsible-header h3 {
    /* h3 is now just a text container, remove its individual styling */
    margin: 0;
    padding: 0;
    border: none;
    font-size: inherit; /* Inherit from parent */
    font-weight: inherit; /* Inherit from parent */
    color: inherit; /* Inherit from parent */
}

.collapsible-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 55px; /* Reduced from 60px */
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

/* Hide the original ::after on the h3 when it's inside a collapsible header */
.collapsible-header h3::after {
    display: none; 
}

.collapsible-header .collapse-icon {
    font-size: 1.1rem; /* Reduced from 1.2rem */
    color: var(--primary);
    transition: var(--transition-fast);
}

.collapsible-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* FIXED: Simpler collapsible content styling */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

/* When header is NOT collapsed, show the content */
.collapsible-header:not(.collapsed) + .collapsible-content,
.collapsible-header:not(.collapsed) ~ .collapsible-content {
    max-height: 10000px; /* Large value to accommodate content */
}

/* Monthly Payment Grid styles */
.monthly-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Payment History Header */
.payment-history-header {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.payment-summary-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.payment-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.payment-summary-item span {
    color: var(--gray-600);
    font-weight: 500;
}

.payment-summary-item strong {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===================================
   33. MOBILE RESPONSIVENESS
   =================================== */
@media (max-width: 768px) {
    /* Mobile sidebar handling */
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        transform: translateX(-100%);
        z-index: 1000;
        width: 260px;
        box-shadow: var(--shadow-xl);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 260px;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed.open {
        transform: translateX(0);
    }
    
    .main-content {
        max-width: 100%;
        padding: 1.25rem; /* Reduced from 1.5rem */
    }
    
    /* Mobile toggle button */
    .mobile-toggle {
        display: flex !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        background: var(--primary);
        color: white;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        box-shadow: var(--shadow-md);
        border: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: var(--transition);
    }
    
    .mobile-toggle:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-lg);
    }
    
    /* Compact mobile layouts */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem; /* Reduced from 1rem */
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem; /* Reduced from 1.25rem */
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem; /* Reduced from 1.75rem */
    }
    
    /* Smaller font sizes on mobile */
    .content-section > h2 {
        font-size: 1.6rem; /* Reduced from 1.8rem */
    }
    
    .section-header h2 {
        font-size: 1.4rem; /* Reduced from 1.6rem */
    }
    
    /* Adjust padding on mobile */
    .header-content {
        padding: 0 1rem; /* Reduced from 1.5rem */
    }
    
    .detail-card,
    .recent-applications,
    .analytics-card {
        padding: 1.25rem; /* Reduced from 1.75rem */
    }
    
    /* Collapsible sections on mobile */
    .collapsible-header {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .collapsible-content {
        transition: max-height 0.3s ease-out;
    }
    
    .monthly-payment-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   34. SPACE-SAVING UTILITY CLASSES
   =================================== */

/* Compact text */
.text-compact {
    font-size: 0.85rem;
    line-height: 1.35;
}

/* Tight spacing */
.spacing-tight {
    margin: 0.4rem 0;
    padding: 0.4rem;
}

/* Minimal tables */
.table-minimal th,
.table-minimal td {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
}

/* Compact forms */
.form-compact .form-group {
    margin-bottom: 0.9rem;
}

.form-compact input,
.form-compact select {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
}

/* Grid with optimal spacing */
.grid-compact {
    gap: 0.9rem;
    margin: 0.9rem 0;
}

/* ===================================
   35. DENSITY OPTIONS
   =================================== */

body.density-compact {
    --spacing-md: 10px;
    --spacing-lg: 15px;
    --spacing-xl: 20px;
}

body.density-compact .stat-card {
    padding: 1.1rem;
}

body.density-compact .applications-table th,
body.density-compact .applications-table td {
    padding: 0.65rem;
}

body.density-compact .detail-card {
    padding: 1.25rem;
}

/* ===================================
   36. IMPROVED LOADING STATES
   =================================== */

/* Skeleton loading for sidebar */
.sidebar-loading .menu-item {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===================================
   37. ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Focus states for collapsed sidebar */
.sidebar.collapsed .menu-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .sidebar {
        border-right: 2px solid white;
    }
    
    .sidebar.collapsed .menu-item.active {
        outline: 2px solid white;
    }
}

/* ===================================
   38. PRINT STYLES
   =================================== */

@media print {
    .sidebar,
    .admin-header,
    .btn,
    .filters {
        display: none !important;
    }
    
    .main-content {
        max-width: 100%;
        padding: 0;
    }
    
    .content-section {
        display: block !important;
    }
}

/* ===================================
   39. PERFORMANCE OPTIMIZATIONS
   =================================== */

/* Hardware acceleration for animations */
.stat-card,
.menu-item,
.btn,
.sidebar-toggle {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   40. ADDITIONAL FIXES FOR SPECIFIC ELEMENTS
   =================================== */

/* Fix for modal close button - ensure both classes work */
.close, .modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--gray-600);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close:hover, .modal-close:hover {
    background: var(--gray-200);
    color: var(--dark);
}

/* Form controls */
.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 92, 137, 0.1);
}

.form-full {
    grid-column: 1 / -1;
}
