:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --primary-50: #eef2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.15);
    --nav-height: 70px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overscroll-behavior: none;
}

/* ============================================
   LOGIN SCREEN STYLES
   ============================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.login-overlay.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 400px;
    animation: loginSlideIn 0.4s ease;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.login-logo svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-form {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-form h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.login-field input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    transition: all 0.2s ease;
    background: var(--gray-50);
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.login-field input::placeholder {
    color: var(--gray-400);
}

.login-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 1.25rem;
}

.login-form.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* Locked app state */
.app.locked {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

/* ============================================
   USER DISPLAY IN HEADER
   ============================================ */

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: capitalize;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Mobile responsive login/user styles */
@media (max-width: 480px) {
    .login-form {
        padding: 1.5rem;
    }

    .login-logo h1 {
        font-size: 1.5rem;
    }

    .user-details {
        display: none;
    }

    .user-info {
        padding: 0.375rem;
        gap: 0.5rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

/* ============================================
   MAIN APP STYLES
   ============================================ */

.app {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--nav-height);
}

/* Header - App Style */
header {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    padding: 0 1.25rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: none;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
}

.notification-bell:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
}

header h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}

/* Hide desktop nav in header */
header nav {
    display: none;
}

/* Bottom Navigation - Mobile App Style */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--gray-200);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 0.625rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    gap: 0.25rem;
    padding: 0.5rem;
}

.bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

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

.bottom-nav .nav-item span {
    margin-top: 2px;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem;
    padding-bottom: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.view {
    display: none;
    animation: fadeIn 0.25s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Page Title */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

/* View Title Row with Export */
.view-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.view-title-row .page-title {
    margin-bottom: 0;
}

.export-btn {
    background: white;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
    gap: 0.375rem;
}

.export-btn:active {
    background: var(--gray-50);
}

.export-btn svg {
    flex-shrink: 0;
}

/* Search Box */
.search-box {
    margin-bottom: 0.75rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--gray-400);
}

/* Stats Grid - Card Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chart-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-card-header {
    padding: 1rem 1.25rem 0.5rem;
}

.chart-card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.chart-container {
    position: relative;
    padding: 0.5rem 1rem 1rem;
    height: 200px;
}

.chart-container-small {
    height: 160px;
}

.chart-full-width {
    margin-bottom: 1rem;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Growth Analysis Card */
.growth-analysis-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.growth-analysis-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.growth-analysis-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.growth-analysis-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

.growth-analysis-header p {
    font-size: 0.8125rem;
    opacity: 0.85;
    margin: 0.25rem 0 0 0;
}

.growth-analysis-body {
    padding: 1.25rem;
}

/* Growth Metrics Grid */
.growth-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.growth-metric-card {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.growth-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.growth-metric-card.primary {
    background: linear-gradient(135deg, var(--primary-50) 0%, #e0e7ff 100%);
    border: 1px solid var(--primary-light);
}

.growth-metric-card.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid var(--success-light);
}

.growth-metric-card.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid var(--warning-light);
}

.growth-metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.growth-metric-card.primary .growth-metric-value { color: var(--primary); }
.growth-metric-card.success .growth-metric-value { color: var(--success); }
.growth-metric-card.warning .growth-metric-value { color: var(--warning); }

.growth-metric-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Growth Table */
.growth-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.growth-section-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.growth-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.growth-table thead {
    background: var(--gray-100);
}

.growth-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.growth-table th:not(:first-child) {
    text-align: right;
}

.growth-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-100);
}

.growth-table td:not(:first-child) {
    text-align: right;
}

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

.growth-target-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8125rem;
}

.growth-additional {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    color: var(--success);
}

.growth-additional svg {
    width: 14px;
    height: 14px;
}

/* Year-over-Year Grid */
.yoy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.yoy-card {
    background: var(--gray-50);
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--gray-100);
}

