:root {
    /* ثيم v3 — زمردي/أزرق عميق (بدون بنفسجي/وردي) */
    --bg-dark: #060a12;
    --bg-card: rgba(11, 18, 32, 0.94);
    --primary: #2dd4bf;
    --primary-dark: #14b8a6;
    --primary-glow: rgba(45, 212, 191, 0.35);
    --secondary: #38bdf8;
    --secondary-glow: rgba(56, 189, 248, 0.22);
    --accent: #34d399;
    --accent-glow: rgba(52, 211, 153, 0.35);
    --gold: #fbbf24;
    --text-main: #f0f6fc;
    --text-muted: #8fa3bc;
    --border-color: rgba(45, 212, 191, 0.14);
    --glass-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    --font-family: 'Almarai', 'Cairo', 'Tajawal', system-ui, sans-serif;
    --font-heading: 'Cairo', 'Almarai', sans-serif;
    --font-size-base: 17px;
    --line-height-base: 1.75;

    --rank-1-color: #f59e0b;
    --rank-2-color: #38bdf8;
    --rank-3-color: #34d399;
    --rank-4-color: #818cf8;
    --rank-5-color: #f472b6;
    --rank-6-color: #fbbf24;
    --rank-7-color: #22d3ee;
    --rank-8-color: #a78bfa;
    --rank-9-color: #e879f9;
    --rank-10-color: #2dd4bf;

    --transition-glow: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 500;
    line-height: var(--line-height-base);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

/* خلفية v3 — تدرج أزرق/زمردي عميق */
body.platform-v3 {
    background-color: #060a12;
    background-image: none;
    color: var(--text-main);
}

body.platform-v3::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 60% at 85% -10%, rgba(45, 212, 191, 0.14), transparent 50%),
        radial-gradient(ellipse 70% 50% at 5% 30%, rgba(56, 189, 248, 0.1), transparent 45%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(20, 184, 166, 0.08), transparent 40%),
        linear-gradient(165deg, #060a12 0%, #0a1220 35%, #071018 70%, #060a12 100%);
}

body.platform-v3::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* توافق مع الاسم القديم */
body.platform-v2 {
    background-color: #060a12;
    background-image: none;
}

body.platform-v2::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 60% at 85% -10%, rgba(45, 212, 191, 0.14), transparent 50%),
        radial-gradient(ellipse 70% 50% at 5% 30%, rgba(56, 189, 248, 0.1), transparent 45%),
        linear-gradient(165deg, #060a12 0%, #0a1220 50%, #060a12 100%);
}

/* Typography v3 */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
}

p, label, .subtitle, .logo-text p {
    color: var(--text-muted);
    font-weight: 400;
}

.logo-text h1 {
    color: var(--text-main);
    font-weight: 800;
    font-family: var(--font-heading);
}

.logo-text p {
    color: var(--primary) !important;
    font-weight: 600;
}

.gradient-text {
    background: linear-gradient(120deg, #5eead4 0%, #2dd4bf 35%, #38bdf8 70%, #7dd3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.platform-v3 .hero {
    margin: 2.5rem auto 2rem;
}
body.platform-v3 .hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    margin-bottom: 1.25rem;
    line-height: 1.25;
}

body.platform-v3 .hero p,
body.platform-v3 #hero-subtitle {
    color: #c5d4e8 !important;
    font-size: 1.15rem;
    line-height: 1.85;
    opacity: 1 !important;
    max-width: 720px;
    margin: 0 auto 2rem;
}

/* بطاقات وب panels — v3 */
body.platform-v3 .glass-panel:not(.preserve-ui):not(.glow-zone-locked) {
    background: linear-gradient(145deg, rgba(14, 22, 38, 0.96), rgba(8, 14, 26, 0.92));
    border: 1px solid rgba(45, 212, 191, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.platform-v3 .glass-panel:not(.preserve-ui):not(.glow-zone-locked):hover {
    border-color: rgba(45, 212, 191, 0.35);
    box-shadow: 0 16px 48px rgba(45, 212, 191, 0.08);
    filter: none;
}

body.platform-v3 .navbar {
    background: rgba(6, 10, 18, 0.88) !important;
    border-bottom: 1px solid rgba(45, 212, 191, 0.1);
    backdrop-filter: blur(20px);
}

body.platform-v3 .btn-glow {
    background: linear-gradient(135deg, #14b8a6, #0891b2);
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.35);
    font-family: var(--font-heading);
    font-weight: 600;
}

body.platform-v3 .btn-glow:hover {
    box-shadow: 0 8px 28px rgba(20, 184, 166, 0.45);
    transform: translateY(-2px);
}

body.platform-v3 .btn-outline {
    border-color: rgba(45, 212, 191, 0.5);
    color: #5eead4;
}

body.platform-v3 .btn-outline:hover {
    background: rgba(45, 212, 191, 0.12);
    color: #99f6e4;
}

body.platform-v3 .nav-links a:hover,
body.platform-v3 .nav-links a.active {
    color: #5eead4;
}

body.platform-v3 .logo i {
    color: #2dd4bf;
    filter: drop-shadow(0 0 12px rgba(45, 212, 191, 0.5));
}

body.platform-v3 .service-card:hover {
    border-color: rgba(45, 212, 191, 0.4);
}

body.platform-v3 .service-icon {
    color: #2dd4bf;
}

body.platform-v3 .modern-table th {
    color: #94a3b8;
    background: rgba(45, 212, 191, 0.06);
}

body.platform-v3 .score-cell {
    color: #5eead4;
}

body.platform-v3 .stat-card h4,
body.platform-v3 .stat-info .number {
    color: #f0f6fc;
    font-family: var(--font-heading);
}

body.platform-v3 select,
body.platform-v3 input[type="text"],
body.platform-v3 input[type="email"],
body.platform-v3 input[type="password"],
body.platform-v3 input[type="number"],
body.platform-v3 textarea {
    background: rgba(4, 10, 20, 0.7);
    border: 1px solid rgba(45, 212, 191, 0.15);
    color: #f0f6fc;
    font-family: var(--font-family);
}

body.platform-v3 select:focus,
body.platform-v3 input:focus,
body.platform-v3 textarea:focus {
    border-color: rgba(45, 212, 191, 0.45);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

/* مربع الفلاتر + الإشعاع — ثابت */
.glass-panel.preserve-ui,
#best-researcher-card-container {
    /* لا تُستبدل بقواعد الثيم العامة */
}

.filters-container.preserve-ui {
    background: rgba(26, 30, 41, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

.filters-container.preserve-ui label {
    color: #94a3b8 !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 0.9rem !important;
}

.filters-container.preserve-ui select {
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    font-family: 'Tajawal', sans-serif !important;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: var(--primary);
    filter: brightness(1.05);
}

/* Layout */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-radius: 0 0 16px 16px;
    border-top: none;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text h1 {
    font-size: 1.2rem;
    margin: 0;
}

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

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.btn {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-glow:hover {
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-2px);
    color: #fff;
}

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

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

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 3rem auto 2rem;
    text-align: center;
    padding: 0 1rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    justify-content: center;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-group select, .filter-group input {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-width: 150px;
    outline: none;
}

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

.filter-group select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.mt-4 { margin-top: 2rem; }

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

/* Top Researchers Section */
.top-researchers {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.premium-glow {
    position: relative;
    overflow: hidden;
    z-index: 1;
    /* Pulsing box shadow for extra "radiation" */
    box-shadow: 0 0 20px var(--glow-color, var(--gold));
    animation: glow-pulse 2s infinite alternate;
    transition: var(--transition-glow);
}

.premium-glow::before {
    transition: var(--transition-glow);
}

@keyframes glow-pulse {
    from { box-shadow: 0 0 10px var(--glow-color, var(--gold)); }
    to { box-shadow: 0 0 25px var(--glow-color, var(--gold)); }
}

.premium-glow::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    /* Repeating conic gradient to create "Sun Rays" */
    background: repeating-conic-gradient(
        from 0deg,
        var(--glow-color, var(--gold)) 0deg,
        var(--glow-color, var(--gold)) 2deg,
        transparent 10deg,
        transparent 20deg,
        var(--glow-color, var(--gold)) 30deg
    );
    animation: rotate-border 10s linear infinite;
    z-index: -2;
    opacity: 0.3; /* Subtle rays */
}

/* Second layer for the "Sun Core" sweep */
.premium-glow::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        var(--glow-color, var(--gold)) 50%,
        transparent 100%
    );
    animation: rotate-border 4s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

/* Inner card body to cover the center but let rays show through */
.best-researcher-card-inner {
    position: absolute;
    inset: 3px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    z-index: 0;
}

@keyframes rotate-border {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@property --glow-color {
  syntax: '<color>';
  initial-value: #f59e0b;
  inherits: true;
}

.premium-glow.rank-1 { --glow-color: var(--rank-1-color); }
.premium-glow.rank-2 { --glow-color: var(--rank-2-color); }
.premium-glow.rank-3 { --glow-color: var(--rank-3-color); }
.premium-glow.rank-4 { --glow-color: var(--rank-4-color); }
.premium-glow.rank-5 { --glow-color: var(--rank-5-color); }
.premium-glow.rank-6 { --glow-color: var(--rank-6-color); }
.premium-glow.rank-7 { --glow-color: var(--rank-7-color); }
.premium-glow.rank-8 { --glow-color: var(--rank-8-color); }
.premium-glow.rank-9 { --glow-color: var(--rank-9-color); }
.premium-glow.rank-10 { --glow-color: var(--rank-10-color); }

/* Top 3 Podium */
.top-3-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4;
    transition: all 0.8s ease;
    cursor: pointer;
    position: relative;
}

.podium-item.active {
    opacity: 1;
    transform: scale(1.2);
}

.podium-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--rank-color);
    padding: 2px;
    background: var(--bg-dark);
    position: relative;
    box-shadow: 0 0 15px var(--rank-color);
}

.podium-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.podium-rank {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--rank-color);
    color: white;
    font-size: 0.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.podium-name {
    font-size: 0.75rem;
    margin-top: 0.8rem;
    color: var(--text-main);
    max-width: 70px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.premium-glow.rank-2 { --glow-color: var(--rank-2-color); }
.premium-glow.rank-3 { --glow-color: var(--rank-3-color); }
.premium-glow.rank-4 { --glow-color: var(--rank-4-color); }
.premium-glow.rank-5 { --glow-color: var(--rank-5-color); }
.premium-glow.rank-6 { --glow-color: var(--rank-6-color); }
.premium-glow.rank-7 { --glow-color: var(--rank-7-color); }
.premium-glow.rank-8 { --glow-color: var(--rank-8-color); }
.premium-glow.rank-9 { --glow-color: var(--rank-9-color); }
.premium-glow.rank-10 { --glow-color: var(--rank-10-color); }

.best-researcher-card {
    text-align: center;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.5s ease-in-out;
    background: transparent !important; /* Allow glow to show */
    border: none !important;
}

.premium-glow::after {
    content: '';
    position: absolute;
    inset: 2px; /* Border thickness */
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 18px;
    z-index: -1;
}

.best-researcher-card > * {
    z-index: 2;
    position: relative;
}

.crown {
    font-size: 3rem;
    color: var(--gold);
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
    margin-bottom: -10px;
}

.rank-badge {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: var(--text-muted);
    border: 3px solid var(--glow-color, var(--gold));
    transition: border-color 0.5s ease;
}

.best-researcher-card h2 {
    font-size: 1.5rem;
    color: var(--glow-color, var(--gold));
    transition: color 0.5s ease;
}

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

.score-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.score-unit {
    color: var(--glow-color, var(--gold));
    font-weight: bold;
    transition: color 0.5s ease;
}

.top-10-list {
    padding: 1.5rem;
}

.top-10-list h3 {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-10-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.top-10-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.top-10-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-5px);
}

.top-10-list li.active {
    transform: translateX(-10px);
    background: var(--rank-color, var(--primary));
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.top-10-list li.active .r-dept, .top-10-list li.active .r-score {
    color: rgba(255, 255, 255, 0.8);
}

.top-10-list li.active .rank-number {
    background: #fff;
    color: var(--rank-color, var(--primary));
}

.top-10-list li.active .rank-number-mini {
    background: #fff;
    color: var(--rank-color, var(--primary));
}

.top-10-list li > * {
    z-index: 2;
    position: relative;
}

.rank-number {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.rank-1 { background: var(--rank-1-color); }
.rank-2 { background: var(--rank-2-color); }
.rank-3 { background: var(--rank-3-color); }
.rank-4 { background: var(--rank-4-color); }
.rank-5 { background: var(--rank-5-color); }
.rank-6 { background: var(--rank-6-color); }
.rank-7 { background: var(--rank-7-color); }
.rank-8 { background: var(--rank-8-color); }
.rank-9 { background: var(--rank-9-color); }
.rank-10 { background: var(--rank-10-color); }

.r-info {
    flex: 1;
    margin: 0 1rem;
}

.r-name {
    font-weight: bold;
    display: block;
}

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

.r-score {
    font-weight: bold;
    color: var(--accent);
}

/* Table Section */
.full-ranking-section {
    padding: 1.5rem;
}

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

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    outline: none;
}

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

.table-responsive {
    overflow-x: auto;
}

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

.modern-table th, .modern-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.modern-table th {
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.1);
}

.modern-table tbody tr {
    transition: background 0.3s;
}

.modern-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.score-cell {
    font-weight: bold;
    color: var(--accent);
}

/* Criteria Cards */
.criteria-info {
    padding: 1.5rem;
}

.criteria-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.criteria-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.criteria-card h3 {
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.criteria-card ul {
    margin-top: 1rem;
    list-style: none;
}

.criteria-card li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.highlight {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 0.5rem;
}

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

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-header h2 {
    color: var(--primary);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .top-researchers {
        grid-template-columns: 1fr;
    }
    .criteria-grid {
        grid-template-columns: 1fr;
    }
    body:not(.admin-page) .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group select, .filter-group input {
        width: 100%;
    }
    .search-box {
        width: 100%;
    }
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.rank-number-mini {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
    color: #fff;
    vertical-align: middle;
}
/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    gap: 1.5rem;
    position: relative;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: rgba(0, 0, 0, 0.2);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}

.service-info {
    flex: 1;
}

.service-info h3 {
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
}

.service-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.service-arrow {
    color: var(--text-muted);
    opacity: 0.5;
}

.service-card:hover .service-arrow {
    opacity: 1;
    color: var(--primary);
    transform: translateX(-5px);
}

.service-card i {
    transition: transform 0.4s ease;
}

.service-card:hover i {
    transform: scale(1.1) rotate(-5deg);
}

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

.main-container > section {
    animation: fadeIn 0.8s ease-out forwards;
}

.main-container > section:nth-child(2) { animation-delay: 0.2s; }
.main-container > section:nth-child(3) { animation-delay: 0.4s; }
.main-container > section:nth-child(4) { animation-delay: 0.6s; }

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-info h4 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 800;
}

.stat-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
        background-image: none !important;
    }
    .navbar, .hero, .sidebar, #print-btn, .service-card, .form-actions, .no-print {
        display: none !important;
    }
    .glass-panel {
        background: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .gradient-text {
        background: none !important;
        -webkit-text-fill-color: black !important;
        color: black !important;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    input, select, textarea {
        border: 1px solid #999 !important;
        background: white !important;
        color: black !important;
    }
    /* Hide scrollbars during print */
    ::-webkit-scrollbar {
        display: none;
    }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    direction: ltr;
}

.pagination-container button {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-container .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* PWA Install — Top bar (desktop/laptop) + FAB (all devices) */
.pwa-install-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(236, 72, 153, 0.92));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.6rem 1rem;
    padding-top: max(0.6rem, env(safe-area-inset-top));
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.35);
    animation: pwaSlideDown 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pwaSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