.yoy-year {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.yoy-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.yoy-growth {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    display: inline-block;
}

.yoy-growth.positive {
    background: var(--success-light);
    color: var(--success);
}

.yoy-growth.negative {
    background: var(--danger-light);
    color: var(--danger);
}

.yoy-growth.neutral {
    background: var(--gray-200);
    color: var(--gray-500);
}

@media (max-width: 480px) {
    .growth-metrics-grid {
        grid-template-columns: 1fr;
    }

    .growth-table {
        font-size: 0.8125rem;
    }

    .growth-table th,
    .growth-table td {
        padding: 0.5rem 0.75rem;
    }

    .yoy-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .growth-analysis-header {
        padding: 1rem;
    }

    .growth-analysis-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container-small {
        height: 180px;
    }
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card:nth-child(1)::before { background: var(--primary); }
.stat-card:nth-child(2)::before { background: var(--gray-400); }
.stat-card:nth-child(3)::before { background: var(--success); }
.stat-card:nth-child(4)::before { background: var(--warning); }

.stat-card h3 {
    font-size: 0.6875rem;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

/* Section Cards */
.section-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.section-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.section-card-body {
    padding: 0;
}

/* List Items - App Style */
.list-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.list-item:active {
    background: var(--gray-50);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.list-item-value {
    text-align: right;
    margin-left: 1rem;
}

.list-item-value .amount {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.list-item-value .label {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.list-item-arrow {
    margin-left: 0.75rem;
    color: var(--gray-300);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:active {
    transform: scale(0.95);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.view-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

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

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

.btn.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.btn.success {
    background: var(--success-light);
    color: var(--success);
}

.btn.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.btn.warning:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn.small,
.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    min-height: 36px;
    border-radius: var(--radius-xs);
}

.btn.secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn.secondary:hover {
    background: var(--gray-200);
}

.btn.outline {
    background: white;
    border: 1.5px solid var(--gray-200);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* University Cards */
.university-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.university-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.university-card .country {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.university-card .info-section {
    margin-bottom: 1rem;
}

.university-card .info-section h4 {
    font-size: 0.6875rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    font-weight: 600;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.info-chip .label {
    color: var(--gray-600);
    font-weight: 500;
}

.info-chip .value {
    color: var(--gray-400);
    margin-left: 0.375rem;
}

.university-card .card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.university-card .card-actions .btn {
    flex: 1;
}

/* Filters */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    padding: 0.625rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 50px;
    font-size: 0.875rem;
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-chip:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-chip.active {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

/* Student Cards */
.student-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.student-card:active {
    transform: scale(0.99);
}

.student-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.student-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.student-card-info {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.student-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.student-card-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.active {
    background: var(--success-light);
    color: #059669;
}

.status-badge.dropped {
    background: var(--danger-light);
    color: #dc2626;
}

.status-badge.graduated {
    background: var(--primary-light);
    color: var(--primary);
}

/* Reports */
.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.year-selector span {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
    color: var(--gray-800);
}

.year-selector .btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.25rem;
}

.report-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.report-card-header {
    padding: 1rem 1.25rem;
    background: var(--primary-50);
    border-bottom: 1px solid var(--primary-light);
}

.report-card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.report-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.report-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.report-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.report-item-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: var(--gray-100);
    border-radius: 50px;
    color: var(--gray-600);
}

.report-item-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.report-item-details .label {
    color: var(--gray-500);
}

.report-item-details .value {
    font-weight: 600;
    color: var(--gray-700);
}

.report-total {
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid var(--gray-200);
}

.report-total .label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
}

.report-total .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Modal - Full Screen on Mobile */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.close-btn {
    background: var(--gray-100);
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--gray-600);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:active {
    background: var(--gray-200);
}

.modal-content {
    background: var(--gray-100);
    width: 100%;
    max-width: 100%;
}

.modal-content.large {
    max-width: 100%;
}

/* Forms */
form {
    padding: 1rem;
}

.form-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.form-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    min-height: 52px;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-section {
    margin-bottom: 1rem;
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.form-section-header h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xs);
    font-size: 0.9375rem;
    min-height: 48px;
}

.form-row .delete-btn {
    padding: 0.75rem;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-weight: 600;
    min-height: 48px;
}

.form-actions {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 0.75rem;
}

.form-actions .btn {
    flex: 1;
}

/* Inline Table for Forms */
.inline-table {
    width: 100%;
}

.inline-table th {
    font-size: 0.6875rem;
    padding: 0.5rem;
    text-align: left;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
}

.inline-table td {
    padding: 0.375rem;
}

.inline-table input,
.inline-table select {
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    width: 100%;
    min-height: 44px;
}

/* Student Detail */
.student-info {
    padding: 1rem;
}

.info-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.info-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.info-item span {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9375rem;
}

.commission-list {
    margin-top: 0;
}

.commission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.commission-item-left h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}

.commission-item-left p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.commission-item-right {
    text-align: right;
}

.commission-item-right .amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.commission-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.commission-status.paid {
    background: var(--success-light);
    color: #059669;
}

.commission-status.pending {
    background: var(--warning-light);
    color: #d97706;
}

.commission-status.future {
    background: var(--gray-100);
    color: var(--gray-500);
}

.commission-status.not-applicable {
    background: var(--gray-100);
    color: var(--gray-400);
    text-decoration: line-through;
}

/* Student Actions Container - Redesigned for Mobile */
.student-actions-container {
    padding: 1rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.student-actions-primary {
    display: flex;
}

.student-actions-primary .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
}

.student-actions-secondary {
    display: flex;
}

.student-actions-secondary .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Action Tiles Grid */
.student-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.875rem 0.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
    min-height: 70px;
}

.action-tile svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.action-tile:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.action-tile.warning-tile svg {
    color: var(--warning);
}

.action-tile.warning-tile:hover {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}

.action-tile.danger-tile svg {
    color: var(--danger);
}

.action-tile.danger-tile:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* Danger Zone - Collapsible */
.student-danger-zone {
    margin-top: 0.5rem;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
}

.danger-zone-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.danger-zone-toggle::-webkit-details-marker {
    display: none;
}

.danger-zone-toggle .chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.student-danger-zone[open] .danger-zone-toggle .chevron {
    transform: rotate(180deg);
}

.student-danger-zone[open] .danger-zone-toggle {
    color: var(--danger);
    border-bottom: 1px dashed var(--gray-200);
}

.danger-zone-content {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.danger-zone-content p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0 0 0.75rem 0;
}

.danger-zone-content .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Legacy styles - keep for backwards compatibility */
.student-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    position: sticky;
    bottom: 0;
}

.student-actions .btn {
    width: 100%;
}

/* Student Delete Section in View Modal - Legacy */
.student-delete-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
    border: 1px dashed rgba(239, 68, 68, 0.3);
    border-radius: 8px;
}

.delete-section-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.delete-section-warning svg {
    color: #f59e0b;
    flex-shrink: 0;
}

.delete-student-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.delete-student-btn svg {
    flex-shrink: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--gray-300);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

/* Hide desktop elements on mobile, show mobile elements */
.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

/* Dashboard table - convert to list on mobile */
.dashboard-table {
    display: none;
}

/* Desktop Styles */
@media (min-width: 768px) {
    :root {
        --nav-height: 0px;
    }

    .app {
        padding-bottom: 0;
    }

    header {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        justify-content: space-between;
        padding: 0 2rem;
        height: 64px;
    }

    header h1 {
        color: white;
    }

    header nav {
        display: flex;
        gap: 0.5rem;
    }

    .nav-btn {
        background: rgba(255,255,255,0.15);
        border: none;
        color: rgba(255,255,255,0.9);
        padding: 0.5rem 1rem;
        border-radius: 50px;
        cursor: pointer;
        font-size: 0.875rem;
        font-weight: 500;
    }

    .nav-btn:hover {
        background: rgba(255,255,255,0.25);
    }

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

    .bottom-nav {
        display: none;
    }

    main {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .fab {
        display: none;
    }

    .desktop-only {
        display: block;
    }

    .desktop-only.desktop-flex-end {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 1rem;
    }

    .mobile-only {
        display: none;
    }

    .dashboard-table {
        display: block;
        background: white;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
    }

    .dashboard-table h2 {
        padding: 1.25rem;
        border-bottom: 1px solid var(--gray-100);
        font-size: 1rem;
        font-weight: 600;
    }

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

    th, td {
        padding: 1rem 1.25rem;
        text-align: left;
    }

    th {
        background: var(--gray-50);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    td {
        border-bottom: 1px solid var(--gray-100);
    }

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

    .universities-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 1rem;
    }

    .students-list-desktop {
        display: block;
    }

    .students-list-mobile {
        display: none;
    }

    .modal {
        background: rgba(0,0,0,0.5);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }

    .modal.active {
        display: flex;
        animation: fadeIn 0.2s ease;
    }

    .modal-content {
        background: white;
        border-radius: var(--radius);
        max-width: 500px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content.large {
        max-width: 700px;
    }

    /* Commission Receipt Modal - Desktop Layout */
    #commission-receipt-modal .modal-content {
        max-width: 700px;
    }

    #commission-receipt-modal .receipt-students-list {
        max-height: 250px;
    }

    #commission-receipt-modal .student-select-item {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }

    #commission-receipt-modal .student-select-info {
        flex-direction: row;
        gap: 1rem;
    }

    #commission-receipt-modal .student-select-details {
        white-space: nowrap;
    }

    .form-actions {
        position: relative;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .student-actions {
        position: relative;
        flex-direction: row;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .student-actions .btn {
        width: auto;
        flex: 1;
    }

    /* New Student Actions - Desktop */
    .student-actions-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
        background: white;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .student-actions-primary {
        flex: 0 0 auto;
    }

    .student-actions-primary .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .student-actions-grid {
        flex: 1;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .action-tile {
        flex-direction: row;
        min-height: auto;
        padding: 0.625rem 1rem;
        gap: 0.5rem;
        font-size: 0.8125rem;
    }

    .action-tile svg {
        width: 18px;
        height: 18px;
    }

    .student-danger-zone {
        flex: 0 0 100%;
        margin-top: 0;
    }

    .danger-zone-toggle {
        padding: 0.5rem 1rem;
    }

    .danger-zone-content {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem 1rem;
    }

    .danger-zone-content p {
        margin: 0;
        flex: 1;
    }

    .danger-zone-content .btn {
        width: auto;
        flex: 0 0 auto;
    }

    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .app {
        padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }

    .bottom-nav {
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }

    .fab {
        bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
    }

    main {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

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

.toggle-btn.active {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

/* Program Card in University Form */
.program-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.program-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.program-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.program-card-info {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.program-card-commission {
    font-size: 0.75rem;
    color: var(--gray-400);
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.program-card-commission strong {
    color: var(--gray-600);
}

.program-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.program-card-actions .btn {
    flex: 1;
    min-height: 40px;
}

/* Commission Year Row */
.commission-year-row {
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    padding: 0.875rem;
    margin-bottom: 0.5rem;
}

.commission-year-row label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.commission-year-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.commission-year-inputs select,
.commission-year-inputs input {
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    min-height: 44px;
    background: white;
}

.commission-year-inputs select:focus,
.commission-year-inputs input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Empty programs state */
.programs-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Nationality Rates */
.nationality-rates-empty {
    text-align: center;
    padding: 1rem;
    color: var(--gray-400);
    font-size: 0.8125rem;
    font-style: italic;
}

.nationality-rate-card {
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
}

.nationality-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.nationality-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9375rem;
}

.nationality-rate-info {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Import Preview Styles */
.import-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.import-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    gap: 0.75rem;
}

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

.import-item.valid {
    background: var(--success-light);
}

.import-item.warning {
    background: var(--warning-light);
}

.import-item.duplicate {
    background: var(--gray-50);
}

.import-status {
    font-size: 1rem;
    flex-shrink: 0;
}

.import-name {
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.import-detail {
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-align: right;
}

.import-tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
}

.import-tag.duplicate {
    background: var(--gray-200);
    color: var(--gray-600);
}

@media (max-width: 480px) {
    .import-item {
        flex-wrap: wrap;
    }

    .import-detail {
        width: 100%;
        text-align: left;
        padding-left: 1.75rem;
        margin-top: 0.25rem;
    }
}

/* Settings Section - Modern App Style */
.settings-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.settings-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-section-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.settings-section-title p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: 0.125rem 0 0 0;
}

.settings-section-body {
    padding: 1rem 1.25rem;
}

/* Settings List Items */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-list-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-list-item:hover {
    background: var(--gray-100);
}

.settings-list-item:active {
    transform: scale(0.99);
}

.settings-list-item.danger:hover {
    background: #fef2f2;
}

.settings-list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-list-item-content {
    flex: 1;
    min-width: 0;
}

.settings-list-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-800);
}

.settings-list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.settings-list-item-arrow {
    color: var(--gray-400);
    flex-shrink: 0;
}

/* Currency Rate Card */
.currency-rate-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.currency-rate-card:hover {
    background: var(--gray-100);
}

.currency-rate-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.currency-rate-code {
    width: 48px;
    height: 48px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.currency-rate-details {
    display: flex;
    flex-direction: column;
}

.currency-rate-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-800);
}

.currency-rate-value {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.currency-rate-actions {
    display: flex;
    gap: 0.5rem;
}

.currency-rate-actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.currency-rate-actions .edit-btn {
    background: var(--primary-50);
    color: var(--primary);
}

.currency-rate-actions .edit-btn:hover {
    background: var(--primary);
    color: white;
}

.currency-rate-actions .delete-btn {
    background: var(--danger-light);
    color: var(--danger);
}

.currency-rate-actions .delete-btn:hover {
    background: var(--danger);
    color: white;
}

/* Data Statistics Grid */
.data-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.data-stat-item {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.data-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.data-stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* About Section */
.about-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-50) 0%, #e0f2fe 100%);
    border-radius: var(--radius-sm);
}

.about-logo {
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--primary);
    flex-shrink: 0;
}

.about-details h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.about-details .version {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
    margin: 0.25rem 0;
}

.about-details .description {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.4;
}

.about-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.about-footer p {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin: 0;
}

/* Changelog Section */
.changelog-section {
    margin-top: 1rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 0.625rem;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.changelog-section h5 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.625rem 0;
}

.changelog-list {
    margin: 0;
    padding: 0 0 0 1.125rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.changelog-list li {
    margin-bottom: 0.375rem;
}

.changelog-list li:last-child {
    margin-bottom: 0;
}

.changelog-list strong {
    color: var(--text);
    font-weight: 600;
}

/* Empty State for Currency */
.currency-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-400);
}

.currency-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.currency-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* Legacy support - keep old class for backwards compatibility */
.settings-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.settings-card-header {
    margin-bottom: 1rem;
}

.settings-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.settings-card-header p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Currency Rate Row - Legacy */
.currency-rate-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    margin-bottom: 0.5rem;
    align-items: center;
}

.currency-rate-row input {
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xs);
    font-size: 0.9375rem;
    min-height: 44px;
    background: white;
}

.currency-rate-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.currency-rate-row .delete-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile adjustments for settings */
@media (max-width: 480px) {
    .data-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-info {
        flex-direction: column;
        text-align: center;
    }

    .settings-section-header {
        padding: 0.875rem 1rem;
    }

    .settings-section-body {
        padding: 0.875rem 1rem;
    }
}

/* Contract Card */
.contract-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary);
}

.contract-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.contract-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.contract-card-dates {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.contract-card-commission {
    font-size: 0.8125rem;
    color: var(--gray-600);
    padding: 0.5rem 0.75rem;
    background: var(--primary-50);
    border-radius: var(--radius-xs);
}

.contract-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.contract-card-actions .btn {
    flex: 1;
    min-height: 40px;
}

.contracts-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    font-style: italic;
}

/* Sub-agents Search */
.subagents-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.subagents-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
}

.subagents-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.subagents-search-input::placeholder {
    color: var(--gray-400);
}

.subagents-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

/* Sub-agent Card */
.subagent-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.subagent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.subagent-card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.subagent-card-header .region {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-xs);
}

.type-badge.org-type {
    background: var(--primary-light);
    color: var(--primary);
}

.type-badge.person-type {
    background: var(--success-light);
    color: var(--success);
}

.form-section-divider {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0.75rem;
}

.subagent-commission-info {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--warning-light);
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    color: var(--warning);
    font-weight: 600;
}

.subagent-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
}

.subagent-stat {
    text-align: center;
}

.subagent-stat .label {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.subagent-stat .value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
}

.subagent-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.subagent-card-actions .btn {
    flex: 1;
}

.subagents-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.subagents-empty p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

/* Subagents List Grid */
@media (min-width: 768px) {
    .subagents-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 1rem;
    }
}

/* Sub-agent Bank Status */
.subagent-bank-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.subagent-bank-status.has-bank {
    background: var(--success-light);
    color: var(--success);
}

.subagent-bank-status.no-bank {
    background: var(--warning-light);
    color: var(--warning);
}

.subagent-bank-status .bank-icon {
    font-weight: 700;
}

/* Sub-agent Detail Modal */
.subagent-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subagent-detail .info-card {
    padding: 1rem;
    border-radius: var(--radius);
}

.subagent-detail .info-card-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.subagent-detail .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.subagent-detail .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.subagent-detail .info-item .label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.subagent-detail .info-item .value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Record ID Banner */
.record-id-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.record-id-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
}