body.has-pwa-topbar .navbar {
    top: 52px;
}

body.has-pwa-topbar {
    padding-top: 52px;
}

.pwa-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pwa-topbar-icon {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.pwa-topbar-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: #fff;
}

.pwa-topbar-text strong { font-size: 0.9rem; }
.pwa-topbar-text span { font-size: 0.75rem; opacity: 0.9; }

.pwa-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pwa-topbar-actions .btn-glow {
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.pwa-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pwa-close-btn:hover { background: rgba(255,255,255,0.35); }

/* FAB — زر عائم للتثبيت */
.pwa-install-fab {
    position: fixed;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    left: max(1.25rem, env(safe-area-inset-left));
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem 0.55rem 0.65rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5), 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: pwaFabPulse 3s ease-in-out infinite;
}

.pwa-install-fab img {
    border-radius: 8px;
}

.pwa-install-fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 32px rgba(99, 102, 241, 0.6);
}

@keyframes pwaFabPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5); }
    50% { box-shadow: 0 6px 32px rgba(236, 72, 153, 0.6); }
}

/* iOS install modal */
.pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.pwa-ios-sheet {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.pwa-ios-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.pwa-ios-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.pwa-ios-steps li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.pwa-ios-steps li i {
    color: var(--primary);
    width: 24px;
    text-align: center;
}

/* File Upload Zones — Desktop drag-drop + Mobile touch */
.file-upload-wrap {
    margin-bottom: 1rem;
}

.file-upload-zone {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border: 2px dashed var(--border-color);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 80px;
}

.file-upload-zone:hover,
.file-upload-zone:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    outline: none;
}