.record-id-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: white;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.05em;
}

.btn-icon-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xs);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
}

.btn-icon-small:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Agent Contract Items */
.agent-contract-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.agent-contract-item.active {
    border-left: 3px solid var(--success);
}

.agent-contract-item.expired {
    border-left: 3px solid var(--gray-400);
    opacity: 0.7;
}

.contract-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.contract-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contract-name {
    font-weight: 600;
    color: var(--gray-900);
}

.contract-status-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.contract-status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.contract-status-badge.expired {
    background: var(--gray-100);
    color: var(--gray-500);
}

.contract-actions {
    display: flex;
    gap: 0.25rem;
}

.contract-item-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
}

@media (min-width: 480px) {
    .contract-item-details {
        grid-template-columns: repeat(4, 1fr);
    }
}

.contract-detail {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.contract-detail .detail-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 500;
}

.contract-detail .detail-value {
    font-size: 0.875rem;
    color: var(--gray-900);
}

.contract-detail .rate-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-xs);
    font-weight: 600;
    color: var(--primary);
}

.contract-detail .file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    text-decoration: none;
}

.contract-detail .file-link:hover {
    text-decoration: underline;
}

.contract-notes {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.8125rem;
    color: var(--gray-600);
    font-style: italic;
}

/* Contract Upload Area */
.contract-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.contract-upload-area .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    color: var(--gray-500);
}

.contract-upload-area .upload-placeholder:hover {
    color: var(--primary);
}

.contract-upload-area .upload-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
}

.contract-upload-area .file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
}

/* Nested Modal */
.modal-nested {
    z-index: 2500;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
    align-items: flex-start;
    justify-content: center;
}

.modal-nested.active {
    display: flex;
}

.modal-nested .modal-content {
    max-width: 500px;
    width: 100%;
    background: white;
    border-radius: 16px;
    margin: 2rem auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: nestedSlideIn 0.2s ease;
}

@keyframes nestedSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* No items message */
.no-items-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--gray-500);
    text-align: center;
    font-size: 0.875rem;
}

/* Agent Document Items */
.agent-document-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.document-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: var(--radius-sm);
    color: var(--primary);
    flex-shrink: 0;
}

.document-item-info {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.document-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.document-type-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--gray-100);
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.document-filename {
    color: var(--gray-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.document-notes {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    font-style: italic;
}

.document-item-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.document-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.document-upload-area .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    color: var(--gray-500);
}

.document-upload-area .upload-placeholder:hover {
    color: var(--primary);
}

.document-upload-area .upload-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
}

.document-upload-area .file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
}

/* Detail Documents List (in agent detail view) */
.detail-documents-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-document-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
}

.detail-document-item .doc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: var(--radius-xs);
    color: var(--gray-500);
}

.detail-document-item .doc-info {
    flex: 1;
}

.detail-document-item .doc-name {
    font-weight: 500;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.detail-document-item .doc-type {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

/* Detail Contracts List (in agent detail view) */
.detail-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-contract-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border-left: 3px solid var(--success);
}

.detail-contract-item.expired {
    border-left-color: var(--gray-400);
    opacity: 0.8;
}

.detail-contract-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.detail-contract-header .contract-name {
    font-weight: 600;
    color: var(--gray-900);
}

.detail-contract-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.detail-contract-info .rate {
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-xs);
}

/* Commission Summary Grid */
.commission-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .commission-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.commission-stat {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
}

.commission-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.commission-stat .stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Pending Request Notice */
.pending-request-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
}

/* Sub-agent Students List */
.subagent-students-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.subagent-student-item {
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    padding: 0.875rem;
    border: 1px solid var(--gray-100);
}

.student-main-info {
    margin-bottom: 0.5rem;
}

.student-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.student-name-row strong {
    font-size: 0.9375rem;
    color: var(--gray-900);
}

.student-meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.student-tuition-info {
    margin-bottom: 0.5rem;
}

.tuition-bar-container {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.tuition-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.tuition-text {
    font-size: 0.75rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.paid-badge {
    background: var(--success-light);
    color: var(--success);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-xs);
    font-size: 0.6875rem;
    font-weight: 600;
}

.student-commission-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.student-commission-info .commission-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

/* Request History */
.request-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.request-history-item {
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--gray-300);
}

.request-history-item.pending {
    border-left-color: var(--warning);
    background: var(--warning-light);
}

.request-history-item.approved {
    border-left-color: var(--success);
    background: var(--success-light);
}

.request-history-item.rejected {
    border-left-color: var(--danger);
    background: var(--danger-light);
}

.request-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.request-date {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.request-amount {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-900);
}

.request-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.processed-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.request-notes {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-top: 0.375rem;
    font-style: italic;
}

/* Eligible Student Item (Commission Request) */
.eligible-student-item {
    margin-bottom: 0.5rem;
}

.eligible-student-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background 0.2s ease;
}

.eligible-student-item label:hover {
    background: var(--gray-100);
}

.eligible-student-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.eligible-student-item .student-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.eligible-student-item .student-info strong {
    font-size: 0.9375rem;
}

.eligible-student-item .student-info .meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.eligible-student-item .commission-amount {
    font-weight: 600;
    color: var(--success);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.active {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.dropped {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.graduated {
    background: var(--primary-50);
    color: var(--primary);
}

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

.status-badge.approved {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.rejected {
    background: var(--danger-light);
    color: var(--danger);
}

/* Badge in card header */
.subagent-card-header .badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge.success {
    background: var(--success-light);
    color: var(--success);
}

.badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Admin Panel Styles */
.admin-panel {
    background: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 1.5rem;
}

.admin-panel-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.admin-panel-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.375rem;
}

.admin-panel-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-panel-icon svg {
    width: 20px;
    height: 20px;
}

.admin-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-panel-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-panel-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
    padding-left: calc(36px + 0.75rem);
}

.admin-panel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.admin-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg);
}

.admin-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.admin-stat-label {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.admin-panel-body {
    padding: 1.25rem;
}

/* Admin Empty State */
.admin-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.admin-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    margin-bottom: 1rem;
}

.admin-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5rem 0;
}

.admin-empty-state p {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin: 0;
}

/* Request Cards Grid */
.request-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .request-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Request Card */
.request-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.request-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.request-card.warning {
    border-left: 3px solid #f59e0b;
}

.request-card.urgent {
    border-left: 3px solid #ef4444;
}

.request-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.request-agent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.request-agent-info {
    flex: 1;
    min-width: 0;
}

.request-agent-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.request-card.warning .request-time {
    color: #f59e0b;
}

.request-card.urgent .request-time {
    color: #ef4444;
    font-weight: 500;
}

.request-amount-badge {
    padding: 0.5rem 0.875rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.request-card-body {
    padding: 1rem;
}

.request-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.request-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
    background: var(--bg);
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
}

.request-meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.request-meta-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.request-notes {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.875rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
    font-style: italic;
}

.request-notes svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    opacity: 0.6;
}

.request-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.request-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.request-action-btn svg {
    width: 16px;
    height: 16px;
}

.request-action-btn.approve {
    background: #10b981;
    color: white;
}

.request-action-btn.approve:hover {
    background: #059669;
}

.request-action-btn.reject {
    background: #ef4444;
    color: white;
}

.request-action-btn.reject:hover {
    background: #dc2626;
}

.request-action-btn.secondary {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* Keep backward compatibility */
.btn.success {
    background: var(--success);
    color: white;
}

.btn.success:hover {
    background: #059669;
}

.btn.small svg {
    width: 14px;
    height: 14px;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-panel-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-panel-subtitle {
        padding-left: 0;
    }

    .request-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .request-action-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .admin-panel-header {
        padding: 1rem;
    }

    .admin-panel-title h2 {
        font-size: 1.125rem;
    }

    .admin-stat-value {
        font-size: 1rem;
    }

    .admin-panel-body {
        padding: 1rem;
    }

    .request-card-actions {
        flex-wrap: wrap;
    }

    .request-action-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: calc(50% - 0.25rem);
    }

    .request-action-btn.secondary {
        flex: 1 1 100%;
    }
}

/* Currency API Section */
.currency-api-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.fetch-status {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    text-align: center;
    min-height: 1.25rem;
}

/* Organizations/Companies Styles */
.organizations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .organizations-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 1rem;
    }
}

.organizations-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.organizations-empty p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.organization-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.organization-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.org-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.org-info h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.org-country {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.organization-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 480px) {
    .organization-details {
        grid-template-columns: repeat(4, 1fr);
    }
}

.org-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
}

.org-stat .label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: block;
    margin-bottom: 0.25rem;
}

.org-stat .value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-900);
}

.org-bank-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    background: var(--success-light);
    color: var(--success);
}

.org-bank-info.no-bank {
    background: var(--warning-light);
    color: var(--warning);
}

.org-bank-info .bank-icon {
    font-weight: 700;
}

.org-notes {
    font-size: 0.8125rem;
    color: var(--gray-600);
    font-style: italic;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    margin-bottom: 0.75rem;
}

.organization-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.organization-card-actions .btn {
    flex: 1;
}

/* Organization Bank Accounts Form */
.org-bank-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.org-bank-account-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
}

.bank-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.bank-account-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bank-number {
    font-weight: 600;
    color: var(--gray-600);
}

.primary-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.bank-account-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.org-no-banks-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius);
    gap: 0.75rem;
}

.org-no-banks-msg p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin: 0;
}

/* Bank Detail Display (in detail modal) */
.bank-detail-item {
    padding-bottom: 1rem;
}

.bank-detail-item.additional-bank {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.bank-detail-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.bank-name-large {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
}

.primary-tag {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

/* Organization Detail */
.organization-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.org-regulations {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contract-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
}

.contract-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.contract-info strong {
    font-size: 0.9375rem;
    color: var(--gray-900);
}

.contract-info span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.contract-dates {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Commission Tracking Styles */
.commission-tracking-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tracking-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
}

.tracking-stat .value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    display: block;
}

.tracking-stat .label {
    font-size: 0.6875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tracking-stat.pending {
    background: var(--warning-light);
}

.tracking-stat.pending .value {
    color: var(--warning);
}

.commission-tracking-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.commission-tracking-row {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
}

.tracking-year {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.tracking-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tracking-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-xs);
}

.tracking-item.completed {
    background: var(--success-light);
}

.tracking-item.pending {
    background: var(--warning-light);
}

.tracking-item.inactive {
    background: var(--gray-100);
    opacity: 0.6;
}

.tracking-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.tracking-item.completed .tracking-icon {
    background: var(--success);
    color: white;
}

.tracking-item.pending .tracking-icon {
    background: var(--warning);
    color: white;
}

.tracking-item.inactive .tracking-icon {
    background: var(--gray-300);
    color: white;
}

.tracking-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tracking-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.tracking-detail {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Agent Payment Modal Styles */
.payment-summary {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
}

.payment-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.payment-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.payment-info-item .label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.payment-info-item .value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.agent-bank-preview {
    padding: 0.5rem 0.75rem;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
}

.agent-bank-preview.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.org-account-details {
    margin-bottom: 1rem;
}

.org-payment-info {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.org-payment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    font-size: 0.9375rem;
}

.org-flag {
    font-size: 1.25rem;
}

.org-bank-details {
    padding: 0.75rem;
    background: white;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.bank-row:last-child {
    border-bottom: none;
}

.bank-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.bank-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
    font-family: 'SF Mono', Monaco, monospace;
}

.no-bank-warning {
    padding: 0.75rem;
    background: var(--warning-light);
    color: var(--warning);
    font-size: 0.8125rem;
    text-align: center;
}

@media (max-width: 480px) {
    .payment-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Organization Payment History Styles */
.payment-summary-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.payment-summary-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xs);
}

.payment-summary-stat .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    display: block;
}

.payment-summary-stat .label {
    font-size: 0.6875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.payment-by-agent {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
}

.agent-payment-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xs);
}

.agent-payment-row .agent-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.agent-payment-row .agent-stats {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.payment-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.payment-history-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xs);
    align-items: flex-start;
}

.payment-date {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 70px;
    flex-shrink: 0;
}