.file-upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.12);
    transform: scale(1.01);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
}

.file-upload-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.file-upload-label {
    font-size: 0.95rem;
    color: var(--text-main);
}

.file-upload-hint,
.file-upload-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.file-upload-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.file-upload-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
}

.file-upload-preview > i {
    font-size: 1.5rem;
    color: var(--accent);
}

.file-upload-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-upload-filename {
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-filesize {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-upload-remove {
    background: rgba(220, 38, 38, 0.2);
    border: none;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.file-upload-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.file-upload-progress-bar {
    flex: 1;
    height: 6px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.2s ease;
}

.file-upload-progress-text {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    min-width: 36px;
}

.attachments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Desktop / Laptop optimizations */
        /* شاشات عريضة — لابتوب وكمبيوتر */
        @media (min-width: 992px) {
            body.has-pwa-topbar .navbar {
                top: 52px;
            }
            body.has-pwa-topbar.admin-page {
                padding-top: 52px;
            }
            body.has-pwa-topbar.admin-page .admin-layout {
                min-height: calc(100vh - 132px);
            }
        }

        @media (min-width: 1024px) {
    .main-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 2rem;
    }

    .form-container {
        max-width: 960px !important;
    }

    .nav-container {
        max-width: 1400px;
    }

    .filters-container {
        max-width: 1000px;
        margin: 0 auto;
    }

    .file-upload-zone {
        padding: 1.5rem 1.75rem;
    }
}

@media (max-width: 768px) {
    #hero-title, .hero h1 {
        font-size: clamp(1.8rem, 8vw, 3.5rem) !important;
    }
    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.75rem;
    }
    body:not(.admin-page) .nav-container {
        flex-direction: column;
        align-items: center;
    }
    body:not(.admin-page) .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .nav-links .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }

    /* على الجوال: شريط التثبيت في الأسفل */
    .pwa-install-topbar {
        top: auto;
        bottom: 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        animation: pwaSlideUp 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    body.has-pwa-topbar {
        padding-top: 0;
        padding-bottom: 70px;
    }

    body.has-pwa-topbar .navbar {
        top: 0;
    }

    .pwa-topbar-text span { display: none; }

    .pwa-install-fab {
        bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
    }

    .pwa-fab-label { display: none; }

    .pwa-install-fab {
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .attachments-grid {
        grid-template-columns: 1fr;
    }

    .file-upload-zone {
        flex-wrap: wrap;
        text-align: center;
        justify-content: center;
    }

    .file-upload-info {
        flex: 1 1 100%;
        text-align: center;
    }

    .file-upload-btn {
        width: 100%;
    }
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

/* تحميل البيانات */
.data-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 26, 0.75);
    backdrop-filter: blur(4px);
}