.payment-date .date {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.payment-date .year {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.payment-details {
    flex: 1;
    min-width: 0;
}

.payment-agent {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.payment-agent strong {
    font-size: 0.875rem;
    color: var(--gray-900);
}

.payment-agent .student-info {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.payment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.payment-meta .university {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.payment-meta .reference {
    font-family: 'SF Mono', Monaco, monospace;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.payment-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.payment-amount .amount {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--success);
}

.payment-amount .currency {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

@media (max-width: 480px) {
    .payment-summary-stats {
        flex-direction: column;
    }

    .payment-history-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .payment-date {
        flex-direction: row;
        gap: 0.5rem;
        align-items: baseline;
    }

    .payment-amount {
        flex-direction: row;
        gap: 0.5rem;
        align-items: baseline;
    }
}

/* Export Dropdown Styles */
.export-dropdown {
    position: relative;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.export-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.export-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s ease;
}

.export-menu button:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.export-menu button:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.export-menu button:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.export-menu button:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

.export-menu-section {
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.export-menu-section:not(:first-child) {
    border-top: 1px solid var(--gray-200);
    margin-top: 0.25rem;
}

/* Info Card Title Row */
.info-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-card-title-row .btn {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .export-menu {
        min-width: 160px;
    }

    .info-card-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============ Shareholders Section Styles ============ */

.shareholders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shareholder-card {
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.shareholder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.shareholder-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.shareholder-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.shareholder-ownership {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    display: inline-block;
    width: fit-content;
}

.shareholder-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-icon.small {
    width: 24px;
    height: 24px;
}

.btn-icon.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.shareholder-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sh-detail {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.sh-detail .label {
    color: var(--gray-500);
    flex-shrink: 0;
}

.sh-detail .value {
    color: var(--text);
}

.sh-detail .cash-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 0.0625rem 0.375rem;
    border-radius: 9999px;
    font-weight: 500;
}

.ownership-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(79, 70, 229, 0.2);
    font-size: 0.8125rem;
    font-weight: 600;
}

.ownership-total .complete {
    color: #10b981;
}

.ownership-total .incomplete {
    color: #f59e0b;
}

/* ============ Dividend Section Styles ============ */

.dividend-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dividend-stat {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-radius: 0.5rem;
}

.dividend-stat .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: block;
}

.dividend-stat .label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.dividend-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dividend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.625rem;
    background: white;
    border-radius: 0.375rem;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.dividend-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dividend-date {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.dividend-recipient {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
}

.dividend-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.dividend-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.dividend-method {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-weight: 500;
    text-transform: uppercase;
}

.dividend-method.bank {
    background: #dbeafe;
    color: #1d4ed8;
}

.dividend-method.cash {
    background: #fef3c7;
    color: #92400e;
}

/* Form section title */
.form-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Checkbox label style */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

/* ============ Revenue Card Styles - Compact Design ============ */

.revenue-card-compact {
    background: var(--card-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
}

.revenue-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.revenue-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.revenue-title-group svg {
    color: var(--primary);
    flex-shrink: 0;
}

.revenue-title-group h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.revenue-rate-badge {
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
}

.revenue-stats-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.625rem;
}

.revenue-stat {
    display: flex;
    flex-direction: column;
}

.revenue-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.revenue-stat-value.collected {
    color: #10b981;
}

.revenue-stat-value.expected {
    color: var(--gray-500);
}

.revenue-stat-label {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.revenue-stat-divider {
    font-size: 1.25rem;
    color: var(--gray-400);
    font-weight: 300;
    margin: 0 0.125rem;
}

.revenue-pending-chip {
    margin-left: auto;
    font-size: 0.75rem;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.revenue-pending-chip span {
    font-weight: 600;
}

.revenue-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.revenue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.revenue-eligible-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.5rem 0.625rem;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.eligible-indicator {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.eligible-indicator svg {
    color: #10b981;
    flex-shrink: 0;
}

.eligible-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
}

.eligible-amount {
    font-size: 0.875rem;
    font-weight: 700;
    color: #10b981;
}

.eligible-hint {
    font-size: 0.6875rem;
    color: var(--gray-400);
    font-style: italic;
}

.revenue-yearly-compact {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.revenue-yearly-compact .revenue-years-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.revenue-yearly-compact .revenue-years-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.revenue-yearly-compact .revenue-toggle-btn {
    font-size: 0.75rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.revenue-yearly-compact .revenue-toggle-btn:hover {
    text-decoration: underline;
}

.revenue-year-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.revenue-year-chip {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.revenue-year-chip:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.revenue-year-chip .year-label {
    font-weight: 600;
    color: var(--text);
}

.revenue-year-chip .year-amounts {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-500);
}

.revenue-year-chip .collected-amt {
    color: #10b981;
    font-weight: 600;
}

.revenue-year-chip .expected-amt {
    color: var(--gray-400);
}

.revenue-year-chip .year-rate {
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
}

.revenue-year-chip .year-rate.high {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.revenue-year-chip .year-rate.medium {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.revenue-year-chip .year-rate.low {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Expanded view for yearly breakdown */
.revenue-years-expanded {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.revenue-years-expanded.show {
    display: flex;
}

.revenue-year-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 0.5rem;
}

.revenue-year-row .year-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
    min-width: 45px;
}

.revenue-year-row .year-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.revenue-year-row .mini-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.revenue-year-row .mini-bar-fill {
    height: 100%;
    border-radius: 2px;
}

.revenue-year-row .mini-bar-fill.expected-bar {
    background: rgba(99, 102, 241, 0.3);
}

.revenue-year-row .mini-bar-fill.collected-bar {
    background: #10b981;
}

.revenue-year-row .year-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 70px;
}

.revenue-year-row .year-collected {
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
}

.revenue-year-row .year-expected {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

.revenue-year-row .year-pct {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    min-width: 40px;
    text-align: center;
}

.revenue-year-row .year-pct.high {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.revenue-year-row .year-pct.medium {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.revenue-year-row .year-pct.low {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.revenue-empty {
    text-align: center;
    padding: 1rem;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

/* Revenue Card Responsive */
@media (max-width: 480px) {
    .revenue-card-compact {
        padding: 0.875rem;
    }

    .revenue-stat-value {
        font-size: 1.1rem;
    }

    .revenue-year-chip {
        padding: 0.25rem 0.5rem;
    }

    .revenue-year-chip .year-amounts {
        display: none;
    }
}

/* ============ Agent Portal Styles - App-like Design ============ */

.agent-portal-modal .agent-portal {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

/* Mobile-first Header */
.agent-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
    position: relative;
    z-index: 10;
}

.agent-portal-branding {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.agent-portal-logo {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.agent-portal-logo svg {
    width: 20px;
    height: 20px;
}

.agent-portal-title h1 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.agent-view-badge {
    display: inline-flex;
    padding: 0.1875rem 0.375rem;
    background: rgba(251, 191, 36, 0.9);
    border-radius: 0.25rem;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #78350f;
    margin-left: 0.375rem;
}

.agent-portal-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agent-portal-user span {
    font-weight: 500;
    font-size: 0.8125rem;
    display: none;
}

.agent-exit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agent-exit-btn svg {
    width: 20px;
    height: 20px;
}

.agent-exit-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.agent-exit-btn span {
    display: none;
}

/* Main Content Area */
.agent-portal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.agent-portal-dashboard {
    max-width: 800px;
    margin: 0 auto;
}

/* Welcome Card - Compact Mobile Design */
.agent-welcome-section {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 1rem;
}

.agent-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.agent-welcome-info {
    flex: 1;
    min-width: 0;
}

.agent-welcome-info h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.125rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-welcome-info p {
    color: var(--gray-500);
    margin: 0;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stats Grid - Mobile Optimized */
.agent-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.agent-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--bg-card);
    border-radius: 0.875rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.agent-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.agent-stat-card:nth-child(1)::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.agent-stat-card:nth-child(2)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.agent-stat-card:nth-child(3)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.agent-stat-card:nth-child(4)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.agent-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.agent-stat-icon svg {
    width: 18px;
    height: 18px;
}

.agent-stat-icon.students {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

.agent-stat-icon.earned {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.agent-stat-icon.paid {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.agent-stat-icon.balance {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.agent-stat-info {
    display: flex;
    flex-direction: column;
}

.agent-stat-card .agent-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.agent-stat-card .agent-stat-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Agent Sections - Collapsible Style */
.agent-section {
    background: var(--bg-card);
    border-radius: 0.875rem;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.agent-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.agent-section-header:hover {
    background: rgba(99, 102, 241, 0.03);
}

.agent-section-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-badge {
    padding: 0.1875rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.section-badge.success {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.section-badge.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.section-count {
    padding: 0.1875rem 0.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.agent-section-body {
    padding: 0.875rem;
}

/* Commission Request States */
.agent-pending-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.agent-pending-notice .pending-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    flex-shrink: 0;
}

.agent-pending-notice .pending-info strong {
    display: block;
    color: #f59e0b;
    margin-bottom: 0.25rem;
}

.agent-pending-notice .pending-info span {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.agent-request-available {
    text-align: center;
    padding: 1rem;
}

.agent-request-available p {
    color: var(--text);
    margin-bottom: 1rem;
}

.agent-no-requests, .agent-no-bank, .agent-no-students {
    text-align: center;
    padding: 1rem;
    color: var(--gray-400);
}

.agent-no-bank svg {
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.agent-no-bank p, .agent-no-requests p, .agent-no-students p {
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.agent-no-bank span, .agent-no-requests span {
    font-size: 0.875rem;
}

/* Bank Details */
.agent-bank-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.bank-detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bank-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bank-value {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
}

/* Students List - Compact Mobile Design */
.agent-students-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-student-card {
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 0.625rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.agent-student-card.eligible {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, transparent 100%);
}

.student-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.student-card-header .student-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

.student-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.student-card-details span:not(:last-child)::after {
    content: '•';
    margin-left: 0.375rem;
    opacity: 0.4;
}

.student-card-tuition {
    margin-bottom: 0.5rem;
}

.tuition-progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.tuition-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.tuition-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.eligible-badge {
    color: #10b981;
    font-weight: 600;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.not-eligible-badge {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Agent Students Tabs */
.agent-students-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    padding: 0 0.5rem;
}

.agent-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.agent-tab:hover {
    color: var(--text-color);
    background: rgba(99, 102, 241, 0.03);
}

.agent-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.agent-tab.eligible.active {
    color: #10b981;
    border-bottom-color: #10b981;
}

.agent-tab.non-eligible.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.375rem;
    background: var(--border-color);
    border-radius: 9px;
    font-size: 0.625rem;
    font-weight: 600;
}

.agent-tab.active .tab-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.agent-tab.eligible.active .tab-count {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.agent-tab.non-eligible.active .tab-count {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Agent Students Subtabs */
.agent-students-subtabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.subtab-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.agent-subtab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s ease;
}

.agent-subtab:hover {
    border-color: var(--gray-300);
    background: white;
}

.agent-subtab.active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.subtab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.subtab-dot.requestable {
    background: #f59e0b;
}

.subtab-dot.collected {
    background: #10b981;
}

.subtab-count {
    font-size: 0.625rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Student Card Badges */
.student-card-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.collected-badge {
    font-size: 0.625rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 4px;
}

.agent-student-card.collected {
    border-left: 3px solid #10b981;
}

.agent-students-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--gray-400);
}

.agent-students-empty p {
    margin: 0 0 0.25rem 0;
    font-weight: 500;
    color: var(--gray-500);
}

.agent-students-empty span {
    font-size: 0.75rem;
}

.student-card-commission {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.commission-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.commission-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.student-card-commission .commission-amount {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #10b981;
}

.commission-breakdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.6875rem;
}

.commission-collected {
    color: #10b981;
    font-weight: 500;
}

.commission-pending {
    color: #f59e0b;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

/* Payment History - Compact */
.agent-payment-history {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.payment-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    border-left: 3px solid var(--border-color);
}

.payment-history-item.approved {
    border-left-color: #10b981;
}

.payment-history-item.pending {
    border-left-color: #f59e0b;
}

.payment-history-item.rejected {
    border-left-color: #ef4444;
}

.payment-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.payment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-amount {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

.payment-status {
    padding: 0.1875rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-status.approved {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.payment-status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.payment-status.rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.payment-processed {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

/* Button styling for agent login */
.btn.agent-login {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn.agent-login:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.25);
}

.btn.agent-login svg {
    width: 14px;
    height: 14px;
}

/* Agent Portal Responsive - Desktop */
@media (min-width: 769px) {
    .agent-portal-modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
    }

    .agent-portal-modal .agent-portal {
        position: relative;
        inset: auto;
        width: 90%;
        max-width: 900px;
        height: 90vh;
        max-height: 800px;
        border-radius: 1rem;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
        overflow: hidden;
    }

    .agent-portal-header {
        padding: 1rem 1.5rem;
        border-radius: 1rem 1rem 0 0;
    }

    .agent-portal-title h1 {
        font-size: 1.125rem;
    }

    .agent-portal-user span {
        display: block;
    }

    .agent-exit-btn {
        width: auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .agent-exit-btn span {
        display: block;
    }

    .agent-portal-content {
        padding: 1.5rem;
    }

    .agent-portal-dashboard {
        max-width: 100%;
    }

    .agent-welcome-section {
        padding: 1.25rem;
    }

    .agent-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .agent-welcome-info h2 {
        font-size: 1.375rem;
    }

    .agent-welcome-info p {
        font-size: 0.875rem;
    }

    .agent-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.875rem;
    }

    .agent-stat-card {
        flex-direction: row;
        align-items: center;
        gap: 0.875rem;
        padding: 1rem;
    }

    .agent-stat-icon {
        width: 44px;
        height: 44px;
    }

    .agent-stat-icon svg {
        width: 22px;
        height: 22px;
    }

    .agent-stat-card .agent-stat-value {
        font-size: 1.5rem;
    }

    .agent-stat-card .agent-stat-label {
        font-size: 0.75rem;
    }

    .agent-bank-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .agent-students-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .agent-student-card {
        margin-bottom: 0;
    }
}

/* Agent Portal Responsive - Small Mobile */
@media (max-width: 380px) {
    .agent-portal-header {
        padding: 0.75rem;
    }

    .agent-portal-logo {
        width: 32px;
        height: 32px;
    }

    .agent-portal-title h1 {
        font-size: 0.875rem;
    }

    .agent-view-badge {
        display: none;
    }

    .agent-exit-btn {
        width: 32px;
        height: 32px;
    }

    .agent-portal-content {
        padding: 0.75rem;
    }

    .agent-welcome-section {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .agent-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .agent-welcome-info h2 {
        font-size: 1rem;
    }

    .agent-stats-grid {
        gap: 0.5rem;
    }

    .agent-stat-card {
        padding: 0.625rem;
    }

    .agent-stat-card .agent-stat-value {
        font-size: 1.125rem;
    }

    .agent-section {
        margin-bottom: 0.5rem;
    }

    .agent-section-header {
        padding: 0.75rem;
    }

    .agent-section-header h3 {
        font-size: 0.875rem;
    }

    .agent-section-body {
        padding: 0.625rem;
    }

    .student-card-details span:not(:last-child)::after {
        display: none;
    }

    .student-card-details {
        flex-direction: column;
        gap: 0.125rem;
    }
}

/* ============ Refund Modal Styles ============ */

.refund-warning-card {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.refund-warning {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.refund-warning svg {
    color: #ef4444;
    flex-shrink: 0;
}

.refund-warning strong {
    color: #ef4444;
    display: block;
    margin-bottom: 0.5rem;
}

.refund-warning ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text);
}

.refund-warning li {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.refund-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.refund-summary-label {
    color: var(--gray-400);
}

.refund-summary-value {
    font-weight: 600;
    color: var(--text);
}

.refund-summary-value.cancelled {
    color: #ef4444;
}

.refund-summary-value.recovery {
    color: #f59e0b;
}

/* Status badge for refunded */
.status-badge.refunded {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ============ Nationality Rates Improved UI ============ */

.nationality-rates-card {
    border: 1px solid var(--border);
}

.nationality-rates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.nationality-rates-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.nationality-rates-title svg {
    color: var(--primary);
}

.optional-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gray-400);
    background: var(--bg);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nationality-add-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.nationality-rates-desc {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin: 0 0 1rem 0;
}

.nationality-rates-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nationality-rates-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 0.5rem;
    border: 1px dashed var(--border);
    text-align: center;
}

.nationality-rates-empty svg {
    color: var(--gray-400);
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.nationality-rates-empty p {
    margin: 0;
    font-weight: 500;
    color: var(--gray-400);
}

.nationality-rates-empty span {
    font-size: 0.8125rem;
    color: var(--gray-400);
    opacity: 0.7;
}

.nationality-rate-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.nationality-rate-item:hover {
    border-color: var(--primary);
}

.nationality-rate-flag {
    font-size: 1.5rem;
    line-height: 1;
}

.nationality-rate-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nationality-rate-name {
    font-weight: 600;
    color: var(--text);
}

.nationality-rate-summary {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.nationality-rate-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nationality-rate-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.nat-rate-years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

/* Nationality rate modal responsive */
@media (max-width: 480px) {
    .nationality-rates-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nationality-add-btn {
        width: 100%;
        justify-content: center;
    }

    .nat-rate-years-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ ELIGIBILITY PANEL ============ */

.eligibility-panel {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-radius: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.eligibility-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}

.eligibility-panel-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.eligibility-panel-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.eligibility-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.eligibility-panel-title h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.eligibility-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eligibility-panel-subtitle {
    color: var(--gray-500);
    font-size: 0.8125rem;
    margin: 0;
    padding-left: 52px;
}

.eligibility-panel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.eligibility-stat {
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    text-align: center;
}

.eligibility-stat.highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.eligibility-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.eligibility-stat.highlight .eligibility-stat-value {
    color: #10b981;
}

.eligibility-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.eligibility-panel-body {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.eligibility-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--gray-400);
}

.eligibility-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.eligibility-empty p {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--gray-500);
}

.eligibility-empty span {
    font-size: 0.8125rem;
}

.eligibility-student-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.eligibility-student-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--bg-color);
    border-radius: 0.625rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.eligibility-student-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, transparent 100%);
}

.eligibility-student-card.requested {
    opacity: 0.7;
    background: var(--bg-color);
}

.eligibility-student-checkbox input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #10b981;
}

.eligibility-student-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.eligibility-student-info {
    min-width: 0;
}

.eligibility-student-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eligibility-student-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eligibility-payment-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.eligibility-payment-badge.full {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.eligibility-payment-badge.partial {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.eligibility-student-commission {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.9375rem;
    white-space: nowrap;
}

.eligibility-student-status {
    min-width: 80px;
    text-align: right;
}

.eligibility-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.eligibility-status.new {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.eligibility-status.sent {
    background: rgba(107, 114, 128, 0.15);
    color: var(--gray-500);
}

.eligibility-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.eligibility-panel-footer .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eligibility-panel-footer .btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.eligibility-panel-footer .btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.eligibility-panel-footer .btn.primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Spin animation for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Eligibility years badge */
.eligibility-years-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    margin-top: 0.25rem;
}

/* Eligibility panel responsive */
@media (max-width: 768px) {
    .eligibility-panel {
        border-radius: 0.75rem;
        margin-bottom: 1rem;
    }

    .eligibility-panel-header {
        padding: 0.75rem 1rem;
    }

    .eligibility-panel-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .eligibility-stat {
        padding: 0.5rem;
    }

    .eligibility-stat-value {
        font-size: 1rem;
    }

    .eligibility-stat-label {
        font-size: 0.5625rem;
    }

    .eligibility-panel-body {
        padding: 0.5rem;
    }

    .eligibility-student-list {
        gap: 0.375rem;
    }

    .eligibility-student-card {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.625rem;
        border-radius: 0.5rem;
    }

    .eligibility-student-checkbox {
        flex-shrink: 0;
    }

    .eligibility-student-checkbox input[type="checkbox"] {
        width: 16px;
        min-height: 16px;
        height: 16px;
    }

    .eligibility-student-info {
        flex: 1;
        min-width: 0;
    }

    .eligibility-student-name {
        font-size: 0.8125rem;
    }

    .eligibility-student-meta {
        font-size: 0.6875rem;
    }

    .eligibility-student-payment {
        display: flex;
    }

    .eligibility-payment-badge {
        padding: 0.125rem 0.375rem;
        font-size: 0.625rem;
    }

    .eligibility-student-commission {
        font-size: 0.75rem;
        font-weight: 600;
    }

    .eligibility-student-status {
        min-width: auto;
    }

    .eligibility-status {
        padding: 0.125rem 0.375rem;
        font-size: 0.5625rem;
    }

    .eligibility-panel-footer {
        padding: 0.75rem 1rem;
        flex-direction: row;
        gap: 0.5rem;
    }

    .eligibility-panel-footer .btn {
        flex: 1;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .eligibility-panel-subtitle {
        padding-left: 0;
        margin-top: 0.25rem;
        font-size: 0.6875rem;
    }
}

@media (max-width: 480px) {
    .eligibility-panel-header {
        padding: 0.625rem 0.75rem;
    }

    .eligibility-panel-title-section {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .eligibility-panel-icon {
        width: 28px;
        height: 28px;
    }

    .eligibility-panel-icon svg {
        width: 14px;
        height: 14px;
    }

    .eligibility-panel-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }

    .eligibility-panel-title h2 {
        font-size: 0.875rem;
    }

    .eligibility-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }

    .eligibility-panel-stats {
        grid-template-columns: repeat(4, 1fr);
        padding: 0.5rem 0.75rem;
    }

    .eligibility-stat {
        padding: 0.375rem;
    }

    .eligibility-stat-value {
        font-size: 0.875rem;
    }

    .eligibility-stat-label {
        font-size: 0.5rem;
    }

    .eligibility-panel-body {
        padding: 0.375rem;
    }

    .eligibility-student-card {
        padding: 0.375rem 0.5rem;
    }

    .eligibility-student-name {
        font-size: 0.75rem;
    }

    .eligibility-student-meta {
        font-size: 0.625rem;
    }

    .eligibility-years-badge {
        font-size: 0.5625rem;
        padding: 0.0625rem 0.25rem;
    }

    .eligibility-student-commission {
        font-size: 0.6875rem;
    }

    .eligibility-panel-footer {
        padding: 0.5rem 0.75rem;
    }

    .eligibility-panel-footer .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
}

/* ============ COMMISSION RECEIPTS PANEL ============ */

.commission-receipts-panel {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.receipts-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
}

.receipts-panel-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.receipts-panel-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.receipts-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.receipts-panel-title h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.receipts-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipts-panel-subtitle {
    color: var(--gray-500);
    font-size: 0.8125rem;
    margin: 0;
    padding-left: 52px;
}

.receipts-panel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.receipt-stat {
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    text-align: center;
}

.receipt-stat.highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.receipt-stat.pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.receipt-stat.disputed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.receipt-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.receipt-stat.highlight .receipt-stat-value {
    color: #10b981;
}

.receipt-stat.pending .receipt-stat-value {
    color: #f59e0b;
}

.receipt-stat.disputed .receipt-stat-value {
    color: #ef4444;
}

.receipt-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.receipts-panel-body {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.receipts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--gray-400);
}

.receipts-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.receipts-empty p {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--gray-500);
}

.receipts-empty span {
    font-size: 0.8125rem;
}

.receipts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.receipt-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.625rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.receipt-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, transparent 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.receipt-card.received {
    border-left: 3px solid #10b981;
}

.receipt-card.pending {
    border-left: 3px solid #f59e0b;
}

.receipt-card.partial {
    border-left: 3px solid #3b82f6;
}

.receipt-card.disputed {
    border-left: 3px solid #ef4444;
}

.receipt-card-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.receipt-card-university {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.receipt-university-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-contract-name {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.receipt-card-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.receipt-amount-value {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
}

.receipt-original {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.receipt-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.receipt-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.receipt-period {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.receipt-reference {
    color: var(--gray-400);
}

.receipt-card-status {
    display: flex;
    align-items: center;
}

.receipt-status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.receipt-status-badge.received {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.receipt-status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.receipt-status-badge.partial {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.receipt-status-badge.disputed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ============================================
   AGENT COMMISSION PAYOUTS SECTION
   ============================================ */

.agent-payouts-panel {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.02) 100%);
    border-radius: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.payouts-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
}

.payouts-panel-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.payouts-panel-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.payouts-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payouts-panel-title h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.payouts-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payouts-panel-subtitle {
    color: var(--gray-500);
    font-size: 0.8125rem;
    margin: 0;
    padding-left: 52px;
}

.payouts-panel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.payout-stat {
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    text-align: center;
}

.payout-stat.highlight {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.02) 100%);
}

.payout-stat.pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.payout-stat.partial {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.payout-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.payout-stat.highlight .payout-stat-value {
    color: #8b5cf6;
}

.payout-stat.pending .payout-stat-value {
    color: #f59e0b;
}

.payout-stat.partial .payout-stat-value {
    color: #3b82f6;
}

.payout-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.payouts-panel-body {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.payouts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--gray-400);
}

.payouts-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.payouts-empty p {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--gray-500);
}

.payouts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payout-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.625rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.payout-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.02) 0%, transparent 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.payout-card.confirmed {
    border-left: 3px solid #10b981;
}

.payout-card.sent {
    border-left: 3px solid #8b5cf6;
}

.payout-card.pending {
    border-left: 3px solid #f59e0b;
}

.payout-card-agent {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.payout-agent-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payout-student-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.payout-card-amount {
    text-align: right;
}

.payout-amount-value {
    font-weight: 700;
    font-size: 1rem;
    color: #8b5cf6;
}

.payout-method {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-transform: uppercase;
}

.payout-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.payout-card-meta svg {
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.payout-card-status {
    display: flex;
    align-items: center;
}

.payout-status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payout-status-badge.confirmed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.payout-status-badge.sent {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.payout-status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Payout Modal Specific Styles */
.payout-student-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.payout-student-item.selected {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

.payout-student-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.payout-student-info {
    flex: 1;
    min-width: 0;
}

.payout-student-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
}

.payout-student-details {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.payout-student-owed {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.payout-student-amount {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.payout-student-amount input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    text-align: right;
}

.payout-student-amount label {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

.payout-partial-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.payout-summary {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.02) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.payout-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.payout-summary .summary-row:last-child {
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    font-weight: 600;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.02);
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
    color: var(--gray-400);
}

.file-upload-placeholder svg {
    margin-bottom: 0.75rem;
    color: var(--gray-400);
}

.file-upload-placeholder span {
    font-size: 0.875rem;
}

.file-upload-placeholder .file-types {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
}

.file-preview .file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Notification indicator */
.notification-sent-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

/* Commission Receipts responsive */
@media (max-width: 768px) {
    .receipts-panel-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .receipt-stat {
        padding: 0.875rem 1rem;
    }

    .receipt-stat-value {
        font-size: 1.25rem;
    }

    .receipt-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .receipt-card-main {
        flex-direction: column;
        gap: 0.5rem;
    }

    .receipt-card-amount {
        align-items: flex-start;
    }

    .receipt-card-status {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .receipts-panel-subtitle {
        padding-left: 0;
        margin-top: 0.5rem;
    }

    /* Agent Payouts responsive */
    .payouts-panel-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .payout-stat {
        padding: 0.875rem 1rem;
    }

    .payout-stat-value {
        font-size: 1.25rem;
    }

    .payout-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .payout-card-status {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .payouts-panel-subtitle {
        padding-left: 0;
        margin-top: 0.5rem;
    }

    .payout-student-item {
        flex-direction: column;
        align-items: stretch;
    }

    .payout-student-amount {
        margin-top: 0.5rem;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .payout-student-amount input {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .receipts-panel-header {
        padding: 1rem;
    }

    .receipts-panel-title-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .receipts-panel-icon {
        width: 36px;
        height: 36px;
    }

    .receipts-panel-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .receipts-panel-title h2 {
        font-size: 1rem;
    }

    .receipts-panel-stats {
        grid-template-columns: 1fr 1fr;
    }

    .receipt-stat-value {
        font-size: 1.125rem;
    }

    .receipt-stat-label {
        font-size: 0.6875rem;
    }

    .receipt-card {
        position: relative;
        padding-right: 80px;
    }
}

/* ============ COMPACT UNIVERSITY CARDS ============ */

.university-card.compact {
    padding: 0;
    background: var(--bg-card);
    border-radius: 0.875rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.uni-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-bottom: 1px solid var(--border-color);
}

.uni-card-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.125rem 0;
}

.uni-country {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.uni-card-quick-stats {
    display: flex;
    gap: 0.5rem;
}

.quick-stat {
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

.uni-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.uni-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    color: var(--gray-600);
}

.chip-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--gray-500);
}

/* Collapsible Sections */
.uni-collapsible {
    border-bottom: 1px solid var(--border-color);
}

.uni-collapsible:last-of-type {
    border-bottom: none;
}

.uni-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: var(--bg-color);
    transition: background 0.2s ease;
    user-select: none;
}

.uni-collapsible-header:hover {
    background: rgba(99, 102, 241, 0.03);
}

.collapsible-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-color);
}

.collapsible-title svg {
    color: var(--gray-400);
}

.collapsible-arrow {
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.uni-collapsible.expanded .collapsible-arrow {
    transform: rotate(180deg);
}

.uni-collapsible-content {
    display: none;
    padding: 0;
    background: var(--bg-card);
}

.uni-collapsible.expanded .uni-collapsible-content {
    display: block;
}

/* Program Items */
.uni-program-item {
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--border-color);
}

.uni-program-item:first-child {
    border-top: none;
}

.program-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.125rem;
}

.program-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
}

.program-duration {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border-radius: 0.25rem;
    font-weight: 600;
}

.program-item-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.program-commission {
    color: #10b981;
    font-weight: 500;
}

/* Contract Items */
.uni-contract-item {
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--border-color);
}

.uni-contract-item:first-child {
    border-top: none;
}

.contract-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.125rem;
}

.contract-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
}

.contract-org {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.contract-dates {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

/* Compact Card Actions */
.card-actions.compact {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.card-actions.compact .btn {
    flex: 1;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* University Card Responsive */
@media (max-width: 480px) {
    .uni-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .uni-card-quick-stats {
        width: 100%;
    }

    .quick-stat {
        flex: 1;
        text-align: center;
    }

    .uni-card-chips {
        padding: 0.625rem;
    }

    .uni-chip {
        font-size: 0.625rem;
        padding: 0.1875rem 0.375rem;
    }

    .uni-collapsible-header {
        padding: 0.625rem 0.75rem;
    }

    .collapsible-title {
        font-size: 0.75rem;
    }

    .uni-program-item,
    .uni-contract-item {
        padding: 0.5rem 0.75rem;
    }

    .program-name,
    .contract-name {
        font-size: 0.75rem;
    }

    .card-actions.compact {
        padding: 0.625rem;
    }

    .card-actions.compact .btn {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
    }
}

/* ============ STUDENTS SEARCH & SELECT ============ */

.students-search-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.students-search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.students-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.students-search-input::placeholder {
    color: var(--gray-400);
}

.students-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.receipt-students-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-card);
}

.students-list-info {
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--gray-500);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.students-list-info strong {
    color: #10b981;
}

.students-empty-msg {
    color: var(--gray-400);
    font-size: 0.8125rem;
    text-align: center;
    padding: 1.5rem 0.75rem;
    margin: 0;
}

.student-select-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

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

.student-select-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.student-select-item.selected {
    background: rgba(16, 185, 129, 0.06);
}

.student-select-item input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #10b981;
    cursor: pointer;
}

.student-select-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
}

.student-select-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-select-details {
    font-size: 0.6875rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile optimization for students list */
@media (max-width: 480px) {
    .students-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
    }

    .receipt-students-list {
        max-height: 180px;
    }

    .student-select-item {
        padding: 0.625rem 0.625rem;
    }

    .student-select-name {
        font-size: 0.875rem;
    }
}

/* ============ PAYOUT ORDER STYLES ============ */

.payout-order-modal .modal-content {
    max-width: 900px;
}

.payout-order-modal-content {
    background: #f9fafb;
}

.payout-order-container {
    padding: 1.5rem;
}

.payout-order {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.payout-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.company-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.company-info p {
    font-size: 0.875rem;
    opacity: 0.85;
}

.order-info {
    text-align: right;
    font-size: 0.875rem;
}

.order-info p {
    margin-bottom: 0.25rem;
}

.payout-order-body {
    padding: 1.5rem;
}

.order-section {
    margin-bottom: 1.5rem;
}

.order-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6366f1;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.recipient-section, .bank-section {
    display: inline-block;
    width: 48%;
    vertical-align: top;
}

.bank-section {
    margin-left: 4%;
}

.recipient-details p,
.bank-details p {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.payment-amount {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    text-align: center;
}

.amount-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.amount-value {
    font-size: 2rem;
    font-weight: 700;
    color: #7c3aed;
}

.payment-details p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.students-table th,
.students-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.students-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-600);
}

.students-table tfoot td {
    font-weight: 600;
    background: var(--gray-50);
}

.payout-order-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.signature-section {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
}

.signature-box {
    width: 200px;
    text-align: center;
}

.signature-line {
    height: 40px;
    border-bottom: 1px solid var(--gray-400);
    margin-bottom: 0.5rem;
}

.signature-box p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.footer-note {
    text-align: center;
    font-size: 0.6875rem;
    color: var(--gray-400);
    margin-top: 1.5rem;
}

.payout-order-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.payout-order-actions .btn {
    display: inline-flex;
    align-items: center;
}

/* Payout Order Responsive */
@media (max-width: 768px) {
    .payout-order-header {
        flex-direction: column;
        gap: 1rem;
    }

    .order-info {
        text-align: left;
    }

    .recipient-section,
    .bank-section {
        display: block;
        width: 100%;
        margin-left: 0;
        margin-bottom: 1rem;
    }

    .payment-amount {
        text-align: center;
    }

    .amount-value {
        font-size: 1.5rem;
    }

    .students-table {
        font-size: 0.75rem;
    }

    .students-table th,
    .students-table td {
        padding: 0.5rem;
    }

    .signature-section {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
    }

    .payout-order-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .payout-order-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .payout-order-container {
        padding: 1rem;
    }

    .company-info h1 {
        font-size: 1.125rem;
    }

    .students-table th:nth-child(3),
    .students-table td:nth-child(3) {
        display: none;
    }
}

/* ============ AUDIT LOG STYLES ============ */

.audit-stats-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.audit-stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audit-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.audit-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-filters-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.audit-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.audit-filters-grid .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.audit-filters-grid .filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
}

.audit-filters-grid .filter-group input,
.audit-filters-grid .filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
}

.audit-log-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.audit-log-list {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.audit-log-entry {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

.audit-log-entry:hover {
    background: var(--gray-50);
}

.audit-log-entry:last-child {
    border-bottom: none;
}

.audit-entry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}

.audit-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-action-badge.success {
    background: var(--success-light);
    color: var(--success);
}

.audit-action-badge.warning {
    background: var(--warning-light);
    color: #b45309;
}

.audit-action-badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.audit-action-badge.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.audit-action-badge.neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

.audit-action-badge.large {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.audit-entity-type {
    font-size: 0.7rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.125rem 0.5rem;
    border-radius: 20px;
}

.audit-entity-type.large {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.audit-timestamp {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-left: auto;
}

.audit-entry-body {
    margin-bottom: 0.375rem;
}

.audit-entity-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.audit-details {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.audit-entry-footer {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
}

.audit-user {
    color: var(--gray-600);
    font-weight: 500;
}

.audit-user-role {
    color: var(--gray-400);
    padding: 0 0.375rem;
    background: var(--gray-50);
    border-radius: 4px;
}

.audit-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--gray-400);
}

.audit-more-indicator {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Audit Detail Modal */
.audit-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.audit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.audit-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.audit-detail-item.full-width {
    grid-column: 1 / -1;
}

.audit-detail-item label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-detail-item span {
    font-size: 0.9rem;
    color: var(--gray-800);
}

.audit-detail-item span.mono {
    font-family: monospace;
    font-size: 0.8rem;
    background: var(--gray-50);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.audit-detail-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
    margin-top: 1rem;
}

.audit-detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.audit-changes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.audit-change-column {
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.audit-change-column.old {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.audit-change-column.new {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.audit-change-label {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-change-column.old .audit-change-label {
    background: #fecaca;
    color: #991b1b;
}

.audit-change-column.new .audit-change-label {
    background: #bbf7d0;
    color: #166534;
}

.audit-json {
    margin: 0;
    padding: 0.75rem;
    font-size: 0.75rem;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .audit-stats-row {
        justify-content: center;
    }

    .audit-filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .audit-detail-grid {
        grid-template-columns: 1fr;
    }

    .audit-changes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .audit-filters-grid {
        grid-template-columns: 1fr;
    }

    .audit-log-list {
        max-height: calc(100vh - 400px);
    }
}

/* ============================================
   BACKUP & RESTORE SECTION STYLES
   ============================================ */

.backup-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.backup-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.backup-status-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.backup-status-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.backup-status-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #0369a1;
    margin: 0;
}

.backup-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0369a1;
}

.backup-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.backup-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.backup-status {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.backup-status.warning {
    background: #fef3c7;
    color: #92400e;
}

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

.backup-ago {
    font-size: 0.75rem;
    color: #64748b;
}

.backup-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.backup-status-item {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.backup-status-item label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.backup-status-item span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.backup-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.backup-action-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.backup-action-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.backup-action-card.create {
    border-left: 4px solid #22c55e;
}

.backup-action-card.restore {
    border-left: 4px solid #f59e0b;
}

.backup-action-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.backup-action-header .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.backup-action-card.create .backup-action-header .icon {
    background: #dcfce7;
    color: #16a34a;
}

.backup-action-card.restore .backup-action-header .icon {
    background: #fef3c7;
    color: #d97706;
}

.backup-action-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.backup-action-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.backup-action-card .btn {
    width: 100%;
    justify-content: center;
}

.backup-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.backup-action-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.backup-action-text strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.backup-action-text span {
    font-size: 0.8rem;
    color: #6b7280;
}

.backup-warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.backup-warning .warning-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.backup-warning p {
    margin: 0;
    font-size: 0.875rem;
    color: #854d0e;
    line-height: 1.5;
}

.backup-warning strong {
    color: #713f12;
}

/* Danger Zone (Backup section) */
.danger-zone {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fca5a5;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.danger-zone-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.danger-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-btn:hover {
    background: #b91c1c;
}

.danger-btn svg {
    flex-shrink: 0;
}

/* Settings Danger Zone */
.settings-danger-zone {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fca5a5;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.settings-danger-zone h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #991b1b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-danger-zone > p {
    font-size: 0.875rem;
    color: #b91c1c;
    margin: 0 0 1rem 0;
}

.danger-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
}

.danger-action-info h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.danger-action-info p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.danger-action .btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.danger-action .btn-danger:hover {
    background: #b91c1c;
}

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

    .backup-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .danger-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .danger-action .btn-danger {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .backup-status-grid {
        grid-template-columns: 1fr;
    }

    .backup-warning {
        flex-direction: column;
    }
}

/* ============================================
   USER MANAGEMENT STYLES
   ============================================ */

.user-management-modal {
    max-width: 600px;
    width: 95%;
}

.user-management-actions {
    margin-bottom: 1.5rem;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.user-list-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-list-item.inactive {
    opacity: 0.6;
    background: #fef2f2;
    border-color: #fecaca;
}

.user-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.user-list-info {
    flex: 1;
    min-width: 0;
}

.user-list-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-list-name .badge {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.user-list-name .badge.current {
    background: #dbeafe;
    color: #1d4ed8;
}

.user-list-name .badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.user-list-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.user-list-username {
    color: var(--primary);
}

.user-list-role {
    padding: 0.125rem 0.5rem;
    background: var(--gray-200);
    border-radius: 4px;
    font-weight: 500;
}

.user-list-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.user-list-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Settings Note */
.settings-note {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

/* Form Info */
.form-info {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}

/* Hidden class for RBAC */
.hidden {
    display: none !important;
}

/* ============================================
   SENSITIVE DATA MASKING STYLES
   ============================================ */

.masked-value {
    font-family: monospace;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: help;
    user-select: none;
}

.sensitive-data {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sensitive-data .masked-text {
    font-family: monospace;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.sensitive-data .original-text {
    font-family: inherit;
}

.sensitive-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.sensitive-badge svg {
    width: 12px;
    height: 12px;
}

/* Data restricted notice */
.data-restricted {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.data-restricted svg {
    flex-shrink: 0;
}

/* Responsive user management */
@media (max-width: 768px) {
    .user-list-item {
        flex-wrap: wrap;
    }

    .user-list-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--gray-200);
    }
}

@media (max-width: 480px) {
    .user-list-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .user-list-actions {
        flex-direction: column;
    }

    .user-list-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   APPROVAL WORKFLOW STYLES
   ============================================ */

.approval-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.approval-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow);
}

.approval-stat-card.pending {
    border-left: 4px solid #f59e0b;
}

.approval-stat-card.approved {
    border-left: 4px solid #10b981;
}

.approval-stat-card.rejected {
    border-left: 4px solid #ef4444;
}

.approval-stat-card.total {
    border-left: 4px solid #6366f1;
}

.approval-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.approval-stat-card.pending .approval-stat-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.approval-stat-card.approved .approval-stat-icon {
    background: #d1fae5;
    color: #10b981;
}

.approval-stat-card.rejected .approval-stat-icon {
    background: #fee2e2;
    color: #ef4444;
}

.approval-stat-card.total .approval-stat-icon {
    background: #e0e7ff;
    color: #6366f1;
}

.approval-stat-content {
    flex: 1;
}

.approval-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.approval-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Approval Tabs */
.approval-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: var(--gray-100);
    border-radius: 10px;
    overflow-x: auto;
}

.approval-tab {
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.approval-tab:hover {
    color: var(--gray-900);
}

.approval-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.tab-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.approval-tab.active .tab-count {
    background: var(--primary-light);
    color: var(--primary);
}

/* Approval Thresholds Info */
.approval-thresholds-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.thresholds-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 0.75rem;
}

.thresholds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.threshold-item {
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.threshold-amount {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-900);
}

.threshold-role {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Approval List */
.approval-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.approval-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

.approval-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.approval-empty p {
    font-size: 0.95rem;
}

/* Approval Card */
.approval-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border-left: 4px solid var(--gray-300);
}

.approval-card.pending_approval {
    border-left-color: #f59e0b;
}

.approval-card.approved,
.approval-card.processing,
.approval-card.completed {
    border-left-color: #10b981;
}

.approval-card.rejected {
    border-left-color: #ef4444;
}

.approval-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.approval-agent-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.approval-agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.approval-agent-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.approval-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.approval-amount-info {
    text-align: right;
}

.approval-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

/* Workflow Badge */
.workflow-badge {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.approval-card-body {
    padding: 1rem;
}

.approval-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.approval-detail {
    text-align: center;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.approval-detail .detail-label {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.approval-detail .detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.approval-history-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem;
    background: #d1fae5;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.history-label {
    font-size: 0.75rem;
    color: #166534;
}

.approver-badge {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    background: white;
    color: #166534;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
}

.rejection-reason {
    padding: 0.5rem;
    background: #fee2e2;
    border-radius: 8px;
}

.rejection-reason .reason-label {
    font-size: 0.75rem;
    color: #991b1b;
    display: block;
    margin-bottom: 0.25rem;
}

.rejection-reason .reason-text {
    font-size: 0.85rem;
    color: #7f1d1d;
}

.approval-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* Approval Detail Modal */
.approval-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.detail-agent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.detail-agent h3 {
    font-size: 1.125rem;
    margin: 0 0 0.125rem 0;
}

.detail-agent p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

.detail-amount-card {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.detail-amount-card .amount-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.detail-amount-card .amount-value {
    font-size: 2rem;
    font-weight: 700;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.students-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.students-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

.students-list li:last-child {
    border-bottom: none;
}

/* Approval Timeline */
.approval-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.history-item {
    position: relative;
    padding-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--gray-200);
}

.history-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.history-icon {
    position: absolute;
    left: -0.375rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
}

.history-item.submitted-for-approval .history-icon {
    background: #3b82f6;
}

.history-item.approved .history-icon {
    background: #10b981;
}

.history-item.rejected .history-icon {
    background: #ef4444;
}

.history-action {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.history-details {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 6px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.info-item {
    font-size: 0.875rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 6px;
}

.info-item span {
    color: var(--gray-500);
    margin-right: 0.25rem;
}

/* Responsive Approvals */
@media (max-width: 768px) {
    .approval-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .approval-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .approval-amount-info {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .approval-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .approval-card-actions {
        flex-wrap: wrap;
    }

    .thresholds-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .approval-stats-row {
        grid-template-columns: 1fr;
    }

    .approval-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .approval-detail {
        padding: 0.375rem;
    }

    .approval-detail .detail-value {
        font-size: 0.8rem;
    }
}

/* ============ EXCHANGE RATE HISTORY ============ */

.rate-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.rate-history-list table {
    width: 100%;
    border-collapse: collapse;
}

.rate-history-list th,
.rate-history-list td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.rate-history-list th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--gray-600);
    position: sticky;
    top: 0;
}

.rate-history-list tr:hover {
    background: var(--gray-50);
}

.currency-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.source-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

.source-manual {
    background: #dbeafe;
    color: #1d4ed8;
}

.source-transaction {
    background: #d1fae5;
    color: #059669;
}

.source-bank {
    background: #fef3c7;
    color: #d97706;
}

.source-api {
    background: #e0e7ff;
    color: #4f46e5;
}

.source-current {
    background: var(--gray-100);
    color: var(--gray-600);
}

.variance-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.variance-stat .stat-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--gray-500);
}

.variance-stat .stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    font-family: monospace;
}

.variance-stat .stat-value.positive {
    color: #059669;
}

.variance-stat .stat-value.negative {
    color: #dc2626;
}

.rate-history-filters .form-group label {
    margin-bottom: 0.25rem;
    color: var(--gray-600);
}

/* ============ BANK RECONCILIATION STYLES ============ */

.reconciliation-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.recon-stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.recon-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.recon-stat-value.positive {
    color: #059669;
}

.recon-stat-value.warning {
    color: #d97706;
}

.recon-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.statements-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.statement-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.statement-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.statement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.statement-info {
    flex: 1;
}

.statement-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.statement-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.statement-status {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.statement-status.pending {
    background: #fef3c7;
    color: #d97706;
}

.statement-status.in_progress,
.statement-status.in-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.statement-status.completed {
    background: #d1fae5;
    color: #059669;
}

.statement-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.statement-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.statement-stats .stat-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.statement-stats .stat-value {
    font-weight: 600;
    color: var(--gray-900);
}

.statement-stats .stat-value.warning {
    color: #d97706;
}

.recon-row.matched {
    background: rgba(16, 185, 129, 0.05);
}

.recon-row.unmatched {
    background: rgba(251, 191, 36, 0.05);
}

.recon-row.excluded {
    background: rgba(156, 163, 175, 0.1);
    opacity: 0.7;
}

.recon-status-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

.recon-status-badge.matched {
    background: #d1fae5;
    color: #059669;
}

.recon-status-badge.unmatched {
    background: #fef3c7;
    color: #d97706;
}

.recon-status-badge.excluded {
    background: var(--gray-200);
    color: var(--gray-600);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--gray-100);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-icon + .btn-icon {
    margin-left: 0.25rem;
}

/* ============ INVOICE STYLES ============ */

.invoice-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.inv-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
}

.inv-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.inv-stat-value.positive {
    color: #059669;
}

.inv-stat-value.warning {
    color: #d97706;
}

.inv-stat-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invoice-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.invoice-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.invoice-card-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invoice-number {
    font-weight: 600;
    color: var(--gray-900);
}

.invoice-type {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: #dbeafe;
    color: #2563eb;
}

.invoice-type.creditNote {
    background: #fee2e2;
    color: #dc2626;
}

.invoice-status {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.invoice-status.status-draft {
    background: #f3f4f6;
    color: #6b7280;
}

.invoice-status.status-sent {
    background: #dbeafe;
    color: #2563eb;
}

.invoice-status.status-paid {
    background: #d1fae5;
    color: #059669;
}

.invoice-status.status-overdue {
    background: #fee2e2;
    color: #dc2626;
}

.invoice-status.status-cancelled {
    background: #e5e5e5;
    color: #666;
}

.invoice-status.status-partially_paid {
    background: #fef3c7;
    color: #d97706;
}

.invoice-card-body {
    margin-bottom: 0.5rem;
}

.invoice-buyer {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.invoice-dates {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.invoice-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.invoice-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.invoice-amount.credit {
    color: #dc2626;
}

.invoice-due {
    font-size: 0.75rem;
    color: #d97706;
}

/* ============================================
   Tax Configuration Styles
   ============================================ */

.tax-config-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}

.tax-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.tax-tab:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}

.tax-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: none;
}

.tax-tab-content {
    display: none;
}

.tax-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tax-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tax-section-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.tax-table {
    width: 100%;
    font-size: 0.8125rem;
}

.tax-table th {
    background: var(--gray-50);
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.tax-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

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

.tax-code-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.wht-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: #fef3c7;
    color: #d97706;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.status-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 1rem;
    text-transform: capitalize;
}

.status-badge.active {
    background: #d1fae5;
    color: #059669;
}

.status-badge.inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

.empty-text {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ============================================
   Modal Footer Styles
   ============================================ */

.modal-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex-shrink: 0;
}

/* ============================================
   Invoice Statistics Styles
   ============================================ */

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.data-table th {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

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

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

.invoice-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.inv-stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.inv-stat:first-child {
    background: var(--primary-50);
    border-color: var(--primary-100);
}

.inv-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.inv-stat:first-child .inv-stat-value {
    color: var(--primary);
}

.inv-stat-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

/* Invoice status colors in stats */
.inv-stat.draft { background: #f3f4f6; }
.inv-stat.sent { background: #dbeafe; }
.inv-stat.paid { background: #d1fae5; }
.inv-stat.overdue { background: #fee2e2; }

/* ============================================
   Payment Limits Settings Styles
   ============================================ */

.payment-limits-settings .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.payment-limits-settings .form-group {
    margin-bottom: 0;
}

.payment-limits-settings h5 {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.payment-limits-settings input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.payment-limits-settings input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================
   Invoice List Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .invoice-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .payment-limits-settings .form-row {
        grid-template-columns: 1fr;
    }
    
    .tax-config-tabs {
        flex-wrap: wrap;
    }
    
    .tax-tab {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .invoice-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .invoice-stats .inv-stat:last-child {
        grid-column: span 2;
    }
}