.data-loading-box {
    text-align: center;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    background: var(--bg-card, #1a1d2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.data-loading-box i {
    font-size: 2rem;
    color: var(--primary, #6366f1);
    margin-bottom: 1rem;
    display: block;
}

.data-loading-box p {
    margin: 0;
    color: var(--text-muted, #9aa8be);
    font-size: 0.95rem;
}

/* تحذير file:// — معاينة التصميم */
#file-protocol-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.97), rgba(8, 51, 68, 0.97));
    color: #ecfdf5;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(45, 212, 191, 0.3);
}

body.has-file-banner {
    padding-top: 5.5rem;
}

body.has-file-banner .navbar {
    top: 5rem;
}

.file-protocol-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.file-protocol-close {
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.file-protocol-inner p {
    margin: 0.35rem 0;
    color: #a7f3d0;
}

.file-protocol-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin: 0.6rem 0;
}

.file-protocol-hint {
    font-size: 0.78rem;
    opacity: 0.85;
}

.file-protocol-hint code {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* ===== مربعات الإشعاع — محمية بالكامل (لا تتأثر بثيم v3) ===== */
.glow-zone-locked.best-researcher-card.premium-glow {
    --rank-1-color: #f59e0b !important;
    --rank-2-color: #0ea5e9 !important;
    --rank-3-color: #10b981 !important;
    --rank-4-color: #818cf8 !important;
    --rank-5-color: #f43f5e !important;
    --rank-6-color: #fbbf24 !important;
    --rank-7-color: #06b6d4 !important;
    --rank-8-color: #8b5cf6 !important;
    --rank-9-color: #d946ef !important;
    --rank-10-color: #14b8a6 !important;
    background: transparent !important;
    border: none !important;
    font-family: 'Tajawal', sans-serif !important;
}

.glow-zone-locked .best-researcher-card-inner {
    background: rgba(15, 17, 26, 0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.glow-zone-locked.premium-glow::after {
    background: rgba(15, 17, 26, 0.88) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
}

.glow-zone-locked .crown {
    color: var(--glow-color, #f59e0b) !important;
    filter: drop-shadow(0 0 10px var(--glow-color, rgba(245, 158, 11, 0.6))) !important;
}

.glow-zone-locked .rank-badge {
    background: linear-gradient(135deg, var(--glow-color, #f59e0b), rgba(0,0,0,0.35)) !important;
    color: #fff !important;
    font-family: 'Tajawal', sans-serif !important;
}

.glow-zone-locked h2 {
    color: var(--glow-color, #f59e0b) !important;
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 800 !important;
    -webkit-text-fill-color: unset !important;
    background: none !important;
}

.glow-zone-locked .profile-pic {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    border-color: var(--glow-color, #f59e0b) !important;
}

.glow-zone-locked .subtitle {
    color: #94a3b8 !important;
    font-family: 'Tajawal', sans-serif !important;
}

.glow-zone-locked .score-display {
    background: rgba(0, 0, 0, 0.45) !important;
    border-color: var(--glow-color, rgba(245, 158, 11, 0.35)) !important;
}

.glow-zone-locked .score-value {
    color: #fff !important;
    font-family: 'Tajawal', sans-serif !important;
}

.glow-zone-locked .score-unit {
    color: var(--glow-color, #f59e0b) !important;
}

/* ===== صف المربعات الثلاثة ===== */
.top-researchers-v2 {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.top3-glow-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.glow-card {
    position: relative;
    min-height: 320px;
    padding: 2rem 1.5rem !important;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.9rem;
}

.glow-card .best-researcher-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 1rem;
}

.glow-card .profile-pic {
    width: 84px;
    height: 84px;
    font-size: 2.4rem;
}

.glow-card h2 {
    font-size: 1.2rem !important;
    line-height: 1.4;
}

.glow-card .crown {
    font-size: 2.2rem;
    margin-bottom: 0;
}

.glow-card .rank-badge {
    font-size: 0.75rem;
}

.glow-card .score-display {
    padding: 0.4rem 1.2rem;
}

.top3-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
}

@media (max-width: 900px) {
    .top3-glow-row {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
}

/* ===== لوحة الإدارة — جوال ===== */
.admin-sidebar-toggle {
    position: fixed;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    left: max(1rem, env(safe-area-inset-left));
    z-index: 200;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.admin-mobile-bar {
    display: none;
}

@media (max-width: 991px) {
    body.admin-page {
        overflow-x: hidden;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    body.admin-page .admin-sidebar-toggle {
        display: flex !important;
    }

    body.admin-page .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem !important;
    }

    body.admin-page .logo-text p {
        display: none;
    }

    body.admin-page .logo-text h1 {
        font-size: 1rem;
    }

    body.admin-page .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }

    body.admin-page .nav-links .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }

    body.admin-page .admin-layout {
        display: block;
        min-height: auto;
    }

    body.admin-page .admin-content {
        padding: 0.75rem 0.75rem 1rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    body.admin-page .admin-content .modern-table {
        min-width: 520px;
        font-size: 0.82rem;
    }

    body.admin-page .modern-table th,
    body.admin-page .modern-table td {
        padding: 0.6rem 0.5rem;
    }

    body.admin-page .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    body.admin-page .stat-card {
        padding: 1rem;
    }

    body.admin-page .stat-info .number {
        font-size: 1.4rem;
    }

    body.admin-page .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    body.admin-page .filters-container select,
    body.admin-page .filters-container input {
        width: 100%;
    }

    body.admin-page .action-btns {
        flex-direction: column;
        align-items: stretch;
    }

    body.admin-page .action-btns .btn-icon {
        width: 100%;
        text-align: center;
    }

    body.admin-page .settings-grid {
        grid-template-columns: 1fr;
    }

    body.admin-page .table-responsive {
        margin: 0 -0.25rem;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    body.admin-page .glass-panel {
        border-radius: 14px;
    }

    body.admin-page .tab-content h2 {
        font-size: 1.15rem;
    }

    body.admin-page .sidebar {
        width: min(300px, 88vw);
        right: -320px;
        z-index: 1600;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    }

    body.admin-page .sidebar.open {
        right: 0;
    }

    body.admin-page .sidebar-overlay.show {
        display: block !important;
        z-index: 1550;
    }

    .admin-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        margin: -0.25rem 0 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
    }

    .admin-mobile-bar button {
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 0.5rem 0.85rem;
        font-family: inherit;
        font-size: 0.85rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .admin-mobile-bar span {
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--text-main);
    }

    body.admin-page .modal-content {
        width: 95% !important;
        max-width: 95vw !important;
        margin: 2vh auto;
        max-height: 92vh;
        overflow-y: auto;
    }
}
